/* 
 * Portal Educa - Estilos Mobile-First V2
 * Forzando recarga del navegador
 */

/* ===== VARIABLES CSS POR DEFECTO (TEMA CLARO) ===== */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
}

/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    font-size: 16px;
    overflow-x: hidden;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Asegurar que el footer esté al final del contenido */
    position: relative;
    /* Permitir scroll vertical normal */
    overflow-x: hidden;
    overflow-y: auto;
}

/* ===== LAYOUT PRINCIPAL - MOBILE FIRST ===== */
.main-content {
    padding: 0.5rem;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

/* ===== HEADER - MOBILE FIRST ===== */
.header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 var(--shadow-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

.header-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.25rem;
}

.logo-icon {
    width: 100px;
    height: 35px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 0.75rem;
}

/* ===== NAVEGACIÓN - MOBILE FIRST ===== */
.nav {
    display: none; /* Hidden by default on mobile */
}

.nav-links {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: #f3f4f6;
    color: #3b82f6;
}

/* ===== AUTH SECTION - MOBILE FIRST ===== */
.auth-section {
    display: none; /* Hidden by default on mobile */
}

/* ===== MOBILE MENU BUTTON - ALWAYS VISIBLE ON MOBILE ===== */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    gap: 4px;
    z-index: 1000;
}

.nav-link {
    color: #6b7280;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s ease;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: #3b82f6;
}

/* ===== MOBILE MENU - MOBILE FIRST ===== */
.mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    gap: 4px;
}

.mobile-menu-btn:hover {
    background: #f3f4f6;
}

.hamburger-line {
    width: 20px;
    height: 2px;
    background: #374151;
    border-radius: 1px;
    transition: all 0.3s ease;
}

.mobile-menu-btn.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay - FUNCTIONAL */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    display: none;
    transform: translateX(100%);
}

/* Show menu when active */
.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    display: block;
    transform: translateX(0);
}

/* Hide on desktop */
@media (min-width: 769px) {
    .mobile-menu-overlay {
        display: none !important;
    }
}

.mobile-menu-content {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.mobile-menu-overlay.active .mobile-menu-content {
    transform: translateX(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.mobile-menu-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mobile-menu-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: #6b7280;
    transition: all 0.2s ease;
}

.mobile-menu-close:hover {
    background: #e5e7eb;
    color: #374151;
}

/* Mobile Navigation */
.mobile-nav {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
}

.mobile-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    background: transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: var(--bg-secondary);
    color: var(--accent-color);
}

/* Theme toggle button in mobile nav */
.mobile-nav-links #mobileThemeToggle {
    background: #f3f4f6;
    color: #6b7280;
    border: 1px solid #d1d5db;
    margin-top: 0.5rem;
}

.mobile-nav-links #mobileThemeToggle:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
}

/* Login button in mobile nav */
.mobile-nav-links .mobile-nav-link[href*="auth/login"] {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white !important;
    border: 1px solid #3b82f6;
    font-weight: 600;
    margin-top: 0.5rem;
}

.mobile-nav-links .mobile-nav-link[href*="auth/login"]:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white !important;
    text-decoration: none;
}

/* User profile in mobile nav */
.mobile-nav-links .mobile-nav-link[href*="user/profile"] {
    background: white;
    border: 1px solid #e5e7eb;
    margin-top: 0.5rem;
}

.mobile-nav-links .mobile-nav-link[href*="user/profile"]:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
}

/* Mobile Auth Section */
.mobile-auth-section {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-shrink: 0;
    min-height: 120px;
    margin-top: auto;
}

/* Specific styles for auth links */
.mobile-auth-section .mobile-nav-link {
    background: white;
    border: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-auth-section .mobile-nav-link:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
    text-decoration: none;
}

/* Special styling for Acceder button */
.mobile-auth-section .mobile-nav-link[href*="auth/login"] {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white !important;
    border-color: #3b82f6;
    font-weight: 600;
}

.mobile-auth-section .mobile-nav-link[href*="auth/login"]:hover {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: white !important;
    text-decoration: none;
}

/* Theme toggle button in mobile */
#mobileThemeToggle {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

