/*
    ============================================================================
    SISTEMA DE VARIABLES CSS - FRAMEWORK GENÉRICO
    ============================================================================

    Este archivo utiliza un sistema de variables CSS para facilitar el mantenimiento
    y reutilización del código en múltiples proyectos.

    INSTRUCCIONES PARA CAMBIAR LA PALETA DE COLORES:
    1. Modifica solo las variables de "PALETA DE COLORES CORPORATIVOS"
    2. Las demás variables se actualizarán automáticamente
    3. El resto del CSS permanece intacto

    EJEMPLO DE CAMBIO DE PALETA:
    --app-primary: #YOUR_NEW_COLOR;
    --app-secondary: #YOUR_NEW_COLOR;
    --app-success: #YOUR_NEW_COLOR;
    --app-warning: #YOUR_NEW_COLOR;
*/

:root {
    /* === PALETA DE COLORES CORPORATIVOS === */
    /* ⚠️  SOLO MODIFICAR ESTAS VARIABLES PARA CAMBIAR LA PALETA COMPLETA */
    --app-primary: #004c94;       /* Color principal del sidebar */
    --app-secondary: #00bced;     /* Color secundario/acento */
    --app-success: #9ed53d;       /* Color de éxito/positivo */
    --app-warning: #f7830f;       /* Color de advertencia */
    --app-primary-rgb: 0, 76, 148; /* Color primario en RGB */
    --app-secondary-rgb: 0, 188, 237; /* Color secundario en RGB */
    --app-success-rgb: 158, 213, 61; /* Color de éxito en RGB */
    --app-warning-rgb: 247, 131, 15; /* Color de advertencia en RGB */

    /* === COLORES BASE === */
    /* No modificar - colores universales */
    --color-white: #fff;
    --color-black: #000;

    /* === COLORES CON OPACIDAD === */
    /* Calculados automáticamente desde colores base */
    --color-white-80: rgba(255, 255, 255, 0.8);  /* Texto principal */
    --color-white-50: rgba(255, 255, 255, 0.5);  /* Texto secundario */
    --color-white-10: rgba(255, 255, 255, 0.1);  /* Hover states */
    --color-black-20: rgba(0, 0, 0, 0.2);        /* Background overlays */
    --color-black-50: rgba(0, 0, 0, 0.5);        /* Mobile overlay */

    /* === COLORES DE SIDEBAR === */
    /* Referencian las variables anteriores para consistencia */
    --sidebar-bg: var(--app-primary);            /* Background principal */
    --sidebar-text: var(--color-white-80);        /* Texto normal */
    --sidebar-text-hover: var(--color-white);     /* Texto en hover */
    --sidebar-bg-hover: var(--color-white-10);    /* Background hover */
    --sidebar-border: var(--color-white-10);      /* Bordes */
    --sidebar-user-bg: var(--color-black-20);     /* Sección usuario */

    /* === COLORES DE ESTADO === */
    /* Estados interactivos */
    --hover-opacity: 0.8;                        /* Opacidad hover */
    --active-bg: var(--color-white-10);          /* Background activo */
    --bs-primary-rgb: var(--app-primary-rgb);         /* Color primario */
    --bs-link-color: var(--app-primary);
    --bs-link-color-rgb: var(--app-primary-rgb);
}

.nav-tabs {
    --bs-nav-tabs-link-active-bg: var(--bs-border-color);
}
.btn-outline-primary {
    --bs-btn-color: var(--app-primary);
    --bs-btn-border-color: var(--app-primary);
    --bs-btn-hover-bg: var(--app-primary);
    --bs-btn-hover-border-color: var(--app-primary);
    --bs-btn-active-bg: var(--app-primary);
    --bs-btn-active-border-color: var(--app-primary);
    --bs-btn-disabled-color: var(--app-primary);
    --bs-btn-disabled-border-color: var(--app-primary);
}

/* Estilos del sidebar siguiendo proyecto quiz_pilares */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    z-index: 1000;
    transition: width 0.3s ease;
    border-radius: 0 0.8rem 0.8rem 0;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar.collapsed .sidebar-header {
    justify-content: center;
}

.sidebar-toggle {
    color: var(--color-white);
    padding: 0.5rem;
    margin-right: 0.5rem;
    border: none;
    background: none;
    transition: margin-right 0.3s ease;
}

.sidebar.collapsed .sidebar-toggle {
    margin-right: 0;
}

.sidebar-toggle:hover {
    color: var(--color-white-80);
}

.sidebar-logo-container {
    flex-grow: 1;
    text-align: center;
    transition: opacity 0.3s ease, visibility 0.3s ease, width 0.3s ease;
}

.sidebar.collapsed .sidebar-logo-container {
    opacity: 0;
    visibility: hidden;
    width: 0;
    flex-grow: 0;
}

.sidebar-content {
    height: calc(100vh - 140px);

    padding: 0.5rem;
}

.sidebar.collapsed .sidebar-content {
    height: calc(100vh - 100px);
}

