/*
 * Barulho de Chuva - Immersive Rain Sound Experience
 * Cinematic, atmospheric design with elegant typography
 */

/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-deep: #0a0c0f;
    --bg-card: rgba(15, 20, 28, 0.85);
    --text-primary: #f0f2f5;
    --text-muted: rgba(240, 242, 245, 0.6);
    --text-dim: rgba(240, 242, 245, 0.4);
    --accent: #7cb4c4;
    --accent-glow: rgba(124, 180, 196, 0.4);
    --border: rgba(255, 255, 255, 0.08);

    /* Typography */
    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Inter', -apple-system, sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-deep);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Atmospheric Background ===== */
.background-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.background-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url('https://images.unsplash.com/photo-1534088568595-a066f410bcda?w=1920&q=80');
    background-size: cover;
    background-position: center;
    filter: brightness(0.3) saturate(0.8);
    transform: scale(1.05);
    animation: slowZoom 60s ease-in-out infinite alternate;
}

.rain-overlay {
    position: absolute;
    inset: 0;
    background-image: url('https://images.unsplash.com/photo-1519692933481-e162a57d6721?w=1920&q=80');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    mix-blend-mode: screen;
}

.gradient-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at 50% 0%, transparent 0%, var(--bg-deep) 70%),
        linear-gradient(180deg,
            rgba(10, 12, 15, 0.3) 0%,
            rgba(10, 12, 15, 0.6) 50%,
            rgba(10, 12, 15, 0.95) 100%
        );
}

@keyframes slowZoom {
    0% { transform: scale(1.05); }
    100% { transform: scale(1.12); }
}

/* ===== Main Content ===== */
.main-content {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    gap: var(--space-lg);
}

/* ===== Hero Title ===== */
.hero {
    text-align: center;
    animation: fadeInUp 1s ease-out;
}

.title {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    line-height: 1.1;
    color: var(--text-primary);
    text-shadow: 0 2px 40px rgba(0, 0, 0, 0.5);
}

.tagline {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 300;
    font-style: italic;
    color: var(--text-muted);
    margin-top: var(--space-xs);
    letter-spacing: 0.1em;
}

/* ===== Player Section ===== */
.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    animation: fadeInUp 1s ease-out 0.2s both;
}

/* ===== Play Button ===== */
.play-btn {
    position: relative;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-primary);
}

.play-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.play-btn:active {
    transform: scale(0.98);
}

.play-btn svg {
    width: 48px;
    height: 48px;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

.play-btn .play-icon {
    margin-left: 6px; /* Visual centering for play triangle */
}

/* Pulse Animation Rings */
.pulse-ring {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    opacity: 0;
    pointer-events: none;
}

.play-btn.playing .pulse-ring {
    animation: pulse 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.play-btn.playing .pulse-ring-2 {
    animation-delay: 1.5s;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* ===== Status Text ===== */
.status {
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ===== Controls ===== */
.controls {
    display: flex;
    gap: var(--space-sm);
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.control-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg-deep);
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

/* ===== Timer Display ===== */
.timer-display {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--accent);
    text-align: center;
    letter-spacing: 0.05em;
    min-height: 1.2em;
}

.timer-display:empty {
    display: none;
}

/* ===== Footer ===== */
.footer {
    animation: fadeInUp 1s ease-out 0.4s both;
}

.tip {
    font-size: 0.8125rem;
    font-weight: 300;
    color: var(--text-dim);
    letter-spacing: 0.02em;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Responsive ===== */
@media (max-width: 480px) {
    .main-content {
        padding: var(--space-md);
        gap: var(--space-md);
    }

    .play-btn {
        width: 120px;
        height: 120px;
    }

    .play-btn svg {
        width: 40px;
        height: 40px;
    }

    .controls {
        max-width: 100%;
        padding: var(--space-sm);
    }

    .control-row {
        flex-wrap: wrap;
    }

    .slider-container {
        width: 100%;
        order: 1;
    }
}

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

    .background-layer::before {
        animation: none;
    }
}

/* Focus States */
.play-btn:focus-visible,
.slider:focus-visible,
.toggle input:focus-visible + .toggle-slider,
.select-container select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    :root {
        --border: rgba(255, 255, 255, 0.3);
        --text-muted: rgba(240, 242, 245, 0.8);
    }
}
