/* Global Styles & Variables */
:root {
    --dark-bg-start: #11001c;
    /* Midnight purple */
    --dark-bg-end: #0a192f;
    /* Deep blue/navy */
    --reveal-bg-start: #ffb6c1;
    /* Soft pink */
    --reveal-bg-end: #ffd700;
    /* Gold */
    --text-primary: #ffffff;
    --text-secondary: #f0f0f0;
    --gold: #d4af37;
    --font-heading: 'Great Vibes', cursive;
    --font-body: 'Playfair Display', serif;
    --font-sans: 'Montserrat', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    /* Prevent selection of text during countdown/lock */
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--dark-bg-start), var(--dark-bg-end));
    color: var(--text-primary);
    overflow: hidden;
    /* Prevent scrolling initially */
    height: 100vh;
    width: 100vw;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.5s ease-in-out, visibility 1.5s ease-in-out;
    z-index: 10;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 20;
}

/* Container limits */
.content {
    text-align: center;
    z-index: 30;
    padding: 20px;
    max-width: 90%;
}

/* Typography */
.main-heading {
    font-family: var(--font-heading);
    font-size: 5.5rem;
    /* Increased for a much bigger, majestic look */
    font-weight: 400;
    color: var(--text-primary);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    /* Softer, broader glow */
    margin-bottom: 20px;
    line-height: 1.2;
}

.sub-heading {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 2.2rem;
    /* Increased */
    font-weight: 300;
    margin-bottom: 50px;
    letter-spacing: 1.5px;
    color: rgba(255, 255, 255, 0.9);
}

.unlock-text {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 30px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.secret-text-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.3);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 20px;
    text-decoration: underline;
    transition: color 0.3s ease;
    letter-spacing: 1px;
    padding: 0;
    text-transform: none;
    box-shadow: none;
}

.secret-text-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    transform: none;
    box-shadow: none;
}

/* Countdown Section */
.countdown-container {
    display: flex;
    justify-content: center;
    gap: 25px;
    /* Increased slightly */
    margin-top: 30px;
}

.time-box {
    background: rgba(255, 255, 255, 0.03);
    /* More transparent */
    border: 1px solid rgba(255, 215, 0, 0.15);
    /* Subtle gold border instead of white */
    border-radius: 16px;
    /* Softer radius */
    padding: 25px 20px;
    min-width: 110px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        inset 0 0 15px rgba(255, 215, 0, 0.05);
    /* Inner warm glow */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.time-box:hover {
    transform: translateY(-5px);
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(255, 215, 0, 0.1);
}

.time-val {
    display: block;
    font-size: 3.8rem;
    /* Slightly larger */
    font-weight: 700;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
    /* Stronger glow */
}

.time-label {
    display: block;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
    color: var(--text-secondary);
}

/* Password Screen */
.password-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.password-title {
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

input[type="password"] {
    width: 280px;
    /* Wider */
    padding: 16px 25px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    background: rgba(0, 0, 0, 0.4);
    /* Darker for contrast */
    border-radius: 40px;
    color: white;
    font-family: var(--font-sans);
    font-size: 1.1rem;
    text-align: center;
    outline: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy transition */
    letter-spacing: 2px;
}

input[type="password"]:focus {
    border-color: var(--gold);
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.4),
        inset 0 0 10px rgba(212, 175, 55, 0.2);
    transform: scale(1.02);
    background: rgba(0, 0, 0, 0.6);
}

button {
    padding: 14px 40px;
    border: none;
    border-radius: 40px;
    background: linear-gradient(135deg, var(--gold), #ffdf73, var(--gold));
    background-size: 200% 200%;
    color: #1a1a1a;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 1.05rem;
    cursor: pointer;
    transition: all 0.4s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    animation: gradientShift 3s ease infinite;
    box-shadow: 0 5px 20px rgba(212, 175, 55, 0.3);
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.6);
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.error-msg {
    color: #ff4d4d;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    margin-top: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-msg.visible {
    opacity: 1;
}

/* Invalid password animation */
.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* Reveal Screen Setup */
#reveal-screen.active {
    background: linear-gradient(135deg, #1f1118, #2e1e27);
    /* Softer dark romantic background for better contrast */
    overflow-y: auto;
    /* allow scrolling once unlocked */
    height: 100%;
}

.reveal-content {
    margin-top: 10vh;
    /* Scaled spacing */
    margin-bottom: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Button for opening gift */
.elegant-btn {
    margin-top: 40px;
    padding: 18px 50px;
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 2px;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.7);
    color: var(--gold);
    border-radius: 40px;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}

.elegant-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300px;
    height: 300px;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: -1;
}

.elegant-btn:hover {
    color: #ffd700;
    border-color: #ffd700;
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.4);
    transform: translateY(-3px);
}