#mobileThemeToggle:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
}



.mobile-btn-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    color: #374151;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.mobile-btn-profile:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #374151;
    text-decoration: none;
}

.mobile-btn-profile .user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
}

.mobile-btn-profile .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Mobile nav link avatar */
.mobile-nav-link .user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    overflow: hidden;
}

.mobile-nav-link .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Iconos del menú móvil - todos del mismo tamaño */
.mobile-nav-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
}

/* Botón de cerrar sesión en móvil */
.mobile-nav-link.logout-btn {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-size: inherit;
    cursor: pointer;
    color: inherit;
    padding: inherit;
    text-decoration: none;
    display: block;
    font-family: inherit;
    line-height: inherit;
}

/* Asegurar que todos los enlaces del menú móvil tengan el mismo espaciado */
.mobile-nav-link {
    display: flex !important;
    align-items: center !important;
    padding: 0.75rem 1rem !important;
    text-decoration: none !important;
    color: inherit !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
    border: none !important;
    background: none !important;
    width: 100% !important;
    text-align: left !important;
}

/* Botón Acceder en menú móvil con colores del header */
.mobile-nav-link.mobile-access-btn {
    background: #3b82f6 !important;
    color: white !important;
    border-radius: 0.5rem !important;
    justify-content: center !important;
    font-weight: 600 !important;
    margin: 0.5rem 0 !important;
}

/* Separadores visuales en menú móvil */
.mobile-nav-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0.5rem 0;
    list-style: none;
}

/* Desktop Navigation - Hidden on Mobile */
.desktop-nav,
.desktop-auth {
    display: none;
}

/* ===== AUTH SECTION - MOBILE FIRST ===== */
.auth-section {
    display: none; /* Oculto en móvil por defecto */
}

/* ===== THEME TOGGLE - MOBILE FIRST ===== */
.theme-toggle {
    display: flex; /* Mostrar por defecto */
}

/* ===== BOTONES - MOBILE FIRST ===== */
.btn-acceder,
.btn-profile,
.btn-ver-cursos,
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white !important;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-height: 40px;
    min-height: 40px;
}

.btn-acceder:hover,
.btn-profile:hover,
.btn-ver-cursos:hover,
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    color: white !important;
    text-decoration: none;
}

/* Estilos específicos para el botón del usuario en el header */
.header .btn-profile {
    max-height: 40px !important;
    min-height: 40px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    align-items: center !important;
    justify-content: center !important;
}

.header .btn-profile .user-avatar {
    width: 24px !important;
    height: 24px !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    flex-shrink: 0 !important;
    line-height: 1 !important;
    overflow: hidden !important;
}

.header .btn-profile .user-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50% !important;
}

.header .btn-profile .user-name {
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    white-space: nowrap !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
}

/* Estilos para el menú desplegable del usuario */
.user-menu {
    position: relative;
    overflow: visible;
}

/* Botón de cambio de tema en desktop */
.theme-toggle.desktop-only {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-right: 0.5rem;
}

.theme-toggle.desktop-only:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.theme-toggle.desktop-only .theme-icon {
    width: 18px;
    height: 18px;
}

/* Ocultar botón de usuario y botón acceder en móvil */
@media (max-width: 768px) {
    .user-menu {
        display: none;
    }
    
    .btn-acceder {
        display: none;
    }
    
    .theme-toggle.desktop-only {
        display: none;
    }
}

.dropdown-arrow {
    transition: transform 0.2s ease;
    margin-left: 0.25rem;
}

.user-menu.active .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: fixed;
    top: 60px;
    right: 20px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    min-width: 180px;
    z-index: 9999;
    display: none;
}

.user-menu.active .user-dropdown {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    text-decoration: none;
}

.dropdown-icon {
    color: var(--text-muted);
    flex-shrink: 0;
}

.dropdown-form {
    margin: 0;
}

/* Mejorar contraste del dropdown en dark mode */
[data-theme="dark"] .user-dropdown {
    background: #1f2937;
    border: 1px solid #374151;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .dropdown-item {
    color: #f9fafb;
}

[data-theme="dark"] .dropdown-item:hover {
    background: #374151;
    color: #ffffff;
}

