:root {
    --primary-color: #ff4b72;
    --secondary-color: #ff8fa3;
    --bg-gradient-1: #1a0b2e;
    --bg-gradient-2: #4a235a;
    --text-light: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --blur-amount: blur(25px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
    background-attachment: fixed;
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
}

h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    font-weight: 600;
}

/* Floating Particles (Rain) */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.heart {
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    transform: rotate(45deg);
    animation: fallDown 5s linear infinite;
    opacity: 0.5;
    top: -50px;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    background: var(--primary-color);
    border-radius: 50%;
}

.heart::before { top: -7.5px; left: 0; }
.heart::after { top: 0; left: -7.5px; }

@keyframes fallDown {
    0% { top: -50px; transform: rotate(45deg) scale(0.5); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { top: 100vh; transform: rotate(45deg) scale(1.2); opacity: 0; }
}

/* Base Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
    transition: opacity 1s ease, visibility 1s;
}

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

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Sleek Glassmorphism Base */
.glass-panel, .glass-card, .bottom-dock, .global-music-player {
    background: var(--glass-bg);
    backdrop-filter: var(--blur-amount);
    -webkit-backdrop-filter: var(--blur-amount);
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Question Screen */
.glass-card {
    border-radius: 30px;
    padding: 4rem 5rem;
    text-align: center;
    max-width: 90%;
}
#question-screen h1 {
    font-size: 3.5rem;
    margin-bottom: 2.5rem;
    text-shadow: 0 4px 10px rgba(0,0,0,0.5);
    letter-spacing: 1px;
}
.buttons {
    display: flex;
    justify-content: center;
    gap: 2rem;
    position: relative;
    height: 80px;
}
.buttons button {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    padding: 12px 40px;
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    backdrop-filter: blur(10px);
}
#btn-yes {
    background: rgba(76, 175, 80, 0.2);
    color: white;
}
#btn-yes:hover {
    background: rgba(76, 175, 80, 0.5);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}
#btn-no {
    background: rgba(244, 67, 54, 0.2);
    color: white;
    position: relative;
}

/* App Container */
.app-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 10;
    transition: opacity 1s ease;
}
.app-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Global Music Player */
.global-music-player {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 20px;
    border-radius: 40px;
    z-index: 100;
}
.record {
    width: 40px;
    height: 40px;
    background: #111;
    border-radius: 50%;
    border: 2px solid #444;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: spin 3s linear infinite;
    animation-play-state: paused;
}
.record.playing { animation-play-state: running; }
.record-center {
    width: 12px;
    height: 12px;
    background: var(--primary-color);
    border-radius: 50%;
}
@keyframes spin { 100% { transform: rotate(360deg); } }
#play-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    outline: none;
    transition: 0.3s;
}
#play-btn:hover { color: var(--primary-color); transform: scale(1.1); }
.song-info {
    display: flex;
    flex-direction: column;
    max-width: 150px;
}
.song-info span {
    font-size: 0.7rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.song-info marquee {
    font-size: 0.9rem;
    font-weight: 300;
}

/* Pages Wrapper */
.pages-wrapper {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden; /* Wrapper no longer scrolls, preventing massive empty space from hidden pages */
}

/* Pages */
.page {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto; /* Each page scrolls independently */
    overflow-x: hidden;
    padding: 100px 20px 120px 20px; /* Padding applied inside the scrolling area */
    opacity: 0;
    visibility: hidden;
    pointer-events: none; /* Prevents interaction with hidden pages */
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(20px);
}

.page::-webkit-scrollbar { width: 6px; }
.page::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.page.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 5;
}

.glass-panel {
    border-radius: 20px;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 900px;
    margin: 0 auto; /* Keeps the glass panel centered inside the scrollable page */
}
.centered-panel {
    text-align: center;
    align-items: center;
}

/* Shared Titles */
.glass-panel h2 {
    color: var(--secondary-color);
    font-size: 2.2rem;
    margin-bottom: 1rem;
    text-align: center;
    text-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

/* Timer */
.timer-section { text-align: center; }
.timer {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.time-block {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 12px;
    min-width: 80px;
    border: 1px solid rgba(255,255,255,0.1);
}
.time-block span {
    display: block;
    font-size: 2.5rem;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
    color: var(--text-light);
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}
.time-block label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}
.start-date {
    margin-top: 1rem;
    font-style: italic;
    opacity: 0.6;
}

/* Slider */
.slider-container {
    position: relative;
    width: 100%;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--glass-border);
}
.slider {
    position: relative;
    width: 100%;
    height: 500px;
    background: rgba(0, 0, 0, 0.2); /* Siyah transparan arka plan */
}
.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.8s ease;
}
.slide.active {
    opacity: 1;
}
.slider-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
}
.slider-controls button {
    pointer-events: auto;
    background: rgba(0,0,0,0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.3s;
}
.slider-controls button:hover { background: rgba(0,0,0,0.6); }
.slider-dots {
    position: absolute;
    bottom: 15px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 10px;
}
.dot {
    width: 10px;
    height: 10px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}
.dot.active { background: white; transform: scale(1.2); }

/* Letter */
.letter-section {
    padding: 2rem;
    background: rgba(255,255,255,0.02);
    border-radius: 15px;
    border-left: 3px solid var(--primary-color);
}
.letter-text {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.8;
    text-align: justify;
}

/* Flip Cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}
.flip-card {
    background: transparent;
    width: 100%;
    height: 200px;
    perspective: 1000px;
    cursor: pointer;
}
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}
.flip-card:hover .flip-card-inner { transform: rotateY(180deg); }
.flip-card-front, .flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
}
.flip-card-front {
    background: rgba(255,255,255,0.05);
    font-size: 1.5rem;
    font-weight: 500;
}
.flip-card-back {
    background: linear-gradient(135deg, rgba(255,75,114,0.8), rgba(255,143,163,0.8));
    transform: rotateY(180deg);
    font-size: 1.1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}
.timeline::after {
    content: '';
    position: absolute;
    width: 2px;
    background: rgba(255,255,255,0.2);
    top: 0;
    bottom: 0;
    left: 20px;
}
.timeline-item {
    padding: 10px 0 30px 50px;
    position: relative;
}
.timeline-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    background: var(--text-light);
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    left: 13px;
    top: 15px;
    z-index: 1;
    box-shadow: 0 0 10px var(--primary-color);
}
.timeline-content {
    background: rgba(255,255,255,0.03);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--glass-border);
}
.timeline-content h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* Love Meter */
.love-meter-section { width: 100%; max-width: 500px; }
.glass-btn {
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    padding: 15px 40px;
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}
.glass-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
}
.meter-container {
    width: 100%;
    height: 30px;
    background: rgba(0,0,0,0.4);
    border-radius: 15px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    margin-bottom: 1.5rem;
}
.meter-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-color), var(--primary-color));
    transition: width 0.3s ease;
}
#love-result {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-light);
    text-shadow: 0 0 20px var(--primary-color);
}

