/**
 * UBICACIÓN: assets/css/navbar_active_styles.css (O integrado al final de campoaventuras.css)
 * DESCRIPCIÓN: Estilos mejorados para navbar activo con detección de página
 * Resalta en naranja (color-primary) los enlaces activos y dropdowns
 * Versión: 1.0 | Fecha: 2025-10-18
 * NOTA: Agregar después de los estilos base del navbar en campoaventuras.css
 */

/* ===================================
   VARIABLES (Si no están definidas)
   =================================== */

:root {
    --color-primary: #ff6600;
    --color-primary-light: #ff8533;
    --color-primary-dark: #cc5200;
    --transition-normal: 0.3s ease;
}

/* ===================================
   NAVBAR - ENLACES ACTIVOS (MEJORADO)
   =================================== */

/* Enlace activo principal - estado base */
.navbar-custom .nav-link-ca.active {
    color: var(--color-primary) !important;
    font-weight: 700;
    position: relative;
}

/* Línea decorativa debajo del enlace activo */
.navbar-custom .nav-link-ca.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
    opacity: 1;
}

/* Efecto hover en enlace activo */
.navbar-custom .nav-link-ca.active:hover {
    color: var(--color-primary-dark) !important;
    text-shadow: 0 0 10px rgba(255, 102, 0, 0.3);
}

/* ===================================
   DROPDOWN TOGGLE - ESTADO ACTIVO
   =================================== */

/* Dropdown toggle activo */
.navbar-custom .dropdown-toggle.active {
    color: var(--color-primary) !important;
    font-weight: 700;
}

/* Flecha del dropdown activo */
.navbar-custom .dropdown-toggle.active::after {
    border-color: var(--color-primary);
    opacity: 1;
}

/* Linea decorativa en dropdown activo */
.navbar-custom .dropdown-toggle.active::before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
    opacity: 1;
}

/* ===================================
   DROPDOWN MENU - ITEMS ACTIVOS
   =================================== */

/* Dropdown menu mejorado */
.navbar-custom .dropdown-menu {
    border: 1px solid rgba(255, 102, 0, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: dropdownSlideIn 0.3s ease;
}

/* Item de dropdown activo */
.navbar-custom .dropdown-menu .dropdown-item.active {
    background-color: rgba(255, 102, 0, 0.1);
    color: var(--color-primary) !important;
    font-weight: 600;
    border-left: 4px solid var(--color-primary);
    padding-left: calc(1rem - 4px);
}

/* Icono en item activo */
.navbar-custom .dropdown-menu .dropdown-item.active i {
    color: var(--color-primary);
    font-weight: 700;
}

/* Hover en item activo */
.navbar-custom .dropdown-menu .dropdown-item.active:hover {
    background-color: rgba(255, 102, 0, 0.2);
    color: var(--color-primary-dark) !important;
}

/* Item de dropdown normal (no activo) */
.navbar-custom .dropdown-menu .dropdown-item {
    color: #666;
    transition: all var(--transition-normal);
    border-left: 4px solid transparent;
    padding-left: 1rem;
}

/* Hover en item normal */
.navbar-custom .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 102, 0, 0.08);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    transform: translateX(4px);
}

/* ===================================
   BOTÓN CTA - ESTADO ACTIVO
   =================================== */

/* Botón CTA (Registrarse) activo */
.navbar-custom .btn-cta.active {
    background: var(--color-primary-dark) !important;
    border-color: var(--color-primary-dark) !important;
    box-shadow: 0 6px 20px rgba(204, 82, 0, 0.4);
}

.navbar-custom .btn-cta.active:hover {
    background: var(--color-primary-dark) !important;
    border-color: var(--color-primary-dark) !important;
    box-shadow: 0 8px 25px rgba(204, 82, 0, 0.5);
}

/* ===================================
   ANIMACIONES PARA NAVBAR ACTIVO
   =================================== */

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes navActivePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 102, 0, 0.4);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 102, 0, 0);
    }
}

/* ===================================
   ESTADO ACTIVO EN MOBILE
   =================================== */

@media (max-width: 991px) {
    /* Navbar collapse mejorado */
    .navbar-custom .navbar-collapse.show {
        background: rgba(26, 26, 26, 0.98);
        backdrop-filter: blur(10px);
        padding: 1rem 0;
    }

    /* Enlace activo en mobile */
    .navbar-custom .nav-link-ca.active {
        background: rgba(255, 102, 0, 0.1);
        padding: 0.75rem 1rem;
        border-radius: 8px;
        margin: 0.25rem;
    }

    /* Quitar línea decorativa en mobile */
    .navbar-custom .nav-link-ca.active::after {
        display: none;
    }

    /* Dropdown toggle en mobile */
    .navbar-custom .dropdown-toggle.active::before {
        display: none;
    }

    /* Item dropdown en mobile */
    .navbar-custom .dropdown-menu .dropdown-item {
        padding: 0.75rem 1.5rem;
        border-left: none;
        border-top: 1px solid rgba(255, 102, 0, 0.1);
    }

    .navbar-custom .dropdown-menu .dropdown-item.active {
        background-color: rgba(255, 102, 0, 0.15);
        border-left: none;
        border-top: 1px solid rgba(255, 102, 0, 0.2);
        padding-left: 1.5rem;
    }

    .navbar-custom .dropdown-menu .dropdown-item:hover {
        border-left-color: transparent;
        padding-left: 1.5rem;
    }
}