[data-theme="dark"] .dropdown-icon {
    color: #9ca3af;
}

.btn-ver-cursos {
    width: 100%;
    justify-content: center;
}

/* ===== THEME TOGGLE - MOBILE FIRST ===== */
.theme-toggle {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.5rem;
    color: #6b7280;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 24px;
    min-height: 24px;
}

.theme-toggle:hover {
    background: #e5e7eb;
    color: #374151;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.theme-icon {
    width: 16px;
    height: 16px;
    transition: all 0.2s ease;
}

.theme-icon.light-icon {
    display: block;
}

.theme-icon.dark-icon {
    display: none;
}

/* ===== HERO SECTION - MOBILE FIRST ===== */
.hero {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    width: 100%;
}

.hero-title {
    font-size: 2rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1rem;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.hero-subtitle {
    font-size: 1rem;
    color: #6b7280;
    max-width: 100%;
    margin: 0 auto;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
}

.hero-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0.5rem;
}

.hero-logo-image {
    max-width: 150px;
    height: auto;
    object-fit: contain;
}

/* ===== CARDS SECTION - MOBILE FIRST ===== */
.cards-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
    max-width: 100%;
    padding: 0 0.5rem;
    width: 100%;
}

.card {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 1px 3px 0 var(--shadow-color);
    transition: all 0.4s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    min-height: 120px;
    width: 100%;
}

.card-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border: 1px solid #e2e8f0;
}

.card-icon.instituciones {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: none;
}

.card-icon.cursos {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.card-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    margin-top: auto;
}

.card-button:hover {
    color: #1d4ed8;
    transform: translateY(-1px);
    background: #f1f5f9;
    border-color: #cbd5e1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-button svg {
    width: 14px;
    height: 14px;
    transition: all 0.3s ease;
}

.card-button:hover svg {
    transform: translateX(2px);
}

/* ===== FOOTER - MOBILE FIRST ===== */
.footer {
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -1px 3px 0 var(--shadow-color);
    margin-top: auto;
    /* Footer al final del contenido - solo visible al hacer scroll */
    position: relative !important;
    width: 100%;
    /* Asegurar que el footer esté al final del contenido */
    clear: both;
    /* Forzar que no sea fijo */
    top: auto !important;
    bottom: auto !important;
    z-index: 1 !important;
}

.footer-container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0.5rem 1rem;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    text-align: center;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
}

.footer-link:hover {
    color: #3b82f6;
}

.footer-icon {
    flex-shrink: 0;
}

/* ===== DESKTOP - MEJORAS PARA PANTALLAS GRANDES ===== */
@media (min-width: 769px) {
    .main-content {
        padding: 1rem;
        max-width: 1200px;
    }
    
    .header-container {
        padding: 0 1.5rem;
        max-width: 1200px;
        height: 70px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .logo-icon {
        width: 150px;
        height: 50px;
    }
    
    /* Desktop Navigation - Show on Desktop */
    .desktop-nav,
    .desktop-auth {
        display: flex;
    }
    
    .auth-section {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        flex-shrink: 0;
    }
    
    .theme-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        min-width: 24px;
        min-height: 24px;
    }
    
    /* Hide mobile menu on desktop */
    .mobile-menu-btn {
        display: none;
    }
    
    .mobile-menu-overlay {
        display: none !important;
    }
    
    .nav {
        gap: 2rem;
    }
    
    .nav-links {
        gap: 2rem;
    }
    
    .nav-link {
        font-size: 0.875rem;
        padding: 0;
    }
    
    .hero {
        margin-bottom: 2rem;
        padding: 0;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.25rem;
        max-width: 600px;
    }

    .hero-logo-image {
        max-width: 200px;
    }

    .cards-section {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1rem;
        max-width: 800px;
        margin: 0 auto;
        padding: 0;
    }

    .card {
        padding: 1.25rem;
        min-height: 140px;
    }

    .card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .card-title {
        font-size: 1.25rem;
    }

    .card-button {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    .footer-container {
        padding: 1rem;
        max-width: 1200px;
    }
    
    .footer-content {
        gap: 3rem;
    }
    
    .footer-link {
        font-size: 1rem;
    }
}

/* Mostrar botón de tema siempre para debugging */
.theme-toggle.desktop-only {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Desktop: Mostrar botón de tema siempre */
@media (min-width: 769px) {
    .theme-toggle.desktop-only {
        display: flex !important;
    }
}

/* ===== SISTEMA DE TEMAS ===== */

/* Tema Oscuro */
[data-theme="dark"] {
    /* Variables de color para tema oscuro */
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --danger-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
}

/* Aplicación de variables CSS */
/* Las variables ya están aplicadas en las reglas base */

/* Header en tema oscuro */
[data-theme="dark"] .header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 var(--shadow-color);
}

[data-theme="dark"] .logo {
    color: var(--text-primary);
}

[data-theme="dark"] .nav-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--accent-color);
}

