/* ============================================================
   FM Baires - Main Stylesheet
   Radio directory with responsive grid, golden featured cards,
   player modal and local recorder.
   ============================================================ */

:root {
    --color-bg: #0f1117;
    --color-bg-alt: #161a23;
    --color-card: #1c2130;
    --color-card-hover: #242b3d;
    --color-text: #e8eaf0;
    --color-text-muted: #9aa3b5;
    --color-primary: #f5c518;
    --color-gold: #d4af37;
    --color-gold-light: #f0d060;
    --color-gold-dark: #b8860b;
    --color-danger: #e74c3c;
    --color-success: #2ecc71;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    --gold-glow: 0 0 18px rgba(212, 175, 55, 0.45);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
    background: var(--color-bg-alt);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--color-text);
}

.brand-icon {
    font-size: 1.6rem;
}

.brand-text {
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-nav a {
    color: var(--color-text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover {
    color: var(--color-text);
}

.main-nav .nav-admin {
    background: rgba(212, 175, 55, 0.12);
    color: var(--color-gold-light);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.main-nav .nav-admin:hover {
    background: rgba(212, 175, 55, 0.22);
    color: var(--color-gold-light);
}

/* ============================================================
   AD BANNERS
   ============================================================ */
.ad-banner {
    position: relative;
    background: var(--color-bg-alt);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    overflow: hidden;
}

.ad-label {
    position: absolute;
    top: 4px;
    left: 8px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-text-muted);
    opacity: 0.7;
    z-index: 2;
    background: rgba(15, 17, 23, 0.6);
    padding: 1px 6px;
    border-radius: 4px;
}

.ad-placeholder {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    opacity: 0.6;
    text-align: center;
}

.ad-link {
    display: block;
    width: 100%;
    height: 100%;
}

.ad-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ad-media-img {
    object-fit: contain;
}

.ad-media-video {
    object-fit: cover;
}

.ad-banner-header {
    max-width: 1200px;
    height: 90px;
    margin-top: 10px;
}

.ad-banner-side {
    max-width: 300px;
    height: 250px;
    margin: 30px auto;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
    padding: 40px 0 20px;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(212, 175, 55, 0.08), transparent 60%);
}

.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-dark));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    color: var(--color-text-muted);
    max-width: 600px;
    margin: 0 auto 8px;
    font-size: 1.05rem;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    background: var(--color-card);
    padding: 10px 22px;
    border-radius: 30px;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.stat strong {
    color: var(--color-gold-light);
    font-size: 1.2rem;
    margin-right: 4px;
}

/* ============================================================
   SECTION HEADING
   ============================================================ */
.section-heading {
    text-align: center;
    margin: 20px 0 24px;
}

.section-heading h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.section-heading p {
    color: var(--color-text-muted);
}

/* ============================================================
   RADIO GRID
   ============================================================ */
.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
}

.radio-card {
    position: relative;
    background: var(--color-card);
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
    color: var(--color-text);
    font-family: inherit;
    text-align: center;
}

.radio-card:hover {
    transform: translateY(-4px);
    background: var(--color-card-hover);
    box-shadow: var(--shadow);
}

.radio-logo {
    width: 90px;
    height: 90px;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.radio-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 6px;
}

.radio-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    min-height: 2.4em;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   FEATURED (GOLDEN BORDER) STYLES
   ============================================================ */
.radio-card.featured {
    border: 2px solid var(--color-gold);
    background: linear-gradient(145deg, #2a2413, #1c2130);
    box-shadow: var(--gold-glow);
}

.radio-card.featured:hover {
    box-shadow: 0 0 26px rgba(212, 175, 55, 0.6);
    border-color: var(--color-gold-light);
}

.featured-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-dark));
    color: #1a1405;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.5);
    letter-spacing: 0.3px;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
    background: var(--color-card);
    border-radius: var(--radius);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact {
    background: var(--color-bg-alt);
    padding: 50px 0;
    margin-top: 40px;
}

