/* -------------------------------------------------------------
   Core Design System & Theme: Deep Violet & Neon Pink Glow
------------------------------------------------------------- */
:root {
    --primary: #ff2a7a;
    --primary-glow: rgba(255, 42, 122, 0.5);
    --secondary: #9d4edd;
    --accent: #e5c158;
    --accent-glow: rgba(229, 193, 88, 0.4);
    --bg-dark: #07030e;
    --bg-light: #120924;
    --text-color: #f3f0f7;
    --text-muted: #bdaecf;
    --glass-bg: rgba(18, 8, 28, 0.6);
    --glass-border: rgba(255, 42, 122, 0.15);
    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --transition-fast: 0.3s ease;
    --transition-slow: 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) var(--bg-dark);
}

body {
    font-family: 'Outfit', 'Noto Sans Sinhala', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-color);
    overflow-x: hidden;
    cursor: auto;
}

/* Custom Scrollbar for Chrome/Safari */
body::-webkit-scrollbar {
    width: 8px;
}
body::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
body::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}
body::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Custom Cursive class */
.letter-cursive, .hero-cursive {
    font-family: 'Great Vibes', cursive;
}

/* Background Canvas */
#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}



/* Glassmorphism utility */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--card-shadow);
    border-radius: 16px;
}

/* Helper classes */
.text-center { text-align: center; }
.hidden { display: none !important; opacity: 0; }
.sinhala-text { font-family: 'Noto Sans Sinhala', sans-serif; }

/* Buttons styling */
.glow-btn {
    position: relative;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border: none;
    outline: none;
    border-radius: 50px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 0 15px var(--primary-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.glow-btn span {
    position: relative;
    z-index: 2;
}

.glow-btn i {
    position: relative;
    z-index: 2;
    transition: transform var(--transition-fast);
}

.glow-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
    z-index: 1;
}

.glow-btn:hover::before {
    left: 100%;
}

.glow-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 25px var(--primary), 0 0 10px var(--secondary);
}

.glow-btn:hover i {
    transform: scale(1.2);
}

.glow-btn:active {
    transform: translateY(-1px);
}

.glow-btn.small-btn {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* -------------------------------------------------------------
   Section 1: The Lock Entry Gate
------------------------------------------------------------- */
#lock-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    background: radial-gradient(circle, #100624 0%, #030107 100%);
    transition: opacity 1s ease, visibility 1s;
}

.lock-card {
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 42, 122, 0.2);
    animation: fadeInUp 1s ease;
}

.heart-seal {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 20px;
    filter: drop-shadow(0 0 15px var(--primary));
}

.sinhala-title {
    font-family: 'Noto Sans Sinhala', sans-serif;
    font-size: 2rem;
    margin-bottom: 15px;
    background: linear-gradient(45deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sinhala-subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Pulse animation */
.animate-pulse {
    animation: heartPulse 1.5s infinite alternate ease-in-out;
}

@keyframes heartPulse {
    0% { transform: scale(1); }
    100% { transform: scale(1.15); filter: drop-shadow(0 0 25px var(--primary)); }
}

/* -------------------------------------------------------------
   Header / Navigation
------------------------------------------------------------- */
header {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    z-index: 100;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(18, 8, 28, 0.7);
}

.logo {
    font-family: 'Great Vibes', cursive;
    font-size: 2rem;
    font-weight: bold;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(255, 42, 122, 0.3));
}

nav {
    display: flex;
    gap: 20px;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
}

nav a:hover {
    color: var(--primary);
    background: rgba(255, 42, 122, 0.1);
}

/* -------------------------------------------------------------
   General Section Layout
------------------------------------------------------------- */
section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 20px;
    position: relative;
}

.section-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    background: linear-gradient(45deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 42, 122, 0.2));
}

.section-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 50px;
}

/* -------------------------------------------------------------
   Hero Section
------------------------------------------------------------- */
#hero {
    background: transparent;
}

.hero-content {
    animation: fadeInUp 1.2s ease;
}

.hero-cursive {
    font-size: 4rem;
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent-glow);
    margin-bottom: 10px;
}

.hero-sinhala-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.3;
}

.font-glow {
    text-shadow: 0 0 25px rgba(255, 42, 122, 0.5), 0 0 50px rgba(157, 78, 221, 0.3);
}