/* Main content en tema oscuro */
[data-theme="dark"] .main-content {
    background-color: var(--bg-secondary);
}

/* Cards en tema oscuro */
[data-theme="dark"] .card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 var(--shadow-color);
}

[data-theme="dark"] .card-title {
    color: var(--text-primary);
}

[data-theme="dark"] .card-subtitle {
    color: var(--text-secondary);
}

/* Institution cards en tema oscuro */
[data-theme="dark"] .institution-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 var(--shadow-color);
}

[data-theme="dark"] .institution-name {
    color: var(--text-primary);
}

[data-theme="dark"] .institution-city {
    color: var(--text-secondary);
}

[data-theme="dark"] .detail-item {
    color: var(--text-secondary);
}

[data-theme="dark"] .detail-item a {
    color: var(--accent-color);
}

[data-theme="dark"] .detail-item a:hover {
    color: var(--accent-hover);
}

/* Filters sidebar en tema oscuro */
[data-theme="dark"] .filters-sidebar {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px 0 var(--shadow-color);
}

[data-theme="dark"] .filter-title {
    color: var(--text-primary);
}

[data-theme="dark"] .filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .filter-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .clear-filters {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .clear-filters:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Footer en tema oscuro */
[data-theme="dark"] .footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
}

[data-theme="dark"] .footer-section h3,
[data-theme="dark"] .footer-section h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .footer-link {
    color: var(--text-secondary);
}

[data-theme="dark"] .footer-link:hover {
    color: var(--accent-color);
}

/* ===== CORRECCIÓN DEFINITIVA PARA FOOTER NO FIJO ===== */
/* Forzar que el footer nunca sea fijo - máxima prioridad */
.footer,
footer {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    margin-top: auto !important;
    clear: both !important;
    /* Asegurar que esté al final del contenido */
    z-index: 1 !important;
}

