/* ===== RESET Y BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background: linear-gradient(135deg, #B18DB4 0%, #9B59B6 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    padding-bottom: 80px; /* Espacio para botón flotante */
}

/* ===== TARJETAS DE MENÚ (para otros archivos) ===== */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
    margin: 25px 0;
}

.menu-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    border-radius: 18px;
    border: none;
    color: #333;
    text-align: center;
    padding: 25px 15px;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    min-height: 120px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.menu-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #7892c2 0%, #476e9e 100%);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: -1;
}

.menu-btn:hover::before,
.menu-btn:focus::before {
    opacity: 1;
}

.menu-btn:hover,
.menu-btn:focus {
    color: white;
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 20px rgba(0,0,0,0.15);
}

.menu-btn:active {
    transform: translateY(-2px) scale(1.01);
}

/* Iconos dentro de botones */
.menu-btn i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #7892c2;
    transition: color 0.3s;
}

.menu-btn:hover i {
    color: white;
}

/* Botón especial de volver */
.btn-volver {
    background: linear-gradient(145deg, #ff6b6b, #ee5a52);
    color: white;
    margin-top: 30px;
    grid-column: 1 / -1;
    min-height: 70px;
    font-size: 1.2rem;
}

.btn-volver i {
    color: white;
}

/* ===== HEADERS DE PÁGINAS ===== */
.page-header {
    text-align: center;
    color: white;
    margin: 20px 0 30px;
    padding: 0 15px;
}

.page-header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.page-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 25px 15px;
    color: white;
    font-size: 0.95rem;
    opacity: 0.9;
    border-top: 1px solid rgba(255,255,255,0.2);
}

footer p {
    margin: 5px 0;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.menu-btn {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.menu-btn:nth-child(1) { animation-delay: 0.1s; }
.menu-btn:nth-child(2) { animation-delay: 0.2s; }
.menu-btn:nth-child(3) { animation-delay: 0.3s; }
.menu-btn:nth-child(4) { animation-delay: 0.4s; }
.menu-btn:nth-child(5) { animation-delay: 0.5s; }
.menu-btn:nth-child(6) { animation-delay: 0.6s; }
.menu-btn:nth-child(7) { animation-delay: 0.7s; }
.menu-btn:nth-child(8) { animation-delay: 0.8s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 16px;
    }
    
    .menu-btn {
        padding: 22px 12px;
        font-size: 1rem;
        min-height: 110px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .menu-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    
    .menu-btn {
        padding: 20px 10px;
        min-height: 100px;
        font-size: 0.95rem;
    }
    
    .page-header h1 {
        font-size: 1.7rem;
    }
    
    .btn-volver {
        font-size: 1.1rem;
        min-height: 60px;
    }
}

@media (max-width: 480px) {
    .menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .menu-btn {
        padding: 25px 15px;
        min-height: 90px;
        font-size: 1rem;
    }
    
    .page-header h1 {
        font-size: 1.5rem;
    }
    
    footer {
        font-size: 0.85rem;
        padding: 20px 10px;
    }
}

/* ===== MODOS ESPECIALES ===== */
/* Alta visibilidad para botones importantes */
.highlight-btn {
    background: linear-gradient(145deg, #4cd964, #44a857);
    color: white;
    font-weight: bold;
    border: 2px solid #2e7d32;
}

.highlight-btn i {
    color: white;
}

/* Modo oscuro para imágenes */
.dark-img {
    filter: brightness(0.9) contrast(1.1);
    border: 3px solid rgba(0,0,0,0.1);
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Mejorar contraste para accesibilidad */
.menu-btn:focus {
    outline: 3px solid #4a90e2;
    outline-offset: 2px;
}

/* ===== LOADING STATES ===== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loadingShimmer 1.5s infinite;
}

@keyframes loadingShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}