:root {
    --bg-main: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-primary: #2563eb;
    --accent-secondary: #3b82f6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(0, 0, 0, 0.08);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: 'Times New Roman', Times, serif;
    background: linear-gradient(-45deg, #fff0f5, #f8fafc, #e6e6fa, #ffffff);
    background-size: 400% 400%;
    animation: driftBackground 15s ease infinite;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

@keyframes driftBackground {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Times New Roman', Times, serif;
    line-height: 1.2;
}

.handwritten-reaction {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem;
    color: var(--accent-primary);
    margin-top: 12px;
    display: block;
}

.handwritten-title {
    font-family: 'Dancing Script', cursive;
    font-size: 1.5rem !important;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Password Gate */
.password-gate {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--glass-border);
}

.login-box h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    font-family: 'Dancing Script', cursive;
    color: var(--accent-primary);
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.login-box input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1rem;
    outline: none;
}

.login-box input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.login-box button {
    width: 100%;
    padding: 12px;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-full);
    font-weight: bold;
    font-size: 1.1rem;
    transition: var(--transition);
}

.login-box button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37,99,235,0.2);
}

.login-error {
    color: #ef4444 !important;
    margin-top: 16px;
    margin-bottom: 0 !important;
    font-size: 0.9rem;
}

.app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px 120px;
}

/* Hero Section */
.hero {
    padding: 80px 0 60px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    filter: blur(150px);
    opacity: 0.05;
    z-index: -1;
    border-radius: 50%;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.hero-art {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    transition: var(--transition);
}

.hero-art:hover {
    transform: scale(1.02);
}

.art-placeholder {
    width: 200px;
    height: 200px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 80px;
    color: white;
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2);
    position: relative;
    z-index: 2;
}

#hero-image-preview {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(37, 99, 235, 0.2);
    position: relative;
    z-index: 2;
}

.glow-effect {
    position: absolute;
    top: 10px;
    left: 10px;
    right: -10px;
    bottom: -10px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    filter: blur(20px);
    opacity: 0.3;
    z-index: 1;
}

.title {
    font-size: 4.5rem;
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(to right, #0f172a, #334155);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Dancing Script', cursive;
}

.subtitle {
    font-size: 1.4rem;
    color: var(--text-secondary);
    max-width: 500px;
    font-style: italic;
    margin-bottom: 8px;
}

.days-counter {
    font-size: 1rem;
    color: var(--accent-primary);
    font-weight: bold;
    margin-bottom: 24px;
}

.surprise-btn {
    padding: 10px 20px;
    background: white;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-full);
    color: var(--accent-primary);
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.surprise-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.1);
}

/* Episodes Section */
.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 16px;
}

.section-header h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.count-badge {
    background: #e2e8f0;
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.episode-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    gap: 24px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.episode-card:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: #bfdbfe;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.08);
}

.episode-card.active-episode {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2), 0 10px 25px rgba(37, 99, 235, 0.1);
    background: #f8fafc;
}

.episode-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    transition: var(--transition);
    border: 1px solid var(--glass-border);
}

.episode-card:hover .episode-play-btn {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    transform: scale(1.05);
}

.episode-play-btn.playing {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.episode-content {
    flex: 1;
}

.episode-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.episode-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.episode-title {
    font-size: 1.6rem;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--text-primary);
}

.episode-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-style: italic;
}

/* Global Player */
.global-player {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(150%);
    width: calc(100% - 48px);
    max-width: 900px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    z-index: 100;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.global-player.visible {
    transform: translateX(-50%) translateY(0);
}

.global-player.hidden {
    display: none;
}

.player-progress-container {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    cursor: pointer;
    position: relative;
}

.player-progress-container:hover {
    height: 6px;
}

.player-progress {
    height: 100%;
    background: var(--accent-gradient);
    width: 0%;
    position: relative;
    pointer-events: none;
}

.player-progress::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%) scale(0);
    width: 12px;
    height: 12px;
    background: var(--accent-primary);
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 0 5px rgba(37, 99, 235, 0.5);
}

.player-progress-container:hover .player-progress::after {
    transform: translate(50%, -50%) scale(1);
}

.player-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    gap: 24px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 30%;
    min-width: 200px;
}

.player-art {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.player-text {
    overflow: hidden;
}

.player-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    justify-content: center;
}

.control-btn {
    color: var(--text-secondary);
    font-size: 24px;
    transition: var(--transition);
}

.control-btn:hover {
    color: var(--accent-primary);
    transform: scale(1.1);
}

.play-btn {
    width: 48px;
    height: 48px;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover {
    background: var(--accent-secondary);
    color: white;
    transform: scale(1.05);
}

/* Heartbeat Animation for Play Button */
@keyframes heartbeat {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    15% { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    30% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
    45% { transform: scale(1.1); box-shadow: 0 0 0 5px rgba(37, 99, 235, 0); }
    60% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.play-btn.heartbeat {
    animation: heartbeat 1.5s infinite;
}

.player-time {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    width: 80px;
    justify-content: flex-end;
}

.player-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 20%;
    max-width: 120px;
    color: var(--text-secondary);
}

.player-volume input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: var(--radius-full);
    outline: none;
}

.player-volume input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    transition: var(--transition);
}

.player-volume input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Responsive Design */
@media (max-width: 768px) {
    .app-container {
        padding: 0 16px 120px;
    }

    .hero {
        padding: 40px 0;
    }

    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 24px;
    }

    .title {
        font-size: 3rem;
    }

    .subtitle {
        margin: 0 auto;
    }

    .episode-card {
        flex-direction: column;
        padding: 20px;
        gap: 16px;
    }

    .episode-play-btn {
        position: absolute;
        top: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    .episode-title {
        padding-right: 50px;
        font-size: 1.4rem;
    }

    .player-inner {
        padding: 12px 16px;
        gap: 12px;
    }

    .player-volume, .player-time {
        display: none;
    }

    .player-info {
        width: 50%;
        min-width: 0;
    }

    .player-controls {
        justify-content: flex-end;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 3rem;
    }
    
    .global-player {
        bottom: 12px;
        width: calc(100% - 24px);
    }
}
