/* ===== RESET & VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --pink: #ff8aa7;
    --soft-pink: #ffb6c1;
    --rose: #e0a9b2;
    --red: #ff4d6d;
    --dark: #1a0f14;
    --glass: rgba(255, 255, 255, 0.1);
    
    --font-display: 'Dancing Script', cursive;
    --font-main: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-main);
    background: var(--dark);
    color: white;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader {
    text-align: center;
}

.heart-loader {
    width: 60px;
    height: 60px;
    background: var(--red);
    margin: 0 auto 20px;
    position: relative;
    transform: rotate(45deg);
    animation: heartbeat 1.2s ease infinite;
}

.heart-loader::before,
.heart-loader::after {
    content: '';
    width: 60px;
    height: 60px;
    background: var(--red);
    border-radius: 50%;
    position: absolute;
}

.heart-loader::before {
    left: -30px;
    top: 0;
}

.heart-loader::after {
    top: -30px;
    left: 0;
}

.loading-text {
    color: var(--soft-pink);
    font-size: 1rem;
    letter-spacing: 2px;
}

@keyframes heartbeat {
    0%, 100% { transform: rotate(45deg) scale(1); }
    25% { transform: rotate(45deg) scale(1.1); }
    35% { transform: rotate(45deg) scale(1.2); }
}

/* ===== AUDIO CONTROL ===== */
.audio-control {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
}

.music-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.music-btn:hover {
    transform: scale(1.1);
    background: var(--pink);
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

#bg-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: block;
}

.hero-content {
    max-width: 700px;
    width: 100%;
    padding: 40px 30px;
    background: var(--glass);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    text-align: center;
    animation: fadeIn 1.5s ease;
    position: relative;
    z-index: 1;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.date-badge {
    display: inline-block;
    padding: 5px 20px;
    background: rgba(255, 138, 167, 0.2);
    border: 1px solid var(--pink);
    border-radius: 30px;
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.hero-title {
    margin-bottom: 30px;
}

.title-small {
    display: block;
    font-size: 1.8rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.9);
}

.title-big {
    display: block;
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ff8aa7, #ff4d6d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.love-messages {
    min-height: 80px;
    margin-bottom: 35px;
}

.greeting {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--pink);
    margin-bottom: 5px;
}

.message {
    font-size: 1.1rem;
    color: var(--soft-pink);
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 15px 35px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--red), var(--pink));
    color: white;
    box-shadow: 0 0 20px rgba(255, 77, 109, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 77, 109, 0.5);
}

.btn-secondary {
    background: transparent;
    border: 2px solid var(--rose);
    color: white;
}

.btn-secondary:hover {
    background: var(--rose);
    transform: translateY(-3px);
}

.btn-icon {
    font-size: 1.2rem;
}

.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    opacity: 0.7;
    z-index: 1;
}

.scroll-line {
    width: 1px;
    height: 50px;
    background: linear-gradient(to bottom, white, transparent);
    margin: 10px auto 0;
    animation: scrollMove 2s infinite;
}

@keyframes scrollMove {
    0% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(0.5); opacity: 0; }
}

/* ===== POPUP ===== */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup.active {
    display: flex;
}

.popup-content {
    max-width: 400px;
    width: 90%;
    padding: 40px 30px;
    background: linear-gradient(135deg, #2d1a21, #1a0f14);
    border-radius: 25px;
    position: relative;
    animation: popupIn 0.4s ease;
    border: 1px solid var(--rose);
}

@keyframes popupIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.popup-close:hover {
    background: var(--glass);
    color: var(--red);
}

.popup-title {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--pink);
    margin-bottom: 25px;
    text-align: center;
}

.letter {
    line-height: 2;
}

.letter p {
    margin: 15px 0;
    font-size: 1.1rem;
}

.signature {
    font-family: var(--font-display);
    color: var(--rose);
    font-size: 1.3rem;
    text-align: right;
    margin-top: 25px;
}

/* ===== FLOATING HEARTS ===== */
.heart-float {
    position: fixed;
    pointer-events: none;
    z-index: 999;
    animation: floatUp 3s ease-out forwards;
}

@keyframes floatUp {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-200px) scale(0);
        opacity: 0;
    }
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--red), var(--pink));
    padding: 15px 30px;
    border-radius: 50px;
    color: white;
    font-size: 1.1rem;
    z-index: 2000;
    animation: toastIn 3s ease forwards;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

@keyframes toastIn {
    0% { opacity: 0; transform: translate(-50%, 20px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

/* ===== MOUSE TRAIL ===== */
.trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--pink);
    pointer-events: none;
    z-index: 9999;
    filter: blur(2px);
    box-shadow: 0 0 15px var(--pink);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .title-small {
        font-size: 1.5rem;
    }
    
    .title-big {
        font-size: 2.5rem;
    }
    
    .greeting {
        font-size: 1.8rem;
    }
    
    .message {
        font-size: 1rem;
    }
    
    .hero-content {
        padding: 30px 20px;
        margin: 15px;
    }
    
    .btn {
        padding: 12px 25px;
        font-size: 0.95rem;
        width: 100%;
        justify-content: center;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .title-small {
        font-size: 1.2rem;
    }
    
    .title-big {
        font-size: 2rem;
    }
    
    .greeting {
        font-size: 1.5rem;
    }
    
    .date-badge {
        font-size: 0.8rem;
        padding: 4px 15px;
    }
    
    .popup-content {
        padding: 30px 20px;
    }
    
    .popup-title {
        font-size: 1.8rem;
    }
    
    .letter p {
        font-size: 1rem;
    }
    
    .music-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
}

@media (max-width: 360px) {
    .hero-content {
        padding: 25px 15px;
    }
    
    .title-big {
        font-size: 1.8rem;
    }
    
    .greeting {
        font-size: 1.3rem;
    }
}

/* Fix for canvas on mobile */
@media (max-width: 768px) {
    #bg-canvas {
        touch-action: none;
    }
}