/* ==========================================================================
   HEADER.CSS - BRANDING RESPONSIVO CON LOGO OPTIMIZADO
   ========================================================================== */

/* ✅ SOLUCION AL PROBLEMA: Logo enorme que rompe el diseño */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 80px;

    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;

    animation: slideDownHeader 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes slideDownHeader {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Contenedor centrado del contenido */
.header-content-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ✅ LOGO CON TAMAÑO CONTROLADO */
.header-logo {
    height: 45px;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius-small);
    border: 2px solid var(--glass-border);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-smooth);
    flex-shrink: 0;
}

.header-logo:hover {
    transform: scale(1.05) rotate(2deg);
}

/* Contenedor de textos */
.header-titles {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    /* Evitar que textos largos rompan el layout */
}

/* Nombre + Frecuencia */
.header-name {
    font-family: var(--font-titulo);
    font-size: 1.2rem;
    letter-spacing: 3px;
    color: #fff;
    line-height: 1.2;
    /* Ajustado para evitar amontonamiento */
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.header-freq {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 300;
    margin-left: 8px;
}

/* Slogan */
.header-slogan {
    font-family: var(--font-creditos);
    font-size: 0.6rem;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-top: 5px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Espacio para que el contenido no quede debajo del header fijo */
.player-main {
    padding-top: 80px;
    /* Altura del header + margen */
}

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

/* Desktop grande */
@media (min-width: 1024px) {
    .site-header {
        padding: 12px 40px;
    }

    .header-logo {
        height: 45px;
    }

    .header-name {
        font-size: 1.2rem;
    }

    .header-slogan {
        font-size: 0.8rem;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1023px) {
    .header-logo {
        height: 45px;
    }

    .header-name {
        font-size: 1.05rem;
    }

    .header-slogan {
        font-size: 0.72rem;
    }
}

/* Móvil */
@media (max-width: 768px) {
    .site-header {
        padding: 8px 15px;
    }

    .header-content-centered {
        gap: 12px;
    }

    .header-logo {
        height: 35px;
    }

    .header-name {
        font-size: 1rem;
    }

    .header-freq {
        font-size: 0.8rem;
        margin-left: 6px;
    }

    .header-slogan {
        font-size: 0.68rem;
    }

    .player-main {
        padding-top: 70px;
    }
}

/* Móvil pequeño */
@media (max-width: 480px) {
    .site-header {
        padding: 6px 10px;
    }

    .header-content-centered {
        gap: 10px;
    }

    .header-logo {
        width: 40px;
        height: 40px;
    }

    .header-name {
        font-size: 0.9rem;
    }

    .header-freq {
        font-size: 0.75rem;
        display: block;
        /* En móvil pequeño, frecuencia en nueva línea */
        margin-left: 0;
    }

    .header-slogan {
        font-size: 0.65rem;
    }

    .player-main {
        padding-top: 65px;
    }
}

/* Modo landscape en móvil */
@media (max-height: 500px) and (orientation: landscape) {
    .site-header {
        padding: 5px 15px;
    }

    .header-logo {
        width: 35px;
        height: 35px;
    }

    .header-titles {
        gap: 0;
    }

    .header-name {
        font-size: 0.85rem;
    }

    .header-slogan {
        display: none;
        /* Ocultar slogan en landscape para ahorrar espacio */
    }

    .player-main {
        padding-top: 55px;
    }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {

    .site-header,
    .header-logo {
        animation: none !important;
        transition: opacity 0.2s ease !important;
    }
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .header-logo {
        border: 3px solid var(--text-white);
    }

    .header-name,
    .header-slogan {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    }
}

/* Focus visible para accesibilidad */
.site-header:focus-within {
    outline: 3px solid rgba(var(--primary-rgb), 0.6);
    outline-offset: -3px;
}