.footer-container,
.footer-content {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

/* Asegurar que el body permita scroll normal */
body {
    min-height: 100vh !important;
    display: flex !important;
    flex-direction: column !important;
    position: relative !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    /* Permitir scroll normal */
    height: auto !important;
}

/* Asegurar que el main-content funcione correctamente */
.main-content {
    flex: 1 !important;
    min-height: 0 !important;
    overflow: visible !important;
    height: auto !important;
}

/* ===== REGLAS ELIMINADAS - CONFLICTIVAS ===== */

/* Asegurar que el sidebar tenga el ancho correcto */
.filters-sidebar {
    width: 300px !important;
    min-width: 300px !important;
    max-width: 300px !important;
}

/* ===== REGLAS ELIMINADAS - CONFLICTIVAS ===== */

/* Layout de escritorio para content-layout */
@media (min-width: 1024px) {
    .content-layout {
        grid-template-columns: 300px 1fr !important;
        gap: 2rem !important;
    }
    
    /* Mejorar apariencia del sidebar de filtros en escritorio */
    .content-layout .filters-sidebar {
        position: static !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        border-radius: 8px !important;
        padding: 1.5rem !important;
        background: var(--bg-secondary) !important;
        border: 1px solid var(--border-color) !important;
    }
}

/* Layout móvil para content-layout */
@media (max-width: 1023px) {
    .content-layout {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 0.5rem !important;
    }
    
    .content-layout .filters-sidebar {
        position: static !important;
        order: 1 !important;
    }
    
    .content-layout .courses-grid,
    .content-layout .institutions-grid {
        order: 2 !important;
    }
}

/* Asegurar que el contenido principal sea scrolleable */
.courses-grid,
.courses-container {
    overflow: visible !important;
    height: auto !important;
    min-height: auto !important;
}

/* Asegurar que las reglas específicas de las páginas tengan prioridad */
.content-layout .courses-grid,
.content-layout .institutions-grid {
    /* Permitir que las reglas específicas de la página tengan prioridad */
    grid-template-columns: unset !important;
}

/* Corregir problemas de posicionamiento */
.course-card {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

/* Asegurar que el footer en página de cursos funcione igual que en instituciones */
body:has(.content-layout) .footer {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    margin-top: auto !important;
    clear: both !important;
    z-index: 1 !important;
    /* Asegurar que el footer aparezca solo al final del contenido */
    transform: none !important;
    left: auto !important;
    right: auto !important;
}

/* Asegurar que el main-content en página de cursos permita scroll normal */
body:has(.content-layout) .main-content {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    height: auto !important;
    min-height: auto !important;
    overflow: visible !important;
    /* Permitir que el contenido se extienda naturalmente */
    flex: none !important;
}

/* CSS específico para página de cursos eliminado - ahora usa la misma estructura que instituciones */

/* Botones en tema oscuro */
[data-theme="dark"] .btn-acceder,
[data-theme="dark"] .btn-ver-cursos,
[data-theme="dark"] .btn-primary {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white !important;
}

[data-theme="dark"] .filter-button {
    background: var(--accent-color);
    color: white;
}

[data-theme="dark"] .filter-button:hover {
    background: var(--accent-hover);
}

/* Theme toggle en tema oscuro */
[data-theme="dark"] .theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 0.5rem;
    padding: 0.5rem;
    transition: all 0.2s ease;
}

[data-theme="dark"] .theme-toggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: scale(1.05);
}

/* Empty state en tema oscuro */
[data-theme="dark"] .empty-state-title {
    color: var(--text-primary);
}

[data-theme="dark"] .empty-state-text {
    color: var(--text-secondary);
}

/* Mobile menu en tema oscuro - MÁXIMA PRIORIDAD */
[data-theme="dark"] .mobile-menu-overlay {
    background: rgba(0, 0, 0, 0.9) !important;
}

[data-theme="dark"] .mobile-menu-content {
    background: #1f2937 !important;
    border: 1px solid #374151 !important;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .mobile-menu-header {
    background: #111827 !important;
    border-bottom: 1px solid #374151 !important;
}

[data-theme="dark"] .mobile-menu-header h3 {
    color: #f9fafb !important;
}

[data-theme="dark"] .mobile-nav-link {
    color: #f9fafb !important;
    background: transparent !important;
}

[data-theme="dark"] .mobile-nav-link:hover {
    background: #374151 !important;
    color: #60a5fa !important;
}

[data-theme="dark"] .mobile-nav-link.active {
    background: #374151 !important;
    color: #60a5fa !important;
}

/* Ocultar botón de tema del header en móvil */
@media (max-width: 768px) {
    #themeToggleBtn {
        display: none !important;
    }
}

/* Theme toggle button en tema oscuro */
[data-theme="dark"] .mobile-nav-links #mobileThemeToggle {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .mobile-nav-links #mobileThemeToggle:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

/* Login button en tema oscuro */
[data-theme="dark"] .mobile-nav-links .mobile-nav-link[href*="auth/login"] {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white !important;
    border: 1px solid var(--accent-color);
}

/* Botón de cerrar sesión en tema oscuro */
[data-theme="dark"] .logout-btn {
    color: #ef4444;
}

[data-theme="dark"] .logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Separadores en tema oscuro */
[data-theme="dark"] .mobile-nav-separator {
    border-top: 1px solid var(--border-color);
}