.elegant-btn:hover::before {
    transform: translate(-50%, -50%) scale(1);
}

/* PDF Viewer and Frame */
.pdf-container {
    margin-top: 70px;
    /* Generous spacing before the gift */
    opacity: 0;
    transform: translateY(40px);
    /* Slightly deeper entrance */
    transition: opacity 1.5s ease, transform 1.5s cubic-bezier(0.2, 0.8, 0.2, 1);
    /* Smoother bezier */
    display: none;
    width: 100%;
    align-items: center;
    flex-direction: column;
}

.pdf-container.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.golden-frame {
    width: 95%;
    /* Increased from 90% */
    max-width: 1200px;
    /* Increased for a massive reading experience */
    height: 85vh;
    /* Massive cinematic height */
    min-height: 700px;
    margin: 0 auto;
    border: 2px solid rgba(212, 175, 55, 0.6);
    /* Softer golden border */
    border-radius: 8px;
    /* Slightly sharper corners for professional book look */
    padding: 15px;
    /* Inner matte-like spacing */
    background: rgba(255, 255, 255, 0.03);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 30px rgba(0, 0, 0, 0.6);
    /* Deeper, softer shadow */
    position: relative;
    overflow: hidden;
}

.golden-frame::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 1px solid rgba(212, 175, 55, 0.15);
    /* Outer glow detail */
    border-radius: 12px;
    pointer-events: none;
}

.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 4px;
    /* inner frame border */
    background-color: #fcfcfc;
    /* subtle off-white for pdf bg */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    /* inner shadow separating pdf from frame */
}

.footer-text {
    font-family: var(--font-body);
    font-style: italic;
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 40px;
    /* Ensure space below frame */
    font-weight: 300;
    letter-spacing: 1px;
}

/* Particles & Animations */
.particles-container,
.hearts-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 15;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    filter: blur(2px);
    animation: float 10s infinite linear;
}

.heart {
    position: absolute;
    font-size: 24px;
    /* Slightly larger */
    color: rgba(255, 182, 193, 0.7);
    text-shadow:
        0 0 15px rgba(255, 182, 193, 0.9),
        0 0 30px rgba(255, 182, 193, 0.4);
    /* Deeper romantic glow */
    animation: float-up 12s infinite ease-in;
    transform-origin: center;
}

@keyframes float {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) scale(0.5) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
    }

    80% {
        opacity: 0.8;
    }

    100% {
        transform: translateY(-20vh) scale(1.2) rotate(45deg);
        opacity: 0;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-heading {
        font-size: 3.5rem;
        /* Down from 4.5rem */
        line-height: 1.1;
    }

    .sub-heading {
        font-size: 1.5rem;
        /* Down from 1.8rem */
        margin-bottom: 30px;
    }

    .time-val {
        font-size: 2.5rem;
    }

    .time-box {
        min-width: 70px;
        padding: 15px;
    }

    .golden-frame {
        height: 450px;
        border-width: 2px;
    }

    .countdown-container {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .main-heading {
        font-size: 2.5rem;
        /* Ensure "Happy birthday my Shehzadi pari" fits on very small phones */
    }

    .sub-heading {
        font-size: 1.2rem;
    }

    .countdown-container {
        gap: 10px;
    }

    .time-box {
        min-width: 65px;
        padding: 10px;
    }

    .time-val {
        font-size: 2rem;
    }
}