/* public/css/style.css */

/* --- 1. VARIABLES Y ESTILOS GENERALES --- */
:root {
    --color-primario: #001f3f; /* Azul Marino */
    --color-fondo: #f4f7f6;    /* Un gris muy claro */
    --color-superficie: #ffffff;
    --color-texto-principal: #212529;
    --color-texto-secundario: #6c757d;
    --color-borde: #dee2e6;
    --sombra: 0 4px 12px rgba(0, 0, 0, 0.08);
}

html.dark-mode {
    --color-primario: #58a6ff;
    --color-fondo: #0d1117;
    --color-superficie: #161b22;
    --color-texto-principal: #c9d1d9;
    --color-texto-secundario: #8b949e;
    --color-borde: #30363d;
    --sombra: 0 4px 12px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    background-color: var(--color-fondo);
    color: var(--color-texto-principal);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}


/* --- 2. ENCABEZADO Y NAVEGACIÓN --- */
.main-header {
    background-color: var(--color-superficie);
    border-bottom: 1px solid var(--color-borde);
    padding: 0 2%;
    position: sticky; 
    top: 0; 
    z-index: 1000;
    width: 100%;
}

.navbar {
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    height: 70px;
    gap: 15px;
    width: 100%;
    max-width: 100%;
}

.nav-logo img {
    height: 205px;
    width: auto;
}

.logo-light { display: block; }
.logo-dark { display: none; }
html.dark-mode .logo-light { display: none; }
html.dark-mode .logo-dark { display: block; }

.search-container { 
    position: relative; 
    width: 40%;
    min-width: 200px;
}

.search-container .search-icon { 
    position: absolute; 
    left: 15px; 
    top: 50%; 
    transform: translateY(-50%); 
    color: var(--color-texto-secundario); 
}

.search-container input { 
    width: 100%; 
    padding: 10px 15px 10px 40px; 
    border-radius: 20px; 
    border: 1px solid var(--color-borde); 
    background-color: var(--color-fondo); 
    color: var(--color-texto-principal);
    font-size: 14px;
}

.nav-right { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}

.welcome-message { 
    font-weight: 600; 
    color: var(--color-texto-secundario); 
    white-space: nowrap; 
}

.nav-link, .register-button { 
    text-decoration: none; 
    font-weight: 600; 
    color: var(--color-texto-secundario); 
    white-space: nowrap; 
}

.login-button { 
    background-color: var(--color-primario); 
    color: var(--color-fondo) !important; 
    border: 1px solid var(--color-primario); 
    padding: 8px 16px; 
    border-radius: 20px; 
    cursor: pointer; 
    font-weight: 600; 
    text-decoration: none; 
    white-space: nowrap; 
}

.theme-toggle-button { 
    background: none; 
    border: none; 
    color: var(--color-texto-secundario); 
    font-size: 1.2rem; 
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
}

.theme-toggle-button .fa-sun { display: none; }
.theme-toggle-button .fa-moon { display: block; }
html.dark-mode .theme-toggle-button .fa-sun { display: block; }
html.dark-mode .theme-toggle-button .fa-moon { display: none; }

/* Menú hamburguesa - oculto por defecto en desktop */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-texto-principal);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
}

.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    max-height: 100vh;
    background-color: var(--color-superficie);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: right 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 2px solid var(--color-borde);
    background-color: var(--color-superficie);
    position: sticky;
    top: 0;
    z-index: 10;
}

.mobile-menu-header .nav-logo {
    flex: 1;
}

.mobile-menu-header .nav-logo img {
    height: 35px !important;
    width: auto;
}

.mobile-menu-close {
    background: none;
    border: none;
    color: var(--color-texto-principal);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-menu-content {
    padding: 20px;
    width: 100%;
}

.mobile-menu-section {
    margin-bottom: 25px;
    width: 100%;
}

.mobile-menu-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--color-texto-secundario);
    margin: 0 0 12px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.mobile-menu-links a,
