/* =========================================
   Redvital Makro — Radio Corporativa
   Design System & Styles
   ========================================= */

/* --- Design Tokens --- */
:root {
    /* Brand Colors - Elegant Navy and Gold/Amber */
    --blue-primary: #1e3a8a;
    --blue-dark: #0f172a;
    --blue-light: #3b82f6;
    --blue-glow: rgba(59, 130, 246, 0.25);

    --red-primary: #d4af37; /* Gold */
    --red-dark: #b69121;
    --red-light: #fbe083;
    --red-glow: rgba(212, 175, 55, 0.25);

    /* Neutral Palette - Dark Mode */
    --bg-body: #0b0f19;
    --bg-card: rgba(15, 23, 42, 0.65);
    --bg-footer: #06080d;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-on-dark: #e8eaed;
    --border-light: rgba(255, 255, 255, 0.08);

    /* Accent Gradient */
    --gradient-brand: linear-gradient(135deg, var(--red-primary) 0%, #f59e0b 50%, var(--red-dark) 100%);
    --gradient-brand-hover: linear-gradient(135deg, var(--red-light) 0%, var(--red-primary) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5), 0 4px 12px rgba(0,0,0,0.3);
    --shadow-glow-blue: 0 0 40px rgba(59, 130, 246, 0.15);
    --shadow-glow-red: 0 0 40px rgba(212, 175, 55, 0.15);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Spacing */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --radius-full: 9999px;

    /* Transition */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-med: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Background Dynamic --- */
.bg-pattern {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(-45deg, #0f172a, #1e1b4b, #020617, #064e3b);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

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

.bg-pattern::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 0%, rgba(0,0,0,0.8) 100%);
    opacity: 0.7;
}



/* --- Main Content --- */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 24px 40px;
    position: relative;
    z-index: 1;
}

/* --- Pastors Banner --- */
.pastors-banner-wrapper {
    width: 100%;
    max-width: 1000px;
    margin-bottom: 24px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
    border: 1px solid var(--border-light);
    animation: fadeInUp 0.6s ease-out;
}

.pastors-banner-img {
    width: 100%;
    max-height: 180px;
    height: auto;
    display: block;
    object-fit: cover;
    object-position: center;
    background: rgba(15, 23, 42, 0.4);
}

/* --- Live Badge --- */
.live-badge-wrapper {
    margin-bottom: 24px;
}

.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    background: linear-gradient(135deg, var(--red-primary), var(--red-dark));
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    border-radius: var(--radius-full);
    box-shadow: 0 2px 12px var(--red-glow);
    animation: pulse-badge 2s ease-in-out infinite;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 2px 12px var(--red-glow); }
    50% { box-shadow: 0 4px 24px rgba(227, 6, 19, 0.35); }
}

/* --- Player Card --- */
.player-card {
    width: 100%;
    max-width: 560px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue);
    overflow: hidden;
    position: relative;
    transition: box-shadow var(--transition-slow);
}

.player-card:hover {
    box-shadow: var(--shadow-lg), var(--shadow-glow-blue), var(--shadow-glow-red);
}

.card-accent {
    height: 4px;
    background: var(--gradient-brand);
}


/* --- Station Info --- */
.station-info {
    text-align: center;
    padding: 24px 24px 8px;
}

.station-logo {
    width: 100%;
    max-width: 240px;
    max-height: 100px;
    height: auto;
    margin: 0 auto 12px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
}

.station-title {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 3px;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.station-subtitle {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--text-muted);
    margin-top: 6px;
    text-transform: uppercase;
}

/* --- Visualizer --- */
.visualizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    height: 48px;
    padding: 16px 32px 8px;
}

.visualizer-bar {
    width: 4px;
    border-radius: 2px;
    background: var(--gradient-brand);
    opacity: 0.2;
    height: 6px;
    transition: height var(--transition-fast), opacity var(--transition-fast);
}

.visualizer.active .visualizer-bar {
    opacity: 0.7;
    animation: visualizer-bounce 0.8s ease-in-out infinite alternate;
    animation-delay: calc(var(--i) * 0.05s);
}

@keyframes visualizer-bounce {
    0% { height: 6px; opacity: 0.4; }
    100% { height: calc(8px + var(--i) * 2px); opacity: 0.9; }
}

/* --- Now Playing --- */
.now-playing {
    padding: 8px 24px 16px;
    text-align: center;
}

.now-playing-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.now-playing-track {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* --- Controls --- */
.controls-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 8px 24px 20px;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.control-btn-primary {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--gradient-brand);
    color: white;
    box-shadow: 0 4px 16px var(--blue-glow);
}

