/**
 * FIXES PARA EL SISTEMA DE PLANTILLAS
 * Sobrescribe estilos problemáticos de style.css y responsive.css
 */

/* ========================================
   NAVBAR FIXES
   ======================================== */

/* Resetear altura y padding del navbar */
#navigation {
    background: linear-gradient(135deg, #0066CC 0%, #004C99 100%) !important;
    padding: 0.5rem 0 !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
}

/* Logo - tamaño correcto */
.site-logo img {
    width: 180px !important;
    max-width: 180px !important;
    height: auto !important;
}

.site-logo {
    padding: 0.5rem 0 !important;
}

/* Menú principal - alineación horizontal correcta */
#main-menu {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
}

#main-menu > ul {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}

#main-menu > ul > li {
    display: inline-block !important;
    position: relative !important;
    margin: 0 0.5rem !important;
    padding: 0 !important;
}

#main-menu > ul > li > a {
    color: white !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    padding: 0.75rem 1rem !important;
    display: block !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    border-radius: 4px !important;
}

#main-menu > ul > li > a:hover {
    background: rgba(255,255,255,0.1) !important;
    transform: translateY(-2px) !important;
}

/* Botón de INGRESO - destacado */
#main-menu > ul > li:last-child > a {
    background: white !important;
    color: #0066CC !important;
    padding: 0.75rem 1.5rem !important;
    border-radius: 25px !important;
    font-weight: 700 !important;
}

#main-menu > ul > li:last-child > a:hover {
    background: #f0f0f0 !important;
    transform: translateY(-2px) !important;
}

/* Dropdown toggle - quitar decoraciones feas */
.dropdown-toggle::after,
.dropdown-toggle::before {
    display: none !important;
}

/* Dropdown menu - ESTILOS REMOVIDOS PARA DESKTOP
   Los estilos ahora están en navbar-dropdown.css
   para tener control específico por breakpoint (mobile/desktop)
*/

/* Quitar bordes superiores del dropdown */
.dropdown > a::before,
.dropdown > a::after {
    display: none !important;
    content: none !important;
}

.dropdown-toggle {
    border: none !important;
    outline: none !important;
}

.dropdown-toggle:focus,
.dropdown-toggle:active {
    border: none !important;
    outline: none !important;
}

.dropdown-menu li {
    list-style: none !important;
}

.dropdown-menu li a {
    color: #333 !important;
    padding: 0.75rem 1.25rem !important;
    display: block !important;
    text-decoration: none !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
}

.dropdown-menu li a:hover {
    background: #f5f5f5 !important;
    color: #0066CC !important;
    padding-left: 1.5rem !important;
}

/* Submenús (dropdowns dentro de dropdowns) */
.dropdown-submenu {
    position: relative !important;
}

.dropdown-submenu > .dropdown-menu {
    left: 100% !important;
    top: 0 !important;
    margin-left: 0.5rem !important;
}

.dropdown-submenu:hover > .dropdown-menu {
    display: block !important;
}

/* Responsive */
@media (max-width: 991px) {
    #navigation {
        padding: 0.5rem 0 !important;
    }

    .site-logo img {
        width: 150px !important;
    }

    #main-menu > ul {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    #main-menu > ul > li {
        width: 100% !important;
        margin: 0.25rem 0 !important;
    }

    .dropdown-menu {
        position: static !important;
        box-shadow: none !important;
        background: #f5f5f5 !important;
        margin-left: 1rem !important;
    }

    .dropdown-submenu > .dropdown-menu {
        position: static !important;
        margin-left: 2rem !important;
    }
}

/* ========================================
   HERO SECTION FIX
   ======================================== */

/* Asegurar que el hero tenga espacio superior para el navbar fixed */
.section-hero {
    margin-top: 80px !important;
    padding-top: 3rem !important;
}

/* ========================================
   GENERAL LAYOUT FIXES
   ======================================== */

/* Asegurar que el contenido no quede debajo del navbar fixed */
body {
    padding-top: 0 !important;
}

.site-main {
    margin-top: 0 !important;
}

/* Scroll suave */
html {
    scroll-behavior: smooth !important;
}

/* ========================================
   TYPOGRAPHY FIXES
   ======================================== */

