/* ========================================
   SISTEMA DE MENÚ PRINCIPAL
   ======================================== */

/* Configuración base */
html, body {
    height: 100%;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Tahoma, Geneva, Verdana, sans-serif;
}

/* Contenedor principal del menú */
.menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    padding: 40px 20px;
    max-width: 1400px;
    margin: 0 auto;
    height: auto;
    min-height: 100%;
}

/* Variante compacta para páginas de administración */
.menu.compact {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    max-width: 1200px;
}

/* ========================================
   BOTONES DE MENÚ
   ======================================== */

.menu-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    color: #2c3e50;
    text-decoration: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Variante compacta para botones */
.menu.compact .menu-button {
    height: 180px;
}

/* Efecto de overlay en hover */
.menu-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.menu-button:hover::before {
    opacity: 1;
}

/* Estados de interacción */
.menu-button:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    color: #ffffff;
}

.menu-button:active {
    transform: translateY(-4px) scale(0.98);
}

/* ========================================
   ÍCONOS Y TEXTO
   ======================================== */

.menu-button img {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
}

/* Variante compacta para íconos */
.menu.compact .menu-button img {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.menu-button:hover img {
    transform: scale(1.1);
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.menu-button span {
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    color: #ffffff;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    letter-spacing: 0.5px;
}

/* Variante compacta para texto */
.menu.compact .menu-button span {
    font-size: 14px;
    max-width: 200px;
}

/* ========================================
   BADGES DE ACCESO
   ======================================== */

.access-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Variantes de badges por tipo de usuario */
.access-badge.super {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border-color: rgba(255, 215, 0, 0.3);
}

.access-badge.admin {
    background: rgba(220, 38, 127, 0.2);
    color: #dc267f;
    border-color: rgba(220, 38, 127, 0.3);
}

.access-badge.user {
    background: rgba(34, 139, 34, 0.2);
    color: #228b22;
    border-color: rgba(34, 139, 34, 0.3);
}

/* ========================================
   TEMAS DE COLOR POR MÓDULO - SERIE BÁSICA
   ======================================== */

/* 1. Administración - Azul púrpura */
.menu-button.admin {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 2. Flota - Rosa fucsia */
.menu-button.flota {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* 3. Almacenamiento - Azul cian */
.menu-button.almacenamiento {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* 4. Reclutamiento - Verde aqua */
.menu-button.reclutamiento {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* 5. Operaciones - Rosa amarillo */
.menu-button.operaciones {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* 6. Rendimiento - Aqua rosa */
.menu-button.rendimiento {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

/* 7. Admin Rendimiento - Rosa claro */
.menu-button.admin-rendimiento {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
}

/* 8. Auxiliares - Verde esmeralda */
.menu-button.auxiliares {
    background: linear-gradient(135deg, #56ab2f 0%, #a8e6cf 100%);
}

/* 9. Brigadas - Azul océano */
.menu-button.brigadas {
    background: linear-gradient(135deg, #2196f3 0%, #21cbf3 100%);
}

/* 10. Centros de Costo - Naranja coral */
.menu-button.cecos {
    background: linear-gradient(135deg, #ff7043 0%, #ff5722 100%);
}

/* 11. Gestión de Sesiones - Púrpura violeta */
.menu-button.sesiones {
    background: linear-gradient(135deg, #9d50bb 0%, #6e48aa 100%);
}

/* ========================================
   TEMAS DE COLOR - SERIE EXTENDIDA
   ======================================== */

/* 12. Certificaciones - Naranja dorado */
.menu-button.certificaciones {
    background: linear-gradient(135deg, #ffb347 0%, #ffcc33 100%);
}

/* 13. Cambiar Contraseña - Gris azulado */
.menu-button.password {
    background: linear-gradient(135deg, #607d8b 0%, #455a64 100%);
}

/* 14. Backup - Verde bosque */
.menu-button.backup {
    background: linear-gradient(135deg, #388e3c 0%, #2e7d32 100%);
}

/* 15. Reportes - Índigo profundo */
.menu-button.reportes {
    background: linear-gradient(135deg, #3f51b5 0%, #303f9f 100%);
}

/* 16. Configuración - Gris carbón */
.menu-button.configuracion {
    background: linear-gradient(135deg, #546e7a 0%, #37474f 100%);
}

/* 17. Dashboard - Turquesa brillante */
.menu-button.dashboard {
    background: linear-gradient(135deg, #26c6da 0%, #00acc1 100%);
}

/* 18. Inventario - Verde lima */
.menu-button.inventario {
    background: linear-gradient(135deg, #8bc34a 0%, #689f38 100%);
}

/* 19. Ventas - Rojo vibrante */
.menu-button.ventas {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

/* 20. Marketing - Magenta eléctrico */
.menu-button.marketing {
    background: linear-gradient(135deg, #e91e63 0%, #ad1457 100%);
}

/* 21. Finanzas - Verde menta */
.menu-button.finanzas {
    background: linear-gradient(135deg, #4db6ac 0%, #26a69a 100%);
}

/* 22. Recursos Humanos - Ámbar cálido */
.menu-button.rrhh {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
}

/* 23. Proyectos - Azul slate */
.menu-button.proyectos {
    background: linear-gradient(135deg, #5c6bc0 0%, #3949ab 100%);
}

/* 24. Calidad - Verde teal */
.menu-button.calidad {
    background: linear-gradient(135deg, #009688 0%, #00695c 100%);
}

/* 25. Seguridad - Rojo ladrillo */
.menu-button.seguridad {
    background: linear-gradient(135deg, #d84315 0%, #bf360c 100%);
}

/* 26. Logística - Azul acero */
.menu-button.logistica {
    background: linear-gradient(135deg, #78909c 0%, #455a64 100%);
}

/* 27. Mantenimiento - Naranja profundo */
.menu-button.mantenimiento {
    background: linear-gradient(135deg, #ff5722 0%, #d84315 100%);
}

/* 28. Comunicaciones - Púrpura real */
.menu-button.comunicaciones {
    background: linear-gradient(135deg, #673ab7 0%, #512da8 100%);
}

/* 29. Análisis - Azul marino */
.menu-button.analisis {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
}

/* 30. Innovación - Rosa magenta */
.menu-button.innovacion {
    background: linear-gradient(135deg, #e1bee7 0%, #ba68c8 100%);
}

/* ========================================
   TEMAS ESPECIALES Y ESTACIONALES
   ======════================================ */

/* Tema de emergencia - Rojo alerta */
.menu-button.emergencia {
    background: linear-gradient(135deg, #ff1744 0%, #d50000 100%);
}

/* Tema nocturno - Azul oscuro */
.menu-button.nocturno {
    background: linear-gradient(135deg, #1a237e 0%, #0d47a1 100%);
}

/* Tema premium - Oro negro */
.menu-button.premium {
    background: linear-gradient(135deg, #212121 0%, #424242 100%);
    border: 2px solid #ffd700;
}

/* Tema de temporada - Primavera */
.menu-button.primavera {
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

/* Tema de temporada - Verano */
.menu-button.verano {
    background: linear-gradient(135deg, #ffeb3b 0%, #ff9800 100%);
}

/* Tema de temporada - Otoño */
.menu-button.otono {
    background: linear-gradient(135deg, #ff7043 0%, #d84315 100%);
}

/* Tema de temporada - Invierno */
.menu-button.invierno {
    background: linear-gradient(135deg, #b39ddb 0%, #9575cd 100%);
}

/* ========================================
   GRADIENTES AVANZADOS
   ======================================== */

/* Gradiente Aurora */
.menu-button.aurora {
    background: linear-gradient(135deg, #00c9ff 0%, #92fe9d 100%);
}

/* Gradiente Atardecer */
.menu-button.atardecer {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

/* Gradiente Cosmos */
.menu-button.cosmos {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Gradiente Fuego */
.menu-button.fuego {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
}

/* Gradiente Océano */
.menu-button.oceano {
    background: linear-gradient(135deg, #2196f3 0%, #21cbf3 100%);
}

/* Gradiente Bosque */
.menu-button.bosque {
    background: linear-gradient(135deg, #134e5e 0%, #71b280 100%);
}

/* Gradiente Volcán */
.menu-button.volcan {
    background: linear-gradient(135deg, #ff0844 0%, #ffb199 100%);
}

/* Gradiente Tropical */
.menu-button.tropical {
    background: linear-gradient(135deg, #ff9068 0%, #fd746c 100%);
}

/* ========================================
   ANIMACIONES
   ======================================== */

/* Animación de entrada */
.menu-button {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

/* Retrasos escalonados para cada botón */
.menu-button:nth-child(1) { animation-delay: 0.1s; }
.menu-button:nth-child(2) { animation-delay: 0.2s; }
.menu-button:nth-child(3) { animation-delay: 0.3s; }
.menu-button:nth-child(4) { animation-delay: 0.4s; }
.menu-button:nth-child(5) { animation-delay: 0.5s; }
.menu-button:nth-child(6) { animation-delay: 0.6s; }
.menu-button:nth-child(7) { animation-delay: 0.7s; }
.menu-button:nth-child(8) { animation-delay: 0.8s; }
.menu-button:nth-child(9) { animation-delay: 0.9s; }
.menu-button:nth-child(10) { animation-delay: 1.0s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animación de pulso para botones importantes */
.menu-button.highlight {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
    50% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    }
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablets */
@media (max-width: 768px) {
    .menu {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
        gap: 16px;
        padding: 20px 16px;
    }
    
    .menu.compact {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .menu-button {
        height: 180px;
    }
    
    .menu.compact .menu-button {
        height: 160px;
    }
    
    .menu-button img {
        width: 50px;
        height: 50px;
    }
    
    .menu.compact .menu-button img {
        width: 40px;
        height: 40px;
    }
    
    .menu-button span {
        font-size: 14px;
    }
    
    .menu.compact .menu-button span {
        font-size: 13px;
    }
}

/* Móviles */
@media (max-width: 480px) {
    .menu {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }
    
    .menu-button {
        height: 160px;
    }
    
    .menu.compact .menu-button {
        height: 140px;
    }
    
    .menu-button img {
        width: 45px;
        height: 45px;
    }
    
    .menu-button span {
        font-size: 13px;
    }
    
    .access-badge {
        top: 8px;
        right: 8px;
        font-size: 9px;
        padding: 3px 6px;
    }
}

/* Pantallas grandes */
@media (min-width: 600px) {
    main {
        height: auto;
        min-height: 85%;
    }
}

@media (min-width: 1200px) {
    .menu {
        gap: 28px;
        padding: 48px 24px;
    }
    
    .menu-button {
        height: 220px;
    }
    
    .menu-button img {
        width: 68px;
        height: 68px;
    }
    
    .menu-button span {
        font-size: 16px;
        max-width: 240px;
    }
}

/* ========================================
   ESTADOS ESPECIALES
   ======================================== */

/* Botón deshabilitado */
.menu-button.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

.menu-button.disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05) !important;
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
    .menu-button {
        border: 2px solid rgba(255, 255, 255, 0.5);
    }
    
    .menu-button span {
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    }
}

/* Modo de movimiento reducido */
@media (prefers-reduced-motion: reduce) {
    .menu-button {
        animation: none;
        opacity: 1;
        transform: translateY(0);
    }
    
    .menu-button:hover {
        transform: none;
    }
    
    .menu-button img {
        transition: none;
    }
    
    .menu-button:hover img {
        transform: none;
    }
}

/* ========================================
   UTILIDADES
   ======================================== */

/* Clase para ocultar botones condicionalmente */
.menu-button.hidden {
    display: none;
}

/* Clase para destacar botones */
.menu-button.featured {
    border: 2px solid rgba(255, 215, 0, 0.5);
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.2);
}

/* Clase para botones en mantenimiento */
.menu-button.maintenance {
    background: linear-gradient(135deg, #9e9e9e 0%, #616161 100%);
    pointer-events: none;
}

.menu-button.maintenance::after {
    content: 'Mantenimiento';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 600;
}