.control-btn-primary:hover {
    background: var(--gradient-brand-hover);
    transform: scale(1.08);
    box-shadow: 0 6px 24px var(--blue-glow);
}

.control-btn-primary:active {
    transform: scale(0.96);
}

.control-btn-secondary {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.control-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.control-btn-secondary:active {
    transform: scale(0.95);
}

/* --- Volume --- */
.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider-wrapper {
    position: relative;
    width: 100px;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    background: var(--border-light);
}

.volume-slider {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    cursor: pointer;
    z-index: 2;
    margin: 0;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--blue-primary);
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
    margin-top: -4px;
}

.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--blue-primary);
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    cursor: pointer;
}

.volume-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--gradient-brand);
    border-radius: 3px;
    transition: width var(--transition-fast);
    z-index: 1;
    pointer-events: none;
}

.volume-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
}

/* --- Buffer Status --- */
.buffer-status {
    margin: 0 32px 20px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

/* --- Safari Fallback --- */
.safari-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.btn-listen-live {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--gradient-brand);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 4px 20px var(--red-glow);
    transition: all var(--transition-med);
}

.btn-listen-live:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px var(--red-glow);
}

.safari-hint {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.buffer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.buffer-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.buffer-value {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-muted);
    transition: color var(--transition-med);
}

.buffer-value.buffered {
    color: #16a34a;
}

.buffer-value.buffering {
    color: #d97706;
}

.buffer-value.error {
    color: var(--red-primary);
}

.buffer-bar-track {
    height: 8px;
    background: var(--border-light);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.buffer-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--blue-primary), var(--blue-light));
    transition: width 0.6s ease, background 0.4s ease;
    position: relative;
    z-index: 1;
}

.buffer-bar-fill.full {
    background: linear-gradient(90deg, #16a34a, #22c55e);
}

.buffer-bar-fill.error {
    background: linear-gradient(90deg, var(--red-primary), var(--red-light));
}

.buffer-bar-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
    animation: shimmer 2s linear infinite;
    z-index: 2;
    opacity: 0;
    transition: opacity var(--transition-med);
}

.buffer-bar-shimmer.active {
    opacity: 1;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}


/* --- Footer --- */
.footer {
    position: relative;
    z-index: 10;
    background: var(--bg-footer);
    border-top: 3px solid transparent;
    background-image: linear-gradient(var(--bg-footer), var(--bg-footer)), var(--gradient-brand);
    background-origin: border-box;
    background-clip: padding-box, border-box;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px 32px;
    text-align: center;
}

.footer-text {
    font-size: 13px;
    color: var(--text-on-dark);
    font-weight: 400;
    margin-bottom: 4px;
}

.footer-credit {
    font-size: 11px;
    color: rgba(232, 234, 237, 0.5);
    font-weight: 400;
}

/* --- Cookie Consent Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border-light);
    z-index: 100;
    padding: 16px 24px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    transform: translateY(100%);
    animation: slideUp 0.5s ease-out forwards;
}

.cookie-banner.hidden {
    display: none !important;
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.cookie-content {
    max-width: 1000px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.cookie-content p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.btn-consent {
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-accept {
    background: var(--red-primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--red-glow);
}

.btn-accept:hover {
    background: var(--red-light);
    transform: translateY(-2px);
}

.btn-decline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

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

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Responsive - Tablet --- */
@media (max-width: 900px) {
    .main-content {
        padding: 24px 20px 48px;
    }

    .pastors-banner-img {
        max-height: 150px;
    }
    
    .player-card {
        max-width: 85vw;
    }
}

/* --- Responsive - Mobile --- */
@media (max-width: 640px) {
    .main-content {
        padding: 16px 16px 32px;
    }

    .player-card {
        max-width: 100%;
    }

    .station-info {
        padding: 20px 16px 8px;
    }

    .pastors-banner-wrapper {
        margin-bottom: 16px;
    }
    .pastors-banner-img {
        max-height: 120px;
    }

    .cookie-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }

    .controls-container {
        padding: 8px 16px 20px;
    }
    .control-btn-primary {
        width: 56px;
        height: 56px;
    }
    .volume-slider-wrapper {
        width: 70px;
    }
    .buffer-status {
        margin: 0 16px 20px;
    }
    .now-playing {
        padding: 8px 16px 16px;
    }
}

@media (max-width: 380px) {
    .volume-slider-wrapper {
        width: 50px;
    }
    .volume-label {
        display: none;
    }
}

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

.live-badge-wrapper {
    animation: fadeInUp 0.6s ease-out;
}

.player-card {
    animation: fadeInUp 0.8s ease-out 0.1s both;
}