.contact-form {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.form-group input,
.form-group textarea {
    background: var(--color-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--color-text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-gold);
}

.form-status {
    text-align: center;
    font-weight: 600;
    min-height: 24px;
}

.form-status.success { color: var(--color-success); }
.form-status.error { color: var(--color-danger); }

.captcha-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.captcha-question {
    flex: 1;
    background: var(--color-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--color-gold);
    text-align: center;
    user-select: none;
}

.captcha-refresh {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: var(--color-card);
    color: var(--color-text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.2s;
}

.captcha-refresh:hover {
    border-color: var(--color-gold);
    transform: rotate(20deg);
}

.captcha-refresh:active {
    transform: rotate(180deg);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-block;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, background 0.2s, opacity 0.2s;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-dark));
    color: #1a1405;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--color-gold), var(--color-gold-dark));
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 30px 0;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.footer-email {
    margin-top: 6px;
}

/* ============================================================
   PLAYER MODAL
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--color-bg-alt);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.modal-close:hover { color: var(--color-text); }

.modal-content {
    text-align: center;
}

.modal-logo {
    width: 110px;
    height: 110px;
    margin: 0 auto 16px;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.modal-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.modal h2 {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.modal-website {
    display: inline-block;
    color: var(--color-gold-light);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.modal-website:hover { text-decoration: underline; }

/* Player */
.player {
    margin-bottom: 24px;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.btn-play {
    background: linear-gradient(135deg, var(--color-gold-light), var(--color-gold-dark));
    color: #1a1405;
    border: none;
    border-radius: 30px;
    padding: 12px 32px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, opacity 0.2s;
}

.btn-play:hover { transform: translateY(-1px); }
.btn-play.playing {
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-share {
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.2s;
}

.btn-share:hover {
    transform: translateY(-1px);
    border-color: var(--color-gold);
}

.player audio {
    width: 100%;
    margin-bottom: 10px;
}

.player-status {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    min-height: 20px;
}

.player-status.playing { color: var(--color-success); }
.player-status.error { color: var(--color-danger); }

/* Recorder */
.recorder {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 20px;
}

.recorder h3 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.recorder-hint {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}

.recorder-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.btn-record {
    background: var(--color-danger);
    color: #fff;
}

.btn-record.recording {
    background: #c0392b;
    animation: pulse 1.2s infinite;
}

.btn-stop {
    background: var(--color-card);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.recorder-timer {
    font-size: 1.3rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-gold-light);
    margin-bottom: 4px;
}

.recorder-remaining {
    font-size: 0.95rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--color-warning, #e6a23c);
    margin-bottom: 10px;
}

.recorder-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.recorder-result audio {
    width: 100%;
}

.recorder-result .btn-download {
    background: var(--color-success);
    color: #fff;
}

.recorder-limit {
    color: var(--color-warning, #e6a23c);
    font-size: 0.9rem;
    text-align: center;
    margin: 4px 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .radio-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 14px;
    }

    .radio-logo {
        width: 72px;
        height: 72px;
    }

    .header-inner {
        flex-direction: column;
        gap: 10px;
    }

    .hero {
        padding: 28px 0 16px;
    }

    .ad-banner-header {
        height: 70px;
    }

    .main-nav {
        gap: 16px;
    }

    .main-nav a {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .radio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .radio-card {
        padding: 14px 10px;
    }

    .radio-logo {
        width: 64px;
        height: 64px;
    }

    .radio-name {
        font-size: 0.85rem;
    }

    .main-nav {
        gap: 14px;
    }

    .brand-text {
        font-size: 1.2rem;
    }

    .hero h1 {
        font-size: 1.6rem;
    }

    .hero p {
        font-size: 0.95rem;
    }

    .section-heading h2 {
        font-size: 1.5rem;
    }

    .ad-banner-header {
        height: 60px;
    }

    .ad-banner-side {
        height: 200px;
        max-width: 100%;
    }

    .modal-overlay {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        padding: 24px 16px;
        max-height: 92vh;
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        border-bottom: none;
    }

    .modal-logo {
        width: 90px;
        height: 90px;
    }

    /* Player controls stack full-width on small screens */
    .player-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .btn-play,
    .btn-share {
        width: 100%;
        padding: 14px 20px;
        font-size: 1rem;
    }

    .player audio {
        margin-bottom: 8px;
    }

    .recorder-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .recorder-controls .btn {
        width: 100%;
        padding: 14px 20px;
    }

    .recorder-timer {
        font-size: 1.2rem;
    }
}

@media (max-width: 360px) {
    .radio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .radio-logo {
        width: 56px;
        height: 56px;
    }

    .radio-name {
        font-size: 0.78rem;
    }

    .modal {
        padding: 20px 14px;
    }

    .modal h2 {
        font-size: 1.3rem;
    }

    .modal-logo {
        width: 80px;
        height: 80px;
    }

    .btn-play,
    .btn-share,
    .recorder-controls .btn {
        padding: 13px 16px;
        font-size: 0.95rem;
    }
}