.mobile-menu-links .welcome-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-texto-principal);
    background-color: var(--color-fondo);
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.mobile-menu-links a i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.mobile-menu-links a:active {
    background-color: var(--color-primario);
    color: var(--color-fondo);
}

.mobile-menu-links .login-button {
    background-color: var(--color-primario);
    color: var(--color-fondo) !important;
    text-align: center;
    border: none;
    justify-content: center;
}

.mobile-menu-links .welcome-message {
    background-color: var(--color-primario);
    color: var(--color-fondo);
    font-weight: 600;
}

.mobile-search-container {
    position: relative;
    width: 100%;
}

.mobile-search-container .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-texto-secundario);
    pointer-events: none;
}

.mobile-search-container input {
    width: 100%;
    padding: 12px 15px 12px 40px;
    border-radius: 8px;
    border: 1px solid var(--color-borde);
    background-color: var(--color-fondo);
    color: var(--color-texto-principal);
    font-size: 14px;
    box-sizing: border-box;
}

.mobile-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background-color: var(--color-fondo);
    border-radius: 8px;
    width: 100%;
}

.mobile-theme-toggle span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: var(--color-texto-principal);
}


/* --- 3. SECCIÓN HERO --- */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1501281668745-f7f57925c3b4?auto=format&fit=crop&w=1350') no-repeat center center/cover;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #ffffff;
    padding: 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.hero-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    background-color: #fff;
    color: #000;
}

.hero-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
}


/* --- 4. FILTROS AVANZADOS --- */
.filter-section-advanced {
    background-color: var(--color-superficie);
    padding: 2rem 20px;
    border-radius: 12px;
    box-shadow: var(--sombra);
    margin-top: -60px;
    position: relative;
    z-index: 10;
}

.filter-row { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 2rem; 
    align-items: flex-end; 
}

.sub-filter-row { 
    margin-top: 1.5rem; 
}

.filter-group { 
    display: flex; 
    flex-direction: column; 
    gap: 0.8rem;
    flex: 1;
    min-width: 200px;
}

.filter-label { 
    font-weight: 600; 
    font-size: 0.9rem; 
    color: var(--color-texto-secundario); 
}

.filter-label i { 
    margin-right: 8px; 
    color: var(--color-primario); 
}

.filter-buttons { 
    display: flex; 
    gap: 10px; 
    flex-wrap: wrap; 
}

.filter-btn { 
    padding: 8px 18px; 
    border: 1px solid var(--color-borde); 
    background-color: var(--color-fondo); 
    color: var(--color-texto-secundario); 
    border-radius: 50px; 
    cursor: pointer; 
    font-size: 0.9rem; 
    font-weight: 500; 
    transition: all 0.2s ease; 
}

.filter-btn:hover { 
    border-color: var(--color-primario); 
    color: var(--color-primario); 
}

.filter-btn.active { 
    background-color: var(--color-primario); 
    color: var(--color-fondo); 
    border-color: var(--color-primario); 
}


/* --- 5. SECCIÓN DE EVENTOS --- */
.events-section {
    padding: 4rem 0;
}

.events-section h2 { 
    font-size: 2rem; 
    text-align: center; 
    margin-bottom: 2rem; 
}

.events-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 2rem; 
}

.event-card { 
    background-color: var(--color-superficie); 
    border: 1px solid var(--color-borde); 
    border-radius: 12px; 
    overflow: hidden; 
    box-shadow: var(--sombra); 
    transition: transform 0.2s ease; 
}

.event-card:hover { 
    transform: translateY(-5px); 
}

.event-card-img { 
    width: 100%; 
    height: 180px; 
    object-fit: cover; 
}

.event-card-body { 
    padding: 1rem; 
}

.event-card-body h3 { 
    margin: 0 0 0.5rem 0; 
    font-size: 1.1rem; 
}

.event-card-body p { 
    margin: 0; 
    color: var(--color-texto-secundario); 
    font-size: 0.9rem; 
}