/* Iconos de usuario en tema oscuro */
[data-theme="dark"] .mobile-nav-icon {
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .mobile-nav-links .mobile-nav-link[href*="auth/login"]:hover {
    background: linear-gradient(135deg, var(--accent-hover), var(--accent-color));
    color: white !important;
}

/* User profile en tema oscuro */
[data-theme="dark"] .mobile-nav-links .mobile-nav-link[href*="user/profile"] {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .mobile-nav-links .mobile-nav-link[href*="user/profile"]:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-color);
}

[data-theme="dark"] .mobile-nav-links .mobile-nav-link[href*="user/profile"] .user-avatar {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
}

/* Page titles en tema oscuro */
[data-theme="dark"] .page-title {
    color: var(--text-primary);
}

[data-theme="dark"] .page-subtitle {
    color: var(--text-secondary);
}

/* Hero section en tema oscuro */
[data-theme="dark"] .hero-title {
    color: var(--text-primary);
}

[data-theme="dark"] .hero-subtitle {
    color: var(--text-secondary);
}

/* Filter input styles */
.filter-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    color: #374151;
    transition: all 0.2s ease;
}

.filter-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-input::placeholder {
    color: #9ca3af;
}

/* Mobile search bar */
.mobile-search-container {
    display: block;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
}

.search-bar {
    display: flex;
    align-items: center;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    gap: 0.5rem;
    padding-right: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem;
    border: none;
    outline: none;
    font-size: 0.875rem;
    color: #374151;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-button {
    background: #3b82f6;
    border: none;
    color: white;
    padding: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-button:hover {
    background: #2563eb;
}

/* Mobile filter button - ahora en la misma fila */
.mobile-filter-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    color: #374151;
    font-weight: 500;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    min-width: 40px;
    height: 40px;
}

.mobile-filter-button:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.filter-icon {
    color: #6b7280;
    width: 18px;
    height: 18px;
}

/* Filters sidebar mobile - igual que mobile menu */
.filters-sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: all 0.3s ease;
}

.filters-sidebar.active {
    display: block;
}

.filters-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 320px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.filters-sidebar.active .filters-content {
    transform: translateX(0);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.close-filters-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease;
}

.close-filters-btn:hover {
    background: #e5e7eb;
    color: #374151;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0 1rem 1rem;
}