/* ===================================
   INDICADOR VISUAL DE PÁGINA ACTUAL
   =================================== */

/* Badge visual para navbar activo */
.navbar-custom .nav-link-ca.active::before {
    content: '';
    position: absolute;
    top: 2px;
    right: -8px;
    width: 8px;
    height: 8px;
    background: var(--color-primary);
    border-radius: 50%;
    display: none;
}

@media (min-width: 992px) {
    .navbar-custom .nav-link-ca.active::before {
        display: block;
    }
}

/* ===================================
   MEJORAS DE ACCESIBILIDAD
   =================================== */

/* Focus visible para navegación por teclado */
.navbar-custom .nav-link-ca:focus-visible,
.navbar-custom .dropdown-item:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Alto contraste para elementos activos */
@media (prefers-contrast: more) {
    .navbar-custom .nav-link-ca.active {
        color: var(--color-primary-dark) !important;
        font-weight: 800;
    }

    .navbar-custom .dropdown-menu .dropdown-item.active {
        background-color: rgba(255, 102, 0, 0.2);
        border-left-width: 6px;
    }
}

/* ===================================
   TEMA OSCURO - NAVBAR ACTIVO
   =================================== */

[data-theme="dark"] .navbar-custom .nav-link-ca.active {
    color: #ff8533 !important;
    text-shadow: 0 0 10px rgba(255, 133, 51, 0.4);
}

[data-theme="dark"] .navbar-custom .dropdown-menu {
    background-color: #2d2d44;
    border-color: rgba(255, 102, 0, 0.3);
}

[data-theme="dark"] .navbar-custom .dropdown-menu .dropdown-item {
    color: #cbd5e0;
}

[data-theme="dark"] .navbar-custom .dropdown-menu .dropdown-item:hover {
    background-color: rgba(255, 102, 0, 0.15);
    color: #ff8533;
}

[data-theme="dark"] .navbar-custom .dropdown-menu .dropdown-item.active {
    background-color: rgba(255, 102, 0, 0.2);
    color: #ff8533 !important;
}

/* ===================================
   TRANSICIONES SUAVES
   =================================== */

/* Transiciones para todos los cambios de estado */
.navbar-custom .nav-link-ca,
.navbar-custom .dropdown-toggle,
.navbar-custom .dropdown-item,
.navbar-custom .btn-cta {
    transition: all var(--transition-normal);
}

/* Transición para ::after y ::before */
.navbar-custom .nav-link-ca::after,
.navbar-custom .nav-link-ca.active::after,
.navbar-custom .dropdown-toggle::before,
.navbar-custom .dropdown-toggle.active::before {
    transition: all var(--transition-normal);
}

/* ===================================
   INDICADORES VISUALES ADICIONALES
   =================================== */

/* Animación sutil para enlace activo */
.navbar-custom .nav-link-ca.active {
    animation: navLinkActive 0.5s ease-out;
}

@keyframes navLinkActive {
    from {
        transform: translateY(-2px);
        opacity: 0.8;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Brillo suave en dropdown activo */
.navbar-custom .dropdown-toggle.active {
    box-shadow: inset 0 0 10px rgba(255, 102, 0, 0.1);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

/* ===================================
   RESPONSIVE - TABLETS (768px - 991px)
   =================================== */

@media (min-width: 768px) and (max-width: 991px) {
    .navbar-custom .nav-link-ca.active {
        font-size: 0.95rem;
    }

    .navbar-custom .dropdown-menu {
        min-width: 220px;
    }

    .navbar-custom .dropdown-menu .dropdown-item {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* ===================================
   RESPONSIVE - TABLETS GRANDES (992px - 1199px)
   =================================== */

@media (min-width: 992px) and (max-width: 1199px) {
    .navbar-custom .nav-link-ca.active::after {
        width: 70%;
    }

    .navbar-custom .dropdown-toggle.active::before {
        width: 70%;
    }
}

/* ===================================
   RESPONSIVE - PANTALLAS GRANDES (1200px+)
   =================================== */

@media (min-width: 1200px) {
    .navbar-custom .nav-link-ca.active {
        text-shadow: 0 0 15px rgba(255, 102, 0, 0.2);
    }

    .navbar-custom .nav-link-ca.active::after {
        width: 90%;
        height: 4px;
    }

    .navbar-custom .dropdown-menu .dropdown-item.active {
        border-left-width: 5px;
        padding-left: calc(1rem - 5px);
    }

    .navbar-custom .dropdown-menu .dropdown-item.active:hover {
        padding-left: calc(1rem - 5px + 4px);
    }
}

/* ===================================
   COMPATIBILIDAD CON ORIGINAL
   =================================== */

/* Mantener todos los estilos originales */
/* Si hay conflicto, estos estilos activos deberían reemplazar,
   no agregar. La cascada de CSS se encargará del resto. */

/* Asegurar que el color naranja sea la prioridad */
.navbar-custom .nav-link-ca.active,
.navbar-custom .dropdown-toggle.active,
.navbar-custom .dropdown-menu .dropdown-item.active {
    color: var(--color-primary) !important;
}

/* ===================================
   FIN - NAVBAR ACTIVE STYLES
   =================================== */