.hero-tagline {
    font-size: 1.3rem;
    color: var(--text-muted);
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto 40px auto;
}

.down-arrow {
    margin-top: 30px;
    font-size: 1.8rem;
    animation: bounce 2s infinite;
}

.down-arrow a {
    color: var(--primary);
    text-shadow: 0 0 10px var(--primary);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* -------------------------------------------------------------
   Timer Section
------------------------------------------------------------- */
.timer-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 40px;
    max-width: 850px;
    margin: 0 auto 40px auto;
    border: 1px solid rgba(255, 42, 122, 0.25);
    box-shadow: 0 0 30px rgba(255, 42, 122, 0.1);
}

.timer-box {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
}

.timer-num {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(45deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px var(--primary-glow);
}

.timer-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-top: 5px;
}

.love-message-badge {
    display: inline-block;
    padding: 15px 30px;
    font-size: 1.05rem;
    border-radius: 50px;
    color: var(--accent);
    border: 1px solid rgba(229, 193, 88, 0.2);
    box-shadow: 0 0 15px rgba(229, 193, 88, 0.05);
}

/* -------------------------------------------------------------
   Story/Timeline Section
------------------------------------------------------------- */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background: linear-gradient(to bottom, var(--primary), var(--secondary));
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 10px var(--primary-glow);
}

.timeline-item {
    padding: 20px 40px;
    position: relative;
    width: 50%;
}

.timeline-item.left {
    left: 0;
}

.timeline-item.right {
    left: 50%;
}

.timeline-dot {
    position: absolute;
    width: 28px;
    height: 28px;
    right: -14px;
    top: 30px;
    background: var(--bg-dark);
    border: 3px solid var(--primary);
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.75rem;
    box-shadow: 0 0 10px var(--primary);
}

.timeline-item.right .timeline-dot {
    left: -14px;
}

.timeline-content {
    padding: 30px;
    position: relative;
    border-radius: 16px;
    transition: transform var(--transition-fast), border var(--transition-fast);
}

.timeline-content:hover {
    border-color: var(--primary);
}

.timeline-date {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 8px;
}

.timeline-content h3 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--accent);
}

.timeline-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
}

/* Scrollable message content for timeline cards to keep them tidy */
.scrollable-text {
    max-height: 180px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 42, 122, 0.4) transparent;
}

.scrollable-text::-webkit-scrollbar {
    width: 4px;
}
.scrollable-text::-webkit-scrollbar-thumb {
    background: rgba(255, 42, 122, 0.4);
    border-radius: 4px;
}

.special-card {
    border: 1px solid rgba(255, 42, 122, 0.4);
    box-shadow: 0 0 25px rgba(255, 42, 122, 0.15);
}

.sinhala-teaser {
    margin-bottom: 20px;
    font-style: italic;
}

/* -------------------------------------------------------------
   Modal Style (Letter Popup & Lightbox)
------------------------------------------------------------- */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1100;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(5, 2, 10, 0.85);
    backdrop-filter: blur(8px);
}

.letter-container {
    width: 90%;
    max-width: 650px;
    height: 80vh;
    border-radius: 20px;
    border: 1px solid rgba(255, 42, 122, 0.3);
    z-index: 10;
    position: relative;
    overflow: hidden;
    animation: scaleUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 0 50px rgba(255, 42, 122, 0.25);
}

.close-letter-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2.2rem;
    cursor: pointer;
    z-index: 12;
    transition: color var(--transition-fast);
}

.close-letter-btn:hover {
    color: var(--primary);
}

.letter-paper {
    height: 100%;
    overflow-y: auto;
    padding: 50px 40px;
    background: radial-gradient(circle at top right, rgba(40, 15, 60, 0.8), rgba(15, 6, 25, 0.95));
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.letter-paper::-webkit-scrollbar {
    width: 6px;
}
.letter-paper::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}

.letter-cursive {
    font-size: 2.2rem;
    color: var(--accent);
    margin-bottom: 25px;
}

.letter-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 20px;
    color: #f0e6ff;
}

.letter-signature {
    margin-top: 40px;
    text-align: right;
}

.letter-signature p {
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* -------------------------------------------------------------
   Gallery Section (Masonry Grid)
------------------------------------------------------------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    grid-auto-rows: 260px;
    grid-gap: 20px;
    width: 100%;
}

