/* ==========================================
   SISTEMA DE GESTIÓN EDUCATIVA - ESTILOS
   CFGS Mantenimiento Electrónico
   ========================================== */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --border-radius: 0.375rem;
    --border-radius-lg: 0.5rem;
    --transition: all 0.3s ease;
}

/* ==========================================
   RESET Y BASE
   ========================================== */

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f6fa;
    margin: 0;
    padding: 0;
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.loading-spinner.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ==========================================
   NAVBAR PERSONALIZADA
   ========================================== */

.navbar {
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--border-radius);
    margin: 0 0.25rem;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* ==========================================
   CARDS PERSONALIZADAS
   ========================================== */

.card {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
    font-weight: 600;
}

.card-body {
    padding: 2rem;
}

/* ==========================================
   BOTONES PERSONALIZADOS
   ========================================== */

.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-success {
    background: var(--gradient-success);
    border: none;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* ==========================================
   FORMULARIOS PERSONALIZADOS
   ========================================== */

.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
    padding: 0.75rem 1rem;
}

.form-control:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
    transform: translateY(-1px);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

.form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* ==========================================
   TABLAS PERSONALIZADAS
   ========================================== */

.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: var(--gradient-primary);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: rgba(52, 152, 219, 0.05);
    transform: scale(1.01);
}

.table tbody td {
    vertical-align: middle;
    border-color: #e9ecef;
}

/* ==========================================
   MODALES PERSONALIZADOS
   ========================================== */

.modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    border: none;
    padding: 1.5rem 2rem 1rem;
}

.modal-body {
    padding: 0 2rem 2rem;
}

.modal-footer {
    border: none;
    padding: 1rem 2rem 2rem;
}

/* ==========================================
   DASHBOARD STATS
   ========================================== */

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

/* ==========================================
   BADGES PERSONALIZADOS
   ========================================== */

.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius);
}

.badge-success {
    background: var(--gradient-success);
}

.badge-danger {
    background: var(--gradient-secondary);
}

.badge-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ========================================== 
   TOAST PERSONALIZADO
   ========================================== */

.toast {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.toast-header {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

/* ==========================================
   DROPDOWN PERSONALIZADO
   ========================================== */

.dropdown-menu {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0.5rem 0;
}

.dropdown-item {
    transition: var(--transition);
    padding: 0.75rem 1.5rem;
}

.dropdown-item:hover {
    background-color: rgba(52, 152, 219, 0.1);
    transform: translateX(5px);
}

/* ==========================================
   TABS PERSONALIZADOS
   ========================================== */

.nav-tabs {
    border: none;
    margin-bottom: 0;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    color: #6c757d;
    font-weight: 500;
    transition: var(--transition);
    margin-right: 0.25rem;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--secondary-color);
}

.nav-tabs .nav-link.active {
    background: var(--gradient-primary);
    color: white;
    border: none;
}

.tab-content {
    background: white;
    border-radius: 0 var(--border-radius) var(--border-radius) var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

/* ==========================================
   ANIMACIONES
   ========================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 768px) {
    .card-body {
        padding: 1.5rem;
    }
    
    .stat-card {
        padding: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-icon {
        font-size: 2.5rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
    }
    
    .table-responsive {
        border-radius: var(--border-radius);
    }
}

@media (max-width: 576px) {
    .container-fluid {
        padding: 0.5rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 0 1rem 1rem;
    }
    
    .modal-header {
        padding: 1rem 1rem 0.5rem;
    }
}

/* ==========================================
   UTILIDADES PERSONALIZADAS
   ========================================== */

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: var(--gradient-primary);
}

.bg-gradient-success {
    background: var(--gradient-success);
}

.bg-gradient-secondary {
    background: var(--gradient-secondary);
}

.shadow-custom {
    box-shadow: var(--shadow);
}

.shadow-custom-lg {
    box-shadow: var(--shadow-lg);
}

.border-radius-custom {
    border-radius: var(--border-radius);
}

.border-radius-lg-custom {
    border-radius: var(--border-radius-lg);
}

/* ==========================================
   ESTADOS DE CARGA
   ========================================== */

.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin: -1rem 0 0 -1rem;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 11;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================
   ESTILOS ESPECÍFICOS PARA FORMULARIOS
   ========================================== */

.form-floating > .form-control {
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating > label {
    padding: 1rem 0.75rem;
}

.input-group-text {
    background: var(--light-color);
    border: 2px solid #e9ecef;
    border-left: none;
    transition: var(--transition);
}

.input-group:focus-within .input-group-text {
    border-color: var(--secondary-color);
    background: rgba(52, 152, 219, 0.1);
}

/* ==========================================
   ESTILOS PARA ALERTAS
   ========================================== */

.alert {
    border: none;
    border-radius: var(--border-radius);
    font-weight: 500;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    color: #155724;
    border-left-color: var(--success-color);
}

.alert-danger {
    background: rgba(231, 76, 60, 0.1);
    color: #721c24;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background: rgba(243, 156, 18, 0.1);
    color: #856404;
    border-left-color: var(--warning-color);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    color: #0c5460;
    border-left-color: var(--info-color);
}

/* ==========================================
   ESTILOS PARA PAGINACIÓN
   ========================================== */

.pagination {
    justify-content: center;
    margin-top: 2rem;
}

.page-link {
    border: none;
    color: var(--primary-color);
    font-weight: 500;
    padding: 0.75rem 1rem;
    margin: 0 0.25rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.page-link:hover {
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: var(--gradient-primary);
    border: none;
    color: white;
}

.page-item.disabled .page-link {
    color: #6c757d;
    background: transparent;
}

/* ==========================================
   ESTILOS PARA FILTROS
   ========================================== */

.filter-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.filter-section .form-control,
.filter-section .form-select {
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

.filter-section .form-control:focus,
.filter-section .form-select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* ==========================================
   ESTILOS PARA ACCIONES DE TABLA
   ========================================== */

.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    padding: 0.375rem 0.75rem;
    margin: 0 0.125rem;
    font-size: 0.875rem;
}

.table-actions .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ==========================================
   ESTILOS PARA MODALES DE CONFIRMACIÓN
   ========================================== */

.confirmation-modal .modal-content {
    border: none;
    border-radius: var(--border-radius-lg);
}

.confirmation-modal .modal-header {
    background: var(--gradient-secondary);
    color: white;
    border: none;
}

.confirmation-modal .modal-body {
    padding: 2rem;
    text-align: center;
}

.confirmation-modal .modal-footer {
    border: none;
    padding: 0 2rem 2rem;
    justify-content: center;
}

/* ==========================================
   ESTILOS PARA ESTADOS VACÍOS
   ========================================== */

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    margin-bottom: 1rem;
    color: #495057;
}

.empty-state p {
    margin-bottom: 2rem;
}

/* ==========================================
   ESTILOS PARA NOTIFICACIONES
   ========================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: var(--gradient-success);
    color: white;
}

.notification.error {
    background: var(--gradient-secondary);
    color: white;
}

.notification.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.notification.info {
    background: var(--gradient-primary);
    color: white;
}
