@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Merriweather&display=swap');

/* --- Password Protection Styles --- */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f8e8ee;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}
.password-box {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    text-align: center;
    width: 90%;
    max-width: 400px;
}
.password-box h2 {
    font-family: 'Dancing Script', cursive;
    color: #c2185b;
    font-size: 2.5em;
    margin-bottom: 10px;
}
.password-box p {
    margin-bottom: 20px;
    color: #555;
}
.password-box input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1.2em;
    text-align: center;
    margin-bottom: 20px;
}
.password-box button {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
    font-family: 'Merriweather', serif;
    background-color: #c2185b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
.error-message {
    color: red;
    height: 20px;
    margin-top: 10px !important;
}
.hidden {
    display: none !important;
}

/* --- Main App Styles --- */
body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f8e8ee;
    font-family: 'Merriweather', serif;
    overflow: hidden;
    padding: 20px 0;
}
.card-viewer {
    position: relative;
    width: 700px;
    height: 500px;
    perspective: 1500px;
}
.card {
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.8s ease-in-out, opacity 0.8s ease-in-out;
}
.card.is-flipped .card-inner {
    transform: rotateY(180deg);
}
.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1);
}
.card.exit-left {
    transform: translateX(-150%);
    opacity: 0;
}
.card.exit-right {
    transform: translateX(150%);
    opacity: 0;
}
.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.card-front {
    background: linear-gradient(45deg, #d81b60, #e91e63);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Dancing Script', cursive;
}
.card-front h1 {
    font-size: 4em;
}
.card-back {
    background-color: #fffaf0;
    transform: rotateY(180deg);
    display: flex;
}
.image-panel, .text-panel {
    width: 50%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 30px;
    box-sizing: border-box;
}
.image-panel img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid white;
    box-shadow: 0 5px 20px rgba(0,0,0,0.25);
}
.text-panel {
    flex-direction: column;
    font-family: 'Dancing Script', cursive;
    color: #5D4037;
    text-align: center;
}
.button-container {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}
#prev-btn, #next-btn {
    padding: 10px 25px;
    font-size: 1.1em;
    font-family: 'Merriweather', serif;
    background-color: #c2185b;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, opacity 0.3s;
}
#prev-btn:disabled, #next-btn:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}
.card-back.text-only .text-panel {
    width: 100%;
    font-size: 1.2em;
}

/* --- Responsive Design for Mobile --- */
@media (max-width: 768px) {
    .card-viewer {
        width: 90vw;
        height: 70vh;
    }
    .card-front h1 {
        font-size: 2.5em;
    }
    .card-back {
        flex-direction: column;
        overflow-y: auto;
    }
    .image-panel, .text-panel {
        width: 100%;
        height: 50%;
        padding: 15px;
    }
    .image-panel img {
        width: 120px;
        height: 120px;
        border-width: 5px;
    }
    .text-panel {
        justify-content: center;
    }
    .text-panel h2 {
        font-size: 2.2em;
    }
    .text-panel p {
        font-size: 1.2em;
    }
    .card-back.text-only .text-panel {
        height: 100%;
        font-size: 1em;
    }
    .button-container {
        margin-top: 20px;
    }
    #prev-btn, #next-btn {
        font-size: 1em;
        padding: 8px 18px;
    }
}