/* ===================================
   GLOBAL STYLES & RESET
   =================================== */

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

:root {
    /* Color Palette - Valentine's Day Theme */
    --bg-primary: #1a2e2e;
    --bg-secondary: #2a3e3e;
    --text-primary: #FEFCFD;
    --text-secondary: #FBD0DE;
    --accent-soft: #76C2C7;
    --accent-teal: #6BB9B9;
    --accent-pink: #FBB0C6;
    --accent-blush: #FBD0DE;
    --accent-glow: rgba(118, 194, 199, 0.4);
    --accent-glow-pink: rgba(251, 176, 198, 0.4);
    --border-soft: rgba(118, 194, 199, 0.2);
    
    /* Typography */
    --font-serif: 'Playfair Display', 'Georgia', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 5rem;
    
    /* Transitions */
    --transition-smooth: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.3s ease;
}

/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&family=Inter:wght@300;400;500;600&display=swap');

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, #76C2C7 0%, #6BB9B9 25%, #FBD0DE 75%, #FBB0C6 100%);
    background-attachment: fixed;
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* ===================================
   PARTICLE BACKGROUND
   =================================== */

#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.4;
    pointer-events: none;
}

/* ===================================
   MAIN CONTAINER
   =================================== */

.container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

/* ===================================
   SCREEN MANAGEMENT
   =================================== */

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1s ease, visibility 1s ease;
    padding: var(--spacing-md);
}

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

.screen.fade-out {
    opacity: 0;
    transition: opacity 0.8s ease;
}

.screen.darkened {
    background: rgba(0, 0, 0, 0.3);
    transition: background 1.5s ease;
}

.content-center {
    text-align: center;
    max-width: 800px;
    width: 100%;
}

/* ===================================
   TYPOGRAPHY
   =================================== */

.main-text {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    line-height: 1.6;
    color: #FFFFFF;
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.02em;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.main-text.poetic {
    font-family: var(--font-serif);
    font-weight: 400;
    font-style: italic;
    color: #FFFFFF;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 30px rgba(118, 194, 199, 0.5);
}

.response-text,
.final-text,
.final-text-2 {
    font-size: clamp(1.3rem, 3.5vw, 2.2rem);
    font-weight: 300;
    line-height: 1.8;
    color: #FFFFFF;
    margin-bottom: var(--spacing-md);
    opacity: 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.final-text.poetic,
.final-text-2.poetic {
    font-family: var(--font-serif);
    font-weight: 400;
    font-style: italic;
    color: #FFFFFF;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 30px rgba(118, 194, 199, 0.5);
}

/* ===================================
   ANIMATIONS
   =================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInText {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 10px var(--accent-glow);
    }
    50% {
        text-shadow: 0 0 25px var(--accent-glow), 0 0 35px var(--accent-glow);
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.9;
    }
}

@keyframes sparkle {
    0% {
        opacity: 0;
        transform: scale(0) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(0) rotate(360deg);
    }
}

@keyframes heartFloat {
    0% {
        transform: translateY(0) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(-10px) scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) scale(0.5);
        opacity: 0;
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

.fade-in {
    animation: fadeIn 1s ease forwards;
}

.fade-in-delay {
    animation: fadeIn 1s ease 0.3s forwards;
    opacity: 0;
}

.fade-in-delay-2 {
    animation: fadeIn 1s ease 0.6s forwards;
    opacity: 0;
}

.text-fade-in {
    animation: fadeInText 1.5s ease forwards;
}

/* ===================================
   INPUT FIELD
   =================================== */

.name-input {
    width: 100%;
    max-width: 400px;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 1.2rem;
    font-family: var(--font-sans);
    color: #FFFFFF;
    background: linear-gradient(135deg, rgba(118, 194, 199, 0.1) 0%, rgba(251, 176, 198, 0.1) 100%);
    border: 2px solid var(--border-soft);
    border-radius: 50px;
    outline: none;
    text-align: center;
    transition: var(--transition-fast);
    margin-bottom: var(--spacing-md);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.name-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
    opacity: 0.8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.name-input:focus {
    border-color: var(--accent-soft);
    background: linear-gradient(135deg, rgba(118, 194, 199, 0.15) 0%, rgba(251, 176, 198, 0.15) 100%);
    box-shadow: 0 0 20px var(--accent-glow), 0 0 30px var(--accent-glow-pink);
}

/* ===================================
   BUTTONS
   =================================== */

.btn-primary,
.btn-emotion {
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: 1.1rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: #FFFFFF;
    background: linear-gradient(135deg, rgba(118, 194, 199, 0.2) 0%, rgba(251, 176, 198, 0.2) 100%);
    border: 2px solid var(--border-soft);
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition-fast);
    outline: none;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.btn-primary::before,
.btn-emotion::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: left 0.5s ease;
}

.btn-primary:hover::before,
.btn-emotion:hover::before {
    left: 100%;
}

.btn-primary:hover,
.btn-emotion:hover {
    background: linear-gradient(135deg, rgba(118, 194, 199, 0.3) 0%, rgba(251, 176, 198, 0.3) 100%);
    border-color: var(--accent-soft);
    box-shadow: 0 0 25px var(--accent-glow), 0 0 35px var(--accent-glow-pink);
    transform: translateY(-2px);
}

.btn-primary:active,
.btn-emotion:active {
    transform: translateY(0);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    align-items: center;
    margin-top: var(--spacing-md);
}

.btn-emotion {
    width: 100%;
    max-width: 300px;
}

/* ===================================
   BREATHING CIRCLE
   =================================== */

.breathing-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft) 0%, var(--accent-pink) 50%, transparent 70%);
    margin: var(--spacing-lg) auto;
    opacity: 0;
    animation: breathe 4s ease-in-out infinite;
    box-shadow: 0 0 40px var(--accent-glow), 0 0 50px var(--accent-glow-pink);
}