/* Filter groups spacing */
.filter-group {
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.filter-group:last-child {
    margin-bottom: 0;
}

/* Mobile overlay */
.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.filters-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Desktop styles */
@media (min-width: 1024px) {
    .mobile-search-container {
        display: none;
    }
    
    .mobile-filter-button-container {
        display: none;
    }
    
    .filters-sidebar {
        display: block;
        position: static;
        width: auto;
        height: auto;
        max-width: none;
        background: transparent;
        border: none;
        box-shadow: none;
        overflow: visible;
        z-index: auto;
    }
    
    .filters-content {
        position: static;
        width: auto;
        height: auto;
        max-width: none;
        background: transparent;
        box-shadow: none;
        overflow: visible;
        transform: none;
    }
    
    .filters-header {
        display: none;
    }
    
    .filter-actions {
        flex-direction: row;
        gap: 0.75rem;
    }
}

/* Filter input en tema oscuro */
[data-theme="dark"] .filter-input {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .filter-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .filter-input::placeholder {
    color: var(--text-muted);
}

/* Mobile search bar en tema oscuro */
[data-theme="dark"] .search-bar {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

[data-theme="dark"] .search-input {
    color: var(--text-primary);
}

[data-theme="dark"] .search-input::placeholder {
    color: var(--text-muted);
}

[data-theme="dark"] .search-button {
    background: var(--accent-color);
}

[data-theme="dark"] .search-button:hover {
    background: var(--accent-hover);
}

/* Mobile filter button en tema oscuro */
[data-theme="dark"] .mobile-filter-button {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .mobile-filter-button:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
}

/* Filters sidebar en tema oscuro */
[data-theme="dark"] .filters-sidebar {
    background: rgba(0, 0, 0, 0.8);
}

[data-theme="dark"] .filters-content {
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
}

[data-theme="dark"] .filters-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

[data-theme="dark"] .filter-title {
    color: var(--text-primary);
}

[data-theme="dark"] .close-filters-btn {
    color: var(--text-secondary);
}

[data-theme="dark"] .close-filters-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .filter-group {
    padding: 0 1rem;
}

[data-theme="dark"] .filter-group label {
    color: var(--text-primary);
}

[data-theme="dark"] .filter-select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .filter-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}


/* ===== CORRECCIONES PARA LAYOUT MÓVIL ===== */
html {
    overflow-x: hidden;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.header-container,
.main-content,
.footer-container {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Asegurar que no haya elementos que causen overflow horizontal */
* {
    max-width: 100%;
}

/* ===== ESTILOS ESPECÍFICOS PARA INDICADOR ACTIVO - VERSIÓN SEGURA ===== */
.header .nav-link.active {
    background: #f3f4f6;
    color: #3b82f6;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

[data-theme="dark"] .header .nav-link.active {
    background: var(--bg-secondary);
    color: var(--accent-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

/* ===== INDICADOR ACTIVO MÁS GRANDE - ENFOQUE SEGURO ===== */
.header .nav-link.active {
    background: #f3f4f6 !important;
    color: #3b82f6 !important;
    padding: 0.6rem 1rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    transform: none !important;
}

[data-theme="dark"] .header .nav-link.active {
    background: var(--bg-secondary) !important;
    color: var(--accent-color) !important;
    padding: 0.6rem 1rem !important;
    border-radius: 0.5rem !important;
    font-weight: 600 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
    transform: none !important;
}


.nav {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

.nav-links {
    overflow-x: hidden !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
}

.nav-link {
    white-space: nowrap !important;
    flex-shrink: 1 !important;
}

.auth-section {
    overflow-x: hidden !important;
    flex-shrink: 0 !important;
}

/* Asegurar que el header nunca cause scroll horizontal */
body {
    overflow-x: hidden !important;
}

html {
    overflow-x: hidden !important;
}


.nav {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    max-width: 100% !important;
    flex-shrink: 1 !important;
}

.nav-links {
    overflow: hidden !important;
    max-width: 100% !important;
    display: flex !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
}

.nav-link {
    white-space: nowrap !important;
    flex-shrink: 1 !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 0.875rem !important;
}

.auth-section {
    overflow-x: hidden !important;
    overflow-y: visible !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

/* Asegurar que el header se ajuste completamente */
.header .btn-profile {
    max-width: 200px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.header .btn-profile .user-name {
    max-width: 120px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* ===== FORMULARIOS - MOBILE FIRST ===== */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.125rem;
}

.form-container {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px 0 var(--shadow-color), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid var(--border-color);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    display: block;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background: var(--bg-primary);
    font-family: inherit;
    color: var(--text-primary);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error, .form-select.error, .form-textarea.error {
    border-color: var(--danger-color);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.error-message {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.error-container {
    background: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #fecaca;
}

.error-list {
    margin: 0;
    padding-left: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.precio-container {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.sin-costo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sin-costo-checkbox {
    width: auto;
    margin: 0;
}

.sin-costo-label {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.btn-secondary {
    background: #6b7280;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    max-height: 40px;
    min-height: 40px;
}

.btn-secondary:hover {
    background: #4b5563;
    color: white;
    text-decoration: none;
}

/* Responsive */
@media (max-width: 768px) {
    .page-container {
        padding: 1.5rem 1rem;
    }

    .form-container {
        padding: 1.5rem;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .precio-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ===== LAYOUT DESKTOP ESPECÍFICO ===== */
@media (min-width: 1024px) {
    .content-layout {
        display: grid !important;
        grid-template-columns: 400px 1fr !important;
        gap: 1rem !important;
        max-width: 1400px !important;
        margin: 0 auto !important;
        padding: 0 1rem !important;
    }
    
    .courses-grid,
    .institutions-grid {
        padding-left: 4rem !important;
        max-width: 800px !important;
    }
}

/* ===== LAYOUT MÓVIL ESPECÍFICO ===== */
@media (max-width: 1023px) {
    .content-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
        padding: 0 0.5rem !important;
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    .filters-sidebar {
        order: 1 !important;
    }
    
    .courses-grid,
    .institutions-grid {
        order: 2 !important;
        padding-left: 0 !important;
        max-width: 100% !important;
    }
}