/* Bottom Navigation Dock */
.bottom-dock {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    padding: 10px;
    border-radius: 40px;
    z-index: 100;
}
.nav-btn {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.6);
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-btn:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}
.nav-btn.active {
    color: white;
    background: rgba(255,255,255,0.2);
    box-shadow: inset 0 0 10px rgba(255,255,255,0.1);
}

/* Responsive */
@media (max-width: 768px) {
    #question-screen h1 { font-size: 2.5rem; }
    .global-music-player { top: 10px; right: 10px; padding: 5px 15px; }
    .song-info { max-width: 100px; }
    .bottom-dock {
        width: 95%;
        justify-content: space-around;
        padding: 10px 5px;
    }
    .nav-btn { padding: 8px 10px; font-size: 0.8rem; }
    .slider { height: 250px; }
    .time-block { min-width: 60px; padding: 0.8rem; }
    .time-block span { font-size: 1.5rem; }
}

/* Global Hidden Utility */
.hidden { display: none !important; opacity: 0; pointer-events: none; }

/* Flappy Heart Game Styles */
.game-instructions {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    font-weight: 300;
}
.game-container {
    position: relative;
    width: 320px;
    height: 480px;
    margin: 0 auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    border: 2px solid var(--glass-border);
}
#flappy-canvas {
    background: linear-gradient(180deg, #1a0b2e, #4a235a);
    display: block;
}
#game-over-screen {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    color: white;
}
#game-over-screen h3 { font-size: 2rem; color: var(--primary-color); text-shadow: 0 0 10px var(--primary-color); }
#game-over-screen p { font-size: 1.2rem; }
#final-score { font-weight: bold; font-size: 1.5rem; color: var(--secondary-color); }

/* --- Polaroids --- */
.polaroids-container {
    position: relative;
    width: 100%;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.polaroid {
    position: absolute;
    width: 250px;
    background: #fff;
    padding: 10px 10px 40px 10px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    transform: rotate(var(--rot)) translateY(0);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: grab;
    user-select: none;
    touch-action: none;
}
.polaroid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    pointer-events: none;
}
.polaroid p {
    color: #333;
    font-family: 'Kalam', cursive;
    text-align: center;
    margin-top: 10px;
    font-size: 1.2rem;
    pointer-events: none;
}
.polaroid.dragging {
    cursor: grabbing;
    transition: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.7);
    z-index: 100 !important;
}

.secret-key {
    position: absolute;
    text-align: center;
    z-index: 0; /* behind all polaroids initially */
    color: var(--secondary-color);
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.5s, transform 0.5s;
    transform: scale(0.5);
}
.secret-key.found {
    opacity: 1;
    transform: scale(1.2);
    animation: pulse 1s infinite alternate;
}

/* --- Vault & Notifications --- */
#notification-area {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.toast {
    background: rgba(255, 75, 114, 0.9);
    color: white;
    padding: 15px 30px;
    border-radius: 30px;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(255, 75, 114, 0.5);
    animation: slideDown 0.5s ease-out, fadeOut 0.5s ease-in 3.5s forwards;
}
@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; visibility: hidden; }
}

.keys-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}
.key-slot {
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.3);
    border: 2px dashed var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: 0.5s;
}
.key-slot.unlocked {
    background: rgba(255, 75, 114, 0.3);
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px var(--primary-color);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.audio-player-wrapper {
    margin-top: 20px;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 15px;
}
.hint-text {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-top: 10px;
}

/* --- Loading Screen --- */
#loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #0f0518;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 1s ease, visibility 1s ease;
}
#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}
.heartbeat-loader {
    position: relative;
    width: 200px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}
.heart-svg {
    position: absolute;
    animation: heartBeat 1s infinite alternate;
}
@keyframes heartBeat {
    0% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 75, 114, 0.5)); }
    100% { transform: scale(1.2); filter: drop-shadow(0 0 30px rgba(255, 75, 114, 1)); }
}
.ekg-svg {
    position: absolute;
    top: 0; left: 0;
}
.ekg-line {
    fill: none;
    stroke: var(--primary-color);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 300;
    stroke-dashoffset: 300;
    animation: ekgDraw 2s infinite linear;
}
@keyframes ekgDraw {
    0% { stroke-dashoffset: 300; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -300; }
}
.loading-text {
    margin-top: 40px;
    color: white;
    font-size: 1.5rem;
    font-family: 'Poppins', sans-serif;
    animation: pulse 1.5s infinite alternate;
    text-align: center;
}