.no-results { 
    text-align: center; 
    font-size: 1.2rem; 
    color: var(--color-texto-secundario); 
    padding: 40px; 
}


/* --- 6. FORMULARIOS (LOGIN/REGISTER) --- */
.form-container { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    padding: 50px 20px; 
    min-height: 70vh; 
}

.user-form-card { 
    background-color: var(--color-superficie); 
    padding: 40px; 
    border-radius: 12px; 
    box-shadow: var(--sombra); 
    width: 100%; 
    max-width: 450px; 
}

.user-form-card h1 { 
    text-align: center; 
    margin-top: 0; 
    color: var(--color-texto-principal); 
}

.form-subtitle { 
    text-align: center; 
    color: var(--color-texto-secundario); 
    margin-bottom: 30px; 
}

.form-group { 
    margin-bottom: 20px; 
}

.form-group label { 
    display: block; 
    margin-bottom: 8px; 
    font-weight: 600; 
}

.form-group input, .form-group select { 
    width: 100%; 
    padding: 12px; 
    border: 1px solid var(--color-borde); 
    border-radius: 8px; 
    background-color: var(--color-fondo); 
    color: var(--color-texto-principal); 
    box-sizing: border-box;
    font-size: 16px;
}
.show-password-container {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.9rem;
    justify-content: flex-start; /* asegura alineación a la izquierda */
    width: fit-content; /* evita que se estire todo el ancho */
}


.user-form .btn-primary { 
    width: 100%; 
    padding: 12px; 
    font-size: 1.1rem; 
}

.form-footer { 
    text-align: center; 
    margin-top: 20px; 
}

.form-message.error { 
    background-color: #f8d7da; 
    color: #721c24; 
    padding: 10px; 
    border-radius: 8px; 
    margin-bottom: 20px; 
    border: 1px solid #f5c6cb; 
}


/* --- 7. PÁGINA DE PERFIL --- */
.profile-card { 
    text-align: center; 
    background-color: var(--color-superficie); 
    padding: 40px; 
    border-radius: 12px; 
    margin-top: 50px; 
    box-shadow: var(--sombra); 
    max-width: 800px; 
    margin-left: auto; 
    margin-right: auto; 
}

.profile-card h1 { 
    color: var(--color-primario); 
    margin-bottom: 20px; 
}

.profile-actions { 
    margin-top: 30px; 
    display: flex; 
    justify-content: center; 
    gap: 15px;
    flex-wrap: wrap;
}


/* --- 8. BOTONES GENERALES --- */
.btn { 
    padding: 10px 20px; 
    border: none; 
    border-radius: 50px; 
    text-decoration: none; 
    font-weight: bold; 
    display: inline-block; 
    transition: transform 0.2s ease;
    cursor: pointer;
}

.btn-primary { 
    background-color: var(--color-primario); 
    color: var(--color-fondo); 
}

.btn-secondary { 
    background-color: #6c757d; 
    color: #fff; 
}


/* --- 9. PIE DE PÁGINA --- */
.main-footer { 
    text-align: center; 
    padding: 2rem 5%; 
    margin-top: 2rem; 
    border-top: 1px solid var(--color-borde); 
    color: var(--color-texto-secundario); 
}

/* --- CONTENEDOR PARA LA INSIGNIA DE ESTATUS --- */
.card-image-container {
    position: relative;
}

.event-status-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    z-index: 2;
}