.sidebar .nav-link {
    color: var(--sidebar-text);
    padding: 0.75rem 1rem;
    margin-bottom: 0.25rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background-color: var(--sidebar-bg-hover);
    color: var(--sidebar-text-hover);
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.sidebar .menu-title {
    transition: opacity 1s ease, visibility 1s ease;
    white-space: nowrap;
}

.sidebar.collapsed .menu-title {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-link {
    justify-content: left;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
}

/* Estilos para el botón del usuario cuando el sidebar está colapsado */
.sidebar.collapsed .username .dropdown-toggle span {
    opacity: 0;
    visibility: hidden;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .username .dropdown-toggle i {
    margin-right: 0;
}

.sidebar-logo {
    max-width: 120px;
    height: auto;
    transition: opacity 0.3s ease;
}

.sidebar-mobile {
    width: 260px;
    z-index: 1055; /* Mayor que el overlay */
}

/* Usuario en la parte inferior del sidebar */
.username {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--sidebar-user-bg);
    border-top: 1px solid var(--sidebar-border);
    border-bottom-right-radius: 0.8rem;
    min-height: 3rem;
}

.username a {
    color: var(--color-white);
    text-decoration: none;
    transition: background-color 0.3s ease;
    max-height: 4rem;
}

.username a:hover {
    background-color: var(--sidebar-bg-hover);
}

/* Main content */
.main-content {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Main content cuando sidebar está colapsado */
.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

/* Desktop: mostrar sidebar */
@media (min-width: 992px) {
    .sidebar {
        display: block !important;
    }
}

@media (max-width: 991.98px) {
    .sidebar.collapsed ~ .main-content {
        margin-left: 0px;
    }
    .main-content {
        margin-left: 0;
        padding-top: 56px; /* Espacio para el navbar móvil */
    }

    .sidebar-mobile {
        width: 260px;
    }
}

/* Navbar móvil */
.menu-bar {
    background-color: var(--sidebar-bg) !important;
    border-radius: 0 0 0.8rem 0.8rem;
}
.sidebar-icono {
    max-height: 2rem;
}

/* Overlay móvil */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-black-50);
    z-index: 1040;
    display: none;
}

.mobile-overlay.show {
    display: block;
}
/* medidas espediales */
.wm-100 {
    min-width: 100%;
}

/* estilos para las cards de las clases */

.class-card {
    transition: transform 0.2s;
}
.class-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ===========================================
   SWEETALERT2 - ESTILOS CORPORATIVOS
   =========================================== */

/* Popup principal */
.swal2-popup {
    border-radius: 0.8rem !important;
    box-shadow: 0 10px 40px rgba(17, 65, 137, 0.2) !important;
}

/* Título */
.swal2-title {
    color: var(--app-primary) !important;
    font-weight: 600 !important;
    font-size: 1.25rem !important;
}

/* Contenido */
.swal2-html-container {
    color: #495057 !important;
    font-size: 1rem !important;
    line-height: 1.6 !important;
}

/* Botón de confirmación */
.swal2-confirm {
    background-color: var(--app-primary) !important;
    border-color: var(--app-primary) !important;
    color: white !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.3s ease !important;
}

.swal2-confirm:hover {
    background-color: #0d3a6b !important;
    border-color: #0d3a6b !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(17, 65, 137, 0.3) !important;
}

.swal2-confirm:focus {
    box-shadow: 0 0 0 3px rgba(17, 65, 137, 0.25) !important;
}

/* Botón de cancelar */
.swal2-cancel {
    background-color: var(--app-secondary) !important;
    border-color: var(--app-secondary) !important;
    color: #495057 !important;
    border-radius: 0.375rem !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    transition: all 0.3s ease !important;
}

.swal2-cancel:hover {
    background-color: #0099cc !important;
    border-color: #0099cc !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 188, 237, 0.3) !important;
}

.swal2-cancel:focus {
    box-shadow: 0 0 0 3px rgba(0, 188, 237, 0.25) !important;
}

/* Botón rojo para acciones peligrosas (override específico) */
.swal2-confirm.swal2-styled[style*="background-color: rgb(220, 53, 69)"] {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.swal2-confirm.swal2-styled[style*="background-color: rgb(220, 53, 69)"]:hover {
    background-color: #c82333 !important;
    border-color: #bd2130 !important;
}

/* ===========================================
   SWEETALERT2 - FORMULARIOS AVANZADOS
   =========================================== */

/* Modal ancho personalizado para formularios */
.swal-wide {
    width: 90vw !important;
    max-width: 900px !important;
}

/* Mejorar apariencia de selects en SweetAlert2 */

.swal2-popup .form-control:focus,
.swal2-popup .form-select:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25) !important;
}

/* Mejorar espaciado en formularios */
.swal2-popup .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
}

.swal2-popup .col-md-6 {
    padding-left: calc(var(--bs-gutter-x) * 0.5);
    padding-right: calc(var(--bs-gutter-x) * 0.5);
    margin-bottom: var(--bs-gutter-y);
}