.gallery-item {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform var(--transition-slow), box-shadow var(--transition-fast);
}

/* Simulated masonry heights */
.gallery-item:nth-child(3n+1) {
    grid-row-end: span 2;
}

.gallery-item:nth-child(5n+2) {
    grid-row-end: span 1.5;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(255, 42, 122, 0.3);
    border-color: rgba(255, 42, 122, 0.4);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, rgba(13, 5, 24, 0.9) 0%, rgba(13, 5, 24, 0.2) 70%, transparent 100%);
    opacity: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
    transition: opacity var(--transition-fast);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-overlay i {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 10px;
    transform: translateY(15px);
    transition: transform var(--transition-fast);
}

.gallery-overlay p {
    font-size: 0.85rem;
    letter-spacing: 1px;
    color: var(--accent);
    transform: translateY(15px);
    transition: transform var(--transition-fast) 0.05s;
}

.gallery-item:hover .gallery-overlay i,
.gallery-item:hover .gallery-overlay p {
    transform: translateY(0);
}

.gallery-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
    color: var(--text-muted);
}

.gallery-loading i {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

/* Lightbox Modal */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1200;
    background: rgba(5, 2, 10, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.lightbox-content {
    max-width: 85%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    object-fit: contain;
}

.lightbox-caption {
    margin-top: 15px;
    color: var(--text-muted);
    font-size: 1rem;
    text-align: center;
    letter-spacing: 1px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 3rem;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.lightbox-close:hover {
    color: var(--primary);
}

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.lightbox-prev:hover, .lightbox-next:hover {
    background: rgba(255, 42, 122, 0.2);
    border-color: var(--primary);
    color: var(--primary);
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

/* -------------------------------------------------------------
   Audio Control Floating Button
------------------------------------------------------------- */
#audio-control {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(8px);
    color: var(--text-color);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 900;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

#audio-control:hover {
    transform: scale(1.1);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

#audio-control.playing i {
    animation: pulseIcon 1s infinite alternate ease-in-out;
}

@keyframes pulseIcon {
    0% { transform: scale(1); }
    100% { transform: scale(1.18); }
}

/* -------------------------------------------------------------
   Footer
------------------------------------------------------------- */
footer {
    padding: 40px 20px;
    margin-top: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.footer-cursive {
    font-size: 2.2rem;
    color: var(--primary);
    margin-bottom: 8px;
    text-shadow: 0 0 10px var(--primary-glow);
}

.footer-sinhala {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.footer-copyright {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.25);
}

/* -------------------------------------------------------------
   Standard Keyframe Animations
------------------------------------------------------------- */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes scaleUp {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* -------------------------------------------------------------
   Responsive Media Queries
------------------------------------------------------------- */
@media (max-width: 900px) {
    body {
        cursor: auto; /* Fallback to default cursor on mobile/tablet */
    }
    #custom-cursor {
        display: none;
    }
    
    header {
        padding: 10px 20px;
        flex-direction: column;
        border-radius: 20px;
        gap: 10px;
        top: 10px;
    }
    
    nav {
        gap: 10px;
    }
    
    nav a {
        font-size: 0.85rem;
        padding: 4px 8px;
    }
    
    .timeline::after {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 20px;
    }
    
    .timeline-item.right {
        left: 0;
    }
    
    .timeline-dot {
        left: 6px !important;
        right: auto;
    }
    
    .timer-display {
        flex-wrap: wrap;
        padding: 20px;
        gap: 10px;
    }
    
    .timer-box {
        flex: unset;
        width: 45%;
    }
    
    .timer-num {
        font-size: 2.8rem;
    }
    
    .hero-sinhala-title {
        font-size: 2.2rem;
    }
    
    .hero-cursive {
        font-size: 3rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .letter-container {
        height: 85vh;
        width: 95%;
    }
    
    .letter-paper {
        padding: 40px 20px;
    }
    
    .lightbox-prev { left: 10px; }
    .lightbox-next { right: 10px; }
    
    .lightbox-prev, .lightbox-next {
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
}

@keyframes warningFlash {
    0% { opacity: 0.3; text-shadow: 0 0 5px #ff3b30; }
    100% { opacity: 1; text-shadow: 0 0 20px #ff3b30, 0 0 30px #ff3b30; }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