.status-a-la-venta { background-color: #28a745; }
.status-próximamente { background-color: #007bff; }
.status-pospuesto { background-color: #ffc107; color: #212529; }
.status-agotado { background-color: #dc3545; }

.card-link-wrapper {
    text-decoration: none;
    color: inherit;
}

/* --- ESTILOS PARA FORMULARIOS DE USUARIO --- */
.user-form button {
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.resend-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 14px;
}

.resend-container p {
    margin: 0 0 10px 0;
}

.btn-resend {
    display: inline-block;
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
}

.btn-resend:hover {
    background-color: #0056b3;
}


/* ============================================ */
/* MEDIA QUERIES - DISEÑO RESPONSIVE */
/* ============================================ */

/* --- TABLETS (768px - 1024px) --- */
@media screen and (max-width: 1024px) {
    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .hero-content p {
        font-size: 1.1rem;
    }
    
    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .filter-section-advanced {
        margin-top: -40px;
    }
}

/* --- TABLETS PEQUEÑAS Y MÓVILES (hasta 768px) --- */
@media screen and (max-width: 768px) {
    .container {
        padding: 0 15px;
        width: 100%;
    }
    
    /* Activar menú móvil */
    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-menu,
    .mobile-menu-overlay {
        display: block;
    }
    
    /* Ocultar navegación desktop en móvil */
    .search-container,
    .nav-right {
        display: none !important;
    }
    
    /* Navbar simplificado */
    .navbar {
        height: 60px;
        padding: 0;
        gap: 10px;
    }
    
    .main-header {
        padding: 0 4%;
    }
    
    .nav-logo {
        flex-shrink: 0;
    }
    
    .nav-logo img {
        height: 150px;
        max-width: 100%;
        object-fit: contain;
    }
    
    /* Hero */
    .hero-section {
        height: 50vh;
        min-height: 350px;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
        margin-bottom: 0.8rem;
    }
    
    .hero-content p {
        font-size: 1rem;
        padding: 0 10px;
    }
    
    .hero-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    /* Filtros */
    .filter-section-advanced {
        padding: 1.5rem 15px;
        margin-top: -30px;
        border-radius: 8px;
    }
    
    .filter-row {
        gap: 1.5rem;
    }
    
    .filter-group {
        width: 100%;
        min-width: unset;
    }
    
    .filter-buttons {
        justify-content: flex-start;
    }
    
    .filter-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
    }
    
    /* Eventos */
    .events-section {
        padding: 3rem 0;
    }
    
    .events-section h2 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .events-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    /* Formularios */
    .form-container {
        padding: 30px 15px;
        min-height: 60vh;
    }
    
    .user-form-card {
        padding: 30px 20px;
    }
    
    .user-form-card h1 {
        font-size: 1.5rem;
    }
    
    /* Perfil */
    .profile-card {
        padding: 30px 20px;
        margin-top: 30px;
    }
    
    .profile-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .profile-actions .btn {
        width: 100%;
    }
}

/* --- MÓVILES (hasta 480px) --- */
@media screen and (max-width: 480px) {
    .main-header {
        padding: 0 3%;
    }
    
    .navbar {
        height: 60px;
        gap: 8px;
    }
    
    .nav-logo img {
        height: 120px;
        max-height: 120px;
    }
    
    .mobile-menu {
        width: 85%;
        max-width: 320px;
    }
    
    .mobile-menu-toggle {
        font-size: 1.3rem;
        padding: 10px;
    }
    
    /* Hero más compacto */
    .hero-section {
        height: 45vh;
        min-height: 300px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.6rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .hero-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Filtros en móvil */
    .filter-section-advanced {
        padding: 1rem 10px;
        margin-top: -20px;
    }
    
    .filter-row {
        gap: 1rem;
    }
    
    .sub-filter-row {
        margin-top: 1rem;
    }
    
    .filter-label {
        font-size: 0.85rem;
    }
    
    .filter-btn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
    
    /* Grid de eventos en una columna */
    .events-grid {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }
    
    .event-card-img {
        height: 200px;
    }
    
    .events-section {
        padding: 2rem 0;
    }
    
    .events-section h2 {
        font-size: 1.4rem;
        margin-bottom: 1.2rem;
    }
    
    /* Formularios móvil */
    .form-container {
        padding: 20px 10px;
    }
    
    .user-form-card {
        padding: 25px 15px;
    }
    
    .user-form-card h1 {
        font-size: 1.3rem;
    }
    
    .form-subtitle {
        font-size: 0.9rem;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .user-form .btn-primary {
        padding: 10px;
        font-size: 1rem;
    }
    
    /* Perfil móvil */
    .profile-card {
        padding: 25px 15px;
        margin-top: 20px;
    }
    
    .profile-card h1 {
        font-size: 1.4rem;
    }
    
    /* Botones más accesibles en móvil */
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
        min-height: 44px;
    }
    
    /* Footer */
    .main-footer {
        padding: 1.5rem 3%;
        font-size: 0.85rem;
    }
}

/* --- MÓVILES MUY PEQUEÑOS (hasta 360px) --- */
@media screen and (max-width: 360px) {
    .main-header {
        padding: 0 2%;
    }
    
    .navbar {
        gap: 5px;
    }
    
    .nav-logo img {
        height: 100px;
        max-height: 100px;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-content p {
        font-size: 0.85rem;
    }
    
    .filter-btn {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    .event-card-body h3 {
        font-size: 1rem;
    }
    
    .event-card-body p {
        font-size: 0.85rem;
    }
    
    .mobile-menu {
        width: 90%;
    }
    
    .mobile-menu-toggle {
        font-size: 1.2rem;
        padding: 8px;
    }
}

/* --- OPTIMIZACIONES PARA TOUCH --- */
@media (hover: none) and (pointer: coarse) {
    .filter-btn,
    .btn,
    .login-button,
    .theme-toggle-button,
    .mobile-menu-toggle {
        min-height: 44px;
        min-width: 44px;
    }
    
    .event-card:hover {
        transform: none;
    }
    
    .filter-btn:hover {
        border-color: var(--color-borde);
        color: var(--color-texto-secundario);
    }
    
    .filter-btn:active {
        transform: scale(0.95);
    }
}

/* --- LANDSCAPE EN MÓVILES --- */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-section {
        height: 80vh;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .hero-content p {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .navbar {
        height: 50px;
    }
    
    .nav-logo img {
        height: 80px;
    }
}
/* ========================================= */
/* FIXES CRÍTICOS PARA MÓVILES REALES */
/* ========================================= */

/* Asegurar que el menú móvil funcione correctamente */
@media screen and (max-width: 768px) {
    /* Forzar display en móviles */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        min-width: 44px;
        min-height: 44px;
    }
    
    .mobile-menu,
    .mobile-menu-overlay {
        display: block !important;
    }
    
    /* Ocultar completamente el nav desktop */
    .search-container,
    .nav-right {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* Asegurar el ancho correcto del navbar */
    .navbar {
        width: 100%;
        max-width: 100%;
    }
    
    /* Logo más pequeño en móvil */
    .nav-logo {
        max-width: 50%;
    }
    
    .nav-logo img {
        height: 165px !important;
        max-height: 165px !important;
        width: auto !important;
        object-fit: contain;
        margin-left: -25px; /* Mover a la izquierda */
    }
    
    /* Menú móvil con ancho fijo */
    .mobile-menu {
        width: 75vw;
        max-width: 320px;
    }
    
    /* Prevenir scroll del body cuando el menú está abierto */
    body.menu-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }
}

/* Para pantallas muy pequeñas */
@media screen and (max-width: 380px) {
    .nav-logo img {
        height: 90px !important;
        max-height: 90px !important;
    }
    
    .mobile-menu {
        width: 85vw;
    }
    
    .mobile-menu-links a,
    .mobile-menu-links .welcome-message {
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Fix para evitar desplazamiento horizontal */
html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
}
/* Agrega esto al final de tu CSS */

/* MEJORAS PARA TÁCTIL EN MÓVIL */
@media screen and (max-width: 768px) {
    .event-card, 
    .card-link-wrapper,
    .filter-btn {
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .event-card:active,
    .filter-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Mejorar área de touch para eventos */
    .card-link-wrapper {
        display: block;
        min-height: 44px;
    }
    
    /* Feedback visual al tocar */
    .event-card.touched {
        opacity: 0.7;
    }
}

/* Prevenir selección de texto accidental en móvil */
.event-card,
.filter-btn {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
/* FIXES CRÍTICOS PARA MÓVIL */
@media screen and (max-width: 768px) {
    /* Asegurar que los eventos sean clickeables */
    .event-card, 
    .card-link-wrapper {
        position: relative;
        z-index: 10 !important;
        cursor: pointer;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        min-height: 44px;
    }
    
    /* Cuando el menú móvil está CERRADO, debe estar completamente invisible */
    .mobile-menu:not(.active) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -1000 !important;
    }
    
    .mobile-menu-overlay:not(.active) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        z-index: -1000 !important;
    }
    
    /* Cuando el menú está ABIERTO, sí debe estar visible */
    .mobile-menu.active {
        display: block !important;
        z-index: 1001 !important;
    }
    
    .mobile-menu-overlay.active {
        display: block !important;
        z-index: 1000 !important;
    }
    
    /* Asegurar que el contenido principal esté siempre accesible */
    main.container {
        position: relative;
        z-index: 50 !important;
    }
    
    /* Los filtros deben estar accesibles */
    .filter-section-advanced {
        position: relative;
        z-index: 60 !important;
    }
    
    /* Feedback táctil mejorado */
    .event-card:active {
        background-color: rgba(0,0,0,0.05);
        transition: background-color 0.1s ease;
    }
}
/* --- CORRECCIONES PARA EL BOTÓN DE TEMA MÓVIL --- */

/* Botón de tema en desktop - ya está correcto */
.theme-toggle-button { 
    background: none; 
    border: none; 
    color: var(--color-texto-secundario); 
    font-size: 1.2rem; 
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    min-height: 44px;
    min-width: 44px;
}

/* Botón de tema en menú móvil - CORREGIDO */
.mobile-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background-color: var(--color-fondo);
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    border: none;
    color: var(--color-texto-principal);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    min-height: 44px;
}

/* Efecto hover/active para el botón completo */
.mobile-theme-toggle:hover {
    background-color: var(--color-primario);
    color: var(--color-fondo);
}

.mobile-theme-toggle:active {
    transform: scale(0.98);
}

/* Contenedor interno del botón */
.mobile-theme-toggle span {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    color: inherit;
    pointer-events: none; /* Evita que el span interfiera con el click */
}

/* Iconos dentro del botón */
.mobile-theme-toggle i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
    pointer-events: none;
}

/* Texto del botón */
.mobile-theme-toggle .theme-text {
    pointer-events: none;
}

/* Estados del botón cuando está activo */
.mobile-theme-toggle.active {
    background-color: var(--color-primario);
    color: var(--color-fondo);
}
/* MEJORAS ESPECÍFICAS PARA BOTONES TOCABLES EN MÓVIL */
@media screen and (max-width: 768px) {
    /* Asegurar que todos los botones sean fácilmente tocables */
    .theme-toggle-button,
    .mobile-theme-toggle,
    .mobile-menu-toggle,
    .mobile-menu-close,
    .filter-btn,
    .btn,
    .login-button {
        min-height: 44px;
        min-width: 44px;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
        touch-action: manipulation;
        cursor: pointer;
    }
    
    /* Feedback visual al tocar */
    .mobile-theme-toggle:active {
        background-color: var(--color-primario);
        color: var(--color-fondo);
        transform: scale(0.95);
    }
    
    /* Prevenir selección de texto accidental */
    .mobile-theme-toggle,
    .theme-toggle-button {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
}

/* Estados para el botón de tema desktop */
.theme-toggle-button:hover {
    color: var(--color-primario);
}

.theme-toggle-button:active {
    transform: scale(0.9);
}
/* ================================ */
/* ESTILOS PARA LA PÁGINA DE PERFIL */
/* ================================ */
.profile-container {
    display: flex;
    max-width: 1200px;
    margin: 40px auto;
    gap: 30px;
}

.profile-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: var(--card-bg, white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    align-self: flex-start; /* Para que no se estire */
}

.profile-sidebar .user-info {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color, #eee);
}

.user-avatar {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2.5rem;
}

.profile-sidebar h3 {
    margin: 0;
    font-size: 1.2rem;
}

.profile-nav {
    margin-top: 20px;
}

.profile-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color, #333);
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.profile-nav a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
}

.profile-nav a:hover {
    background: #f0f2f5;
    color: #007bff;
}
.dark-mode .profile-nav a:hover {
    background: #2c3e50;
}

.profile-content {
    flex-grow: 1;
}

.profile-content h1 {
    margin-top: 0;
}

/* Reutilizamos el estilo de tarjeta para el formulario */
.user-form-card {
    margin-top: 30px;
}
/* ================================ */
/* ESTILOS PARA LA PÁGINA DE PERFIL */
/* ================================ */

.profile-layout {
    display: grid;
    grid-template-columns: 280px 1fr; /* Columna fija para el sidebar, el resto para el contenido */
    gap: 30px;
    align-items: flex-start;
    margin: 40px 0;
}

.profile-sidebar {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 20px;
}

.profile-sidebar .user-info {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-avatar {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 2.5rem;
}

.profile-sidebar h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-color);
}

.profile-nav {
    margin-top: 20px;
}

.profile-nav a {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    margin-bottom: 10px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.profile-nav a i {
    margin-right: 15px;
    width: 20px;
    text-align: center;
    color: var(--primary-color);
}

.profile-nav a:hover,
.profile-nav a.active {
    background: var(--hover-bg);
    color: var(--primary-color);
}

.profile-content h1 {
    margin-top: 0;
    color: var(--text-color);
}

.profile-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 30px;
}

/* Reutilizamos el estilo .form-card de tu página de registro */
.profile-content .form-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--card-shadow);
}

.profile-content .form-card h2 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Media query para dispositivos móviles */
@media (max-width: 992px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }
    .profile-sidebar {
        position: static;
    }
}
/* ===================================== */
/* ESTILOS PARA "MOSTRAR CONTRASEÑA"     */
/* ===================================== */

/* Contenedor principal del checkbox y el texto */
.show-password-container {
    display: flex;
    align-items: center; /* Alinea verticalmente el checkbox con el texto */
    margin-top: 10px;    /* Espacio para separarlo del input de arriba */
    margin-bottom: 20px; /* Espacio para separarlo del botón de abajo */
}

/* El checkbox en sí */
.show-password-checkbox {
    margin-right: 8px; /* Espacio entre el checkbox y el texto */
    cursor: pointer;
}

/* La etiqueta (el texto "Mostrar contraseña") */
.show-password-container label {
    font-size: 14px;      /* Un tamaño de letra más legible */
    color: var(--text-secondary); /* Usa el color secundario de tu tema */
    cursor: pointer;
    user-select: none;    /* Evita que el texto se pueda seleccionar */
}

/* ===================================== */
/* ESTILOS DEL BUSCADOR EN VIVO MEJORADO */
/* ===================================== */

/* ===================================== */
/* ESTILOS DEL INPUT DE BÚSQUEDA GIGANTE */
/* ===================================== */

/* Ajuste del contenedor para asegurar que el input se expanda */
.search-container {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

/* El Input en sí: Más alto, más grande y más limpio */
#search-input {
    width: 100%;
    height: 55px;                 /* Altura considerablemente mayor */
    padding: 0 25px 0 55px;       /* Espacio a la izquierda para el icono */
    font-size: 18px;              /* Texto más grande y legible */
    font-weight: 500;
    color: #333;
    background-color: #f3f4f6;    /* Un gris muy suave de fondo */
    border: 2px solid transparent; /* Borde transparente inicial */
    border-radius: 50px;          /* Bordes completamente redondeados (píldora) */
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

/* Efecto al hacer clic (Focus) */
#search-input:focus {
    background-color: #ffffff;
    border-color: #4361ee;        /* Tu color primario (ajusta si es diferente) */
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.15); /* Sombra suave */
}

