/* ===========================
   RESET & BASE STYLES
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: #0f0f0f;
    color: #f3f3f3;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    position: relative;
}

/* ===========================
   NOISE TEXTURE OVERLAY
   =========================== */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    z-index: 1;
}

/* ===========================
   START SCREEN
   =========================== */
.start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #0f0f0f;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: opacity 0.8s ease;
}

.start-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.start-button {
    padding: 15px 50px;
    font-size: 18px;
    font-weight: 500;
    background-color: rgba(243, 243, 243, 0.1);
    border: 1px solid rgba(243, 243, 243, 0.3);
    color: #f3f3f3;
    border-radius: 30px;
    cursor: pointer;
    margin-bottom: 40px;
    transition: all 0.3s ease;
}

.start-button:hover {
    background-color: rgba(243, 243, 243, 0.2);
    border-color: rgba(243, 243, 243, 0.6);
    transform: scale(1.05);
}

.start-text {
    font-size: 14px;
    color: rgba(243, 243, 243, 0.6);
    letter-spacing: 1px;
    font-weight: 300;
}

/* ===========================
   PROGRESS BAR (Instagram Style)
   =========================== */
.progress-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    max-width: 250px;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    overflow: hidden;
    z-index: 100;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: #f3f3f3;
    border-radius: 2px;
    transition: width linear;
}

/* ===========================
   CONTENT CONTAINER
   =========================== */
.content-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

/* ===========================
   BACKGROUND GLOW
   =========================== */
.background-glow {
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    animation: floatingGlow 8s ease-in-out infinite;
    z-index: -1;
}

.background-glow.active {
    opacity: 1;
}

@keyframes floatingGlow {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        transform: translate(-50%, -48%) scale(1.05);
    }
}

/* ===========================
   RED GLOW (Special Effect)
   =========================== */
.red-glow {
    position: absolute;
    width: 1600px;
    height: 1600px;
    background: radial-gradient(circle, rgba(255, 59, 59, 0.6) 0%, rgba(255, 59, 59, 0.4) 30%, rgba(255, 59, 59, 0.2) 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
    bottom: -800px;
    left: 50%;
    transform: translateX(-50%);
    z-index: -1;
    transition: none;
}

.red-glow.rise {
    animation: riseAndFloat 8s ease-in-out infinite;
}

.red-glow.stay {
    animation: riseAndFloat 8s ease-in-out infinite;
}

@keyframes riseAndFloat {
    0% {
        opacity: 0;
        bottom: -800px;
    }
    25% {
        opacity: 0.6;
        bottom: -200px;
    }
    50% {
        opacity: 0.5;
        bottom: -150px;
    }
    75% {
        opacity: 0.45;
        bottom: -180px;
    }
    100% {
        opacity: 0.4;
        bottom: -220px;
    }
}

/* ===========================
   TEXT CONTAINER
   =========================== */
.text-container {
    max-width: 800px;
    width: 90%;
    padding: 0 30px;
    text-align: center;
    z-index: 10;
}

.main-text {
    font-size: 26px;
    font-weight: 300;
    line-height: 1.7;
    letter-spacing: 0.6px;
    color: #f3f3f3;
    opacity: 0;
    transform: translateY(15px);
    filter: blur(5px);
    transition: opacity 1.2s ease, transform 1.2s ease, filter 1.2s ease;
}

.main-text.visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
    animation: textFloat 6s ease-in-out infinite;
}

.main-text.fade-out {
    animation: textFadeOut 0.8s ease forwards;
}

.main-text.love-text {
    font-weight: 500;
    font-size: 30px;
}

@keyframes textFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-18px);
    }
}

@keyframes textFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-15px);
        filter: blur(5px);
    }
}

/* ===========================
   BOTTOM TEXT (Final Page)
   =========================== */
.bottom-text {
    position: absolute;
    bottom: 280px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 300;
    opacity: 0;
    color: #f3f3f3;
    letter-spacing: 0.5px;
    transition: opacity 0.8s ease;
    z-index: 10;
}

.bottom-text.visible {
    opacity: 0.6;
}

/* ===========================
   RESTART BUTTON
   =========================== */
