/**
 * Header Styles - Portal SAT iAudita
 *
 * Estilos para:
 * - Barra de navegación moderna
 * - Logo y marca
 * - Menú desktop con efectos
 * - Menú mobile responsive
 *
 * @package iAudita\Portal
 * @version 0.2.0
 */

/* ========================================
   HEADER GENERAL
   ======================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    /* Header moderno con gradiente sutil y sombra elegante */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(124, 58, 237, 0.1);
    box-shadow: 0 4px 20px 0 rgba(124, 58, 237, 0.08);
    transition: all var(--transition-base);
}

.site-header .navbar {
    padding: var(--spacing-md) 0;
    transition: all var(--transition-base);
}


/* ========================================
   LOGO Y MARCA
   ======================================== */

.navbar-brand {
    font-weight: var(--font-weight-extrabold);
    color: var(--color-dark) !important;
    display: flex;
    align-items: center;
    text-decoration: none !important;
    transition: all var(--transition-base);
    position: relative;
}

.navbar-brand:hover {
    transform: translateY(-2px);
}

.navbar-brand::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
    transition: width var(--transition-base);
}

.navbar-brand:hover::after {
    width: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

/* Logo image */
.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
    transition: all var(--transition-base);
    filter: drop-shadow(0 2px 4px rgba(124, 58, 237, 0.1));
}

.navbar-brand:hover .logo-image {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(124, 58, 237, 0.2));
}

/* Logo text */
.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.logo-main {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-extrabold);
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.logo-tagline {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--color-gray-600);
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* ========================================
   NAVEGACIÓN PRINCIPAL
   ======================================== */

.navbar-nav {
    gap: var(--spacing-xs);
    align-items: center;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: var(--color-gray-700) !important;
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    padding: var(--spacing-sm) var(--spacing-md) !important;
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(6, 182, 212, 0.08));
    opacity: 0;
    transition: opacity var(--transition-base);
    z-index: -1;
}

.nav-link:hover {
    color: var(--color-primary) !important;
    text-decoration: none;
    transform: translateY(-2px);
}

.nav-link:hover::before {
    opacity: 1;
}

.nav-link i {
    font-size: var(--font-size-sm);
    transition: transform var(--transition-base);
}

.nav-link:hover i {
    transform: scale(1.1);
}

/* Estado activo */
.nav-link.active {
    color: var(--color-white) !important;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    font-weight: var(--font-weight-semibold);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.nav-link.active::before {
    opacity: 0;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    border-radius: var(--border-radius-full);
}


/* Botón CTA especial - Prueba Gratis */
.nav-item:has(.nav-link[href*="https://iaudita.com/Registro"]) .nav-link {
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    color: var(--color-white) !important;
    font-weight: var(--font-weight-semibold);
    padding: var(--spacing-sm) var(--spacing-lg) !important;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-item:has(.nav-link[href*="https://iaudita.com/Registro"]) .nav-link::before {
    background: linear-gradient(135deg, var(--color-accent), var(--color-primary));
}

.nav-item:has(.nav-link[href*="https://iaudita.com/Registro"]) .nav-link:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

.nav-item:has(.nav-link[href*="https://iaudita.com/Registro"]) .nav-link:hover::before {
    opacity: 1;
}

.nav-item:has(.nav-link[href*="https://iaudita.com/Registro"]) .nav-link i {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* ========================================
   MENÚ MOBILE (HAMBURGER)
   ======================================== */

.navbar-toggler {
    border: 2px solid var(--color-primary);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius-lg);
    transition: all var(--transition-base);
    background: rgba(124, 58, 237, 0.05);
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
    outline: none;
    background: rgba(124, 58, 237, 0.1);
}

.navbar-toggler:hover {
    background: rgba(124, 58, 237, 0.1);
    transform: scale(1.05);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(124, 58, 237, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Mobile menu opened */
.navbar-collapse {
    transition: all var(--transition-slow);
}


/* ========================================
   SCROLL BEHAVIOR
   ======================================== */

/* Header al hacer scroll - efecto más pronunciado */
.site-header.scrolled {
    box-shadow: 0 8px 30px rgba(124, 58, 237, 0.15);
    background: rgba(255, 255, 255, 0.98);
}

.site-header.scrolled .navbar {
    padding: var(--spacing-sm) 0;
}

.site-header.scrolled .logo-image {
    height: 35px;
}


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

/* Mobile (hasta 767px) */
@media (max-width: 767px) {
    .logo-image {
        height: 32px;
    }

    .logo-main {
        font-size: var(--font-size-lg);
    }

    .logo-tagline {
        font-size: 0.65rem;
    }

    .navbar-collapse {
        margin-top: var(--spacing-md);
        padding: var(--spacing-lg);
        background: linear-gradient(135deg, rgba(124, 58, 237, 0.03), rgba(6, 182, 212, 0.03));
        border-radius: var(--border-radius-xl);
        border: 1px solid rgba(124, 58, 237, 0.1);
        box-shadow: 0 10px 40px rgba(124, 58, 237, 0.1);
    }

    .nav-item {
        margin-bottom: var(--spacing-sm);
    }

    .nav-link {
        padding: var(--spacing-md) var(--spacing-lg) !important;
        justify-content: flex-start;
        border-radius: var(--border-radius-md);
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-link.active {
        border-left: 4px solid var(--color-primary);
        background: linear-gradient(90deg, rgba(124, 58, 237, 0.15), transparent);
    }

    /* Botón CTA en mobile */
    .nav-item:has(.nav-link[href*="https://iaudita.com/Registro"]) {
        margin-top: var(--spacing-md);
        padding-top: var(--spacing-md);
        border-top: 1px solid rgba(124, 58, 237, 0.2);
    }

    .nav-item:has(.nav-link[href*="https://iaudita.com/Registro"]) .nav-link {
        justify-content: center;
        text-align: center;
        padding: var(--spacing-md) var(--spacing-xl) !important;
    }
}

/* Tablet y Desktop (768px+) */
@media (min-width: 768px) {
    .navbar-nav {
        gap: 0.25rem;
    }
}

/* Desktop Medio (992px+) */
@media (min-width: 992px) {
    .navbar-nav {
        gap: var(--spacing-sm);
    }
}

/* Desktop Grande (1200px+) */
@media (min-width: 1200px) {
    .navbar-nav {
        gap: var(--spacing-sm);
    }

    .nav-link {
        padding: var(--spacing-sm) var(--spacing-lg) !important;
    }
}

/* Desktop Extra Grande (1400px+) */
@media (min-width: 1400px) {
    .navbar-nav {
        gap: var(--spacing-md);
    }
}