/* El icono de la lupa: Más grande y centrado */
.search-icon {
    position: absolute;
    left: 20px;                   /* Más separado del borde */
    top: 50%;
    transform: translateY(-50%);  /* Centrado vertical perfecto */
    font-size: 22px;              /* Icono más grande */
    color: #9ca3af;
    pointer-events: none;         /* Para que el clic pase a través del icono */
    transition: color 0.3s ease;
}

/* Cuando el input tiene foco, el icono cambia de color */
#search-input:focus + .search-icon,
#search-input:focus ~ .search-icon { 
    color: #4361ee;
}

/* Placeholder (texto de ayuda) más sutil */
#search-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* El contenedor relativo que envuelve input + resultados */
.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px; /* Hacemos que el buscador sea más ancho en general */
    margin: 0 auto;   /* Lo centramos si es necesario */
}

/* El contenedor de los resultados desplegables */
.search-dropdown {
    position: absolute;
    top: 100%; /* Justo debajo del input */
    left: 0;
    right: 0; /* Ocupa todo el ancho del padre */
    background: white;
    border-radius: 12px; /* Bordes más redondeados */
    box-shadow: 0 10px 40px rgba(0,0,0,0.2); /* Sombra más pronunciada y elegante */
    z-index: 1000;
    display: none;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
    margin-top: 8px; /* Un pequeño espacio entre el input y la lista */
}