/* Títulos principales - peso y tamaño */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700 !important;
    margin-bottom: 1rem !important;
}

h1 {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
}

h2 {
    font-size: 2rem !important;
    line-height: 1.3 !important;
}

h3 {
    font-size: 1.5rem !important;
    line-height: 1.4 !important;
}

/* Párrafos - mejor legibilidad */
p {
    line-height: 1.7 !important;
}

/* Secciones con fondo claro - texto oscuro (pero NO dentro de cards oscuros) */
section[style*="gray-lighter"] h1:not(.card-dark *),
section[style*="gray-lighter"] h2:not(.card-dark *),
section[style*="gray-lighter"] h3:not(.card-dark *),
section[style*="background: var(--gray-lighter)"] h1:not(.card-dark *),
section[style*="background: var(--gray-lighter)"] h2:not(.card-dark *),
section[style*="background: var(--gray-lighter)"] h3:not(.card-dark *),
section[style*="background: white"] h1:not(.card-dark *),
section[style*="background: white"] h2:not(.card-dark *),
section[style*="background: white"] h3:not(.card-dark *),
section[style*="background-color: white"] h1:not(.card-dark *),
section[style*="background-color: white"] h2:not(.card-dark *),
section[style*="background-color: white"] h3:not(.card-dark *) {
    color: #1a1a1a !important;
}

section[style*="gray-lighter"] p:not(.card-dark *),
section[style*="background: var(--gray-lighter)"] p:not(.card-dark *),
section[style*="background: white"] p:not(.card-dark *),
section[style*="background-color: white"] p:not(.card-dark *) {
    color: #444 !important;
}

/* Secciones con fondo oscuro - texto blanco */
section[style*="gradient-primary"] h1,
section[style*="gradient-primary"] h2,
section[style*="gradient-primary"] h3,
section[style*="dark-color"] h1,
section[style*="dark-color"] h2,
section[style*="dark-color"] h3,
section[style*="background: var(--gradient-primary)"] h1,
section[style*="background: var(--gradient-primary)"] h2,
section[style*="background: var(--gradient-primary)"] h3,
section[style*="background: var(--dark-color)"] h1,
section[style*="background: var(--dark-color)"] h2,
section[style*="background: var(--dark-color)"] h3 {
    color: white !important;
}

section[style*="gradient-primary"] p,
section[style*="dark-color"] p,
section[style*="background: var(--gradient-primary)"] p,
section[style*="background: var(--dark-color)"] p {
    color: white !important;
    opacity: 0.95 !important;
}

/* Sección Demo ahora tiene fondo blanco, se manejan por las reglas generales */
/* Cards con fondo oscuro dentro de cualquier sección */
.card-modern[style*="dark-color"] h3,
.card-modern[style*="dark-color"] p,
.card-modern[style*="dark-color"] code {
    color: white !important;
}

/* Hero section - texto blanco visible */
.section-hero h1,
.section-hero h2,
.section-hero h3,
.section-hero p {
    color: white !important;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

/* Secciones generales - padding */
.section {
    padding: 4rem 0 !important;
}

/* Cards modernos - mejor contraste */
.card-modern {
    background: white !important;
    border: 1px solid #e0e0e0 !important;
}

.card-modern-title {
    color: #1a1a1a !important;
    font-weight: 600 !important;
}

.card-modern-text {
    color: #555 !important;
}

/* Card con fondo oscuro */
.card-dark {
    background: #1a2332 !important;
    border: none !important;
    color: white !important;
}

.card-dark h1,
.card-dark h2,
.card-dark h3,
.card-dark h4,
.card-dark h5,
.card-dark h6 {
    color: white !important;
}

.card-dark p,
.card-dark li {
    color: rgba(255, 255, 255, 0.9) !important;
}

.card-dark code {
    color: #00B4D8 !important;
}

/* Badges */
.badge-modern {
    font-weight: 600 !important;
    padding: 0.5rem 1rem !important;
}

/* Code blocks */
code {
    background: rgba(0,0,0,0.05) !important;
    padding: 0.2rem 0.4rem !important;
    border-radius: 4px !important;
    color: #c7254e !important;
    font-size: 0.9em !important;
}

pre code {
    background: transparent !important;
    color: inherit !important;
}