.restart-button {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 25px;
    font-size: 14px;
    font-weight: 500;
    background-color: rgba(243, 243, 243, 0.1);
    border: 1px solid rgba(243, 243, 243, 0.3);
    color: #f3f3f3;
    border-radius: 25px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.6s ease, background-color 0.3s ease, border-color 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.restart-button.visible {
    opacity: 1;
    pointer-events: auto;
    animation: fadeInSmooth 1.2s ease-in-out forwards;
}

.restart-button:hover {
    background-color: rgba(243, 243, 243, 0.2);
    border-color: rgba(243, 243, 243, 0.6);
}

@keyframes fadeInSmooth {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ===========================
   SONG BUTTON (Song for you)
   =========================== */
.song-button {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 25px;
    font-size: 14px;
    font-weight: 500;
    background-color: rgba(243, 243, 243, 0.1);
    border: 1px solid rgba(243, 243, 243, 0.3);
    color: #f3f3f3;
    border-radius: 25px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.6s ease, background-color 0.3s ease, border-color 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.song-button.visible {
    opacity: 1;
    pointer-events: auto;
    animation: fadeInSmooth 1.2s ease-in-out forwards;
}

.song-button:hover {
    background-color: rgba(243, 243, 243, 0.2);
    border-color: rgba(243, 243, 243, 0.6);
}

/* ===========================
   NAVIGATION BUTTONS
   =========================== */
.nav-button {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(243, 243, 243, 0.3);
    cursor: pointer;
    padding: 20px;
    transition: color 0.3s ease, opacity 0.3s ease;
    z-index: 50;
    opacity: 0.3;
}

.nav-button:hover {
    color: rgba(243, 243, 243, 0.9);
    opacity: 1;
}

.nav-button:disabled {
    opacity: 0.1;
    cursor: not-allowed;
}

.nav-prev {
    left: 20px;
}

.nav-next {
    right: 20px;
}

.nav-button svg {
    width: 32px;
    height: 32px;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .text-container {
        width: 85%;
        max-width: 100%;
        padding: 0 20px;
    }

    .main-text {
        font-size: 20px;
        line-height: 1.6;
        letter-spacing: 0.5px;
    }

    .main-text.love-text {
        font-size: 24px;
    }

    .background-glow {
        width: 300px;
        height: 300px;
    }

    .red-glow {
        width: 1200px;
        height: 1200px;
        bottom: -600px;
    }

    .nav-button {
        padding: 15px;
    }

    .nav-button svg {
        width: 24px;
        height: 24px;
    }

    .nav-prev {
        left: 10px;
    }

    .nav-next {
        right: 10px;
    }

    .progress-container {
        top: 15px;
        width: 50%;
        max-width: 200px;
    }

    .bottom-text {
        bottom: 200px;
        font-size: 12px;
    }

    .restart-button {
        bottom: 100px;
        left: 50%;
        transform: translateX(-50%);
        padding: 8px 20px;
        font-size: 12px;
    }

    .song-button {
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);
        padding: 8px 20px;
        font-size: 12px;
    }

    .start-button {
        padding: 12px 40px;
        font-size: 16px;
    }

    .start-text {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }

    .content-container {
        padding-top: 60px;
        padding-bottom: 100px;
    }

    .text-container {
        width: 90%;
        padding: 0 15px;
    }

    .main-text {
        font-size: 18px;
        line-height: 1.5;
    }

    .main-text.love-text {
        font-size: 22px;
    }

    .background-glow {
        width: 250px;
        height: 250px;
    }

    .red-glow {
        width: 1000px;
        height: 1000px;
        bottom: -500px;
    }

    .progress-container {
        top: 10px;
        width: 60%;
        max-width: 200px;
    }

    .nav-button {
        padding: 10px;
    }

    .nav-button svg {
        width: 20px;
        height: 20px;
    }

    .nav-prev {
        left: 5px;
    }

    .nav-next {
        right: 5px;
    }

    .bottom-text {
        bottom: 180px;
        font-size: 11px;
    }

    .restart-button {
        bottom: 95px;
        left: 50%;
        transform: translateX(-50%);
        padding: 8px 16px;
        font-size: 11px;
        width: auto;
    }

    .song-button {
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);
        padding: 8px 16px;
        font-size: 11px;
        width: auto;
    }

    .start-button {
        padding: 12px 35px;
        font-size: 15px;
    }

    .start-text {
        font-size: 11px;
    }
}

/* ===========================
   SMOOTH TRANSITIONS
   =========================== */
.fade-out {
    animation: fadeOut 0.8s ease forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}