.search-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* Cada elemento (fila) de resultado */
.search-item {
    display: flex;
    align-items: center;
    padding: 12px 20px; /* Mucho más espacio interno (padding) */
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    cursor: pointer;
}

.search-item:last-child {
    border-bottom: none;
}

.search-item:hover {
    background-color: #f8f9fa; /* Color de fondo al pasar el mouse */
}

/* La imagen del evento */
.search-item img {
    width: 50px;  /* Más grande */
    height: 50px; /* Más grande */
    border-radius: 8px;
    object-fit: cover;
    margin-right: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Contenedor de texto */
.search-item-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Título del evento */
.search-item-title {
    font-weight: 700;
    font-size: 16px; /* Letra más grande */
    color: #2c3e50;
    margin-bottom: 4px;
}

/* Fecha o detalles */
.search-item-date {
    font-size: 13px;
    color: #888;
    font-weight: 500;
}

/* Mensaje cuando no hay resultados */
.search-no-results {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-size: 15px;
    font-style: italic;
}

/* Animación suave de entrada */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Ajuste para modo oscuro (si lo usas) */
.dark-mode .search-dropdown {
    background: #1f2937;
    border-color: #374151;
}
.dark-mode .search-item {
    color: #f3f4f6;
    border-bottom-color: #374151;
}
.dark-mode .search-item:hover {
    background-color: #374151;
}
.dark-mode .search-item-title {
    color: #f3f4f6;
}

/* Estilos específicos para el buscador móvil */
.mobile-search-wrapper {
    width: 100%;
    margin-bottom: 15px;
}

.mobile-search-container {
    position: relative;
    width: 100%;
}

.mobile-search-container input {
    width: 100%;
    padding: 12px 15px 12px 40px; /* Ajustar padding para el icono */
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 16px;
}

.mobile-search-container .search-icon {
    left: 12px;
    font-size: 16px;
}

/* Ajuste del dropdown en móvil para que no se corte */
.mobile-dropdown {
    position: relative; /* En móvil, que empuje el contenido hacia abajo en vez de flotar */
    top: 0;
    width: 100%;
    box-shadow: none;
    border: 1px solid #eee;
    border-top: none;
    max-height: 300px; /* Limitar altura si hay muchos resultados */
    overflow-y: auto;
}

.mobile-dropdown .search-item {
    background-color: #fff;
    padding: 15px;
}

/* Enlace de recuperar contraseña */
.forgot-link {
    font-size: 13px;
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.forgot-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Ajuste para el contenedor de opciones de contraseña */
.password-options {
    margin-bottom: 20px;
}