.breathing-circle.active {
    opacity: 0.6;
}

/* ===================================
   SPARKLE EFFECT
   =================================== */

#sparkleContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent-pink) 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-soft), 0 0 15px var(--accent-pink);
    animation: sparkle 2s ease-in-out forwards;
}

/* ===================================
   HEART EFFECTS
   =================================== */

.heart {
    position: absolute;
    width: 20px;
    height: 20px;
    pointer-events: none;
    animation: heartFloat 4s ease-in forwards;
}

.heart::before,
.heart::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 16px;
    background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-blush) 100%);
    border-radius: 10px 10px 0 0;
    box-shadow: 0 0 10px var(--accent-glow-pink);
}

.heart::before {
    left: 10px;
    transform: rotate(-45deg);
    transform-origin: 0 100%;
}

.heart::after {
    left: 0;
    transform: rotate(45deg);
    transform-origin: 100% 100%;
}

.pulse-effect {
    animation: pulse 2s ease-in-out infinite;
}

/* ===================================
   TYPEWRITER EFFECT
   =================================== */

.typewriter {
    overflow: hidden;
    border-right: 2px solid var(--accent-soft);
    white-space: nowrap;
    margin: 0 auto;
    animation: blink-caret 0.75s step-end infinite;
    display: inline-block;
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--accent-soft);
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .container {
        padding: var(--spacing-sm);
    }
    
    .main-text {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
        margin-bottom: var(--spacing-md);
    }
    
    .response-text,
    .final-text,
    .final-text-2 {
        font-size: clamp(1.1rem, 4.5vw, 1.6rem);
    }
    
    .name-input {
        font-size: 1rem;
        padding: 0.8rem var(--spacing-sm);
    }
    
    .btn-primary,
    .btn-emotion {
        font-size: 1rem;
        padding: 0.8rem var(--spacing-md);
    }
    
    .breathing-circle {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 480px) {
    .main-text {
        font-size: 1.2rem;
    }
    
    .response-text,
    .final-text,
    .final-text-2 {
        font-size: 1.1rem;
    }
    
    .button-group {
        gap: 0.8rem;
    }
}

/* ===================================
   ACCESSIBILITY
   =================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible for keyboard navigation */
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--accent-soft);
    outline-offset: 4px;
}