/* ============================================
   STYLE ENHANCEMENTS - Sistema General
   Versión: 2.0 - Mejoras Visuales Globales
   Fecha: 2025-11-14
   Mejoras de diseño para todo el sistema
============================================ */

/* ==========================================
   VARIABLES MEJORADAS
========================================== */
:root {
    /* Actualización de variables globales */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gold-gradient: linear-gradient(135deg, #D4AF37 0%, #B8941F 100%);
    --success-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --info-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    --warning-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    
    /* Sombras mejoradas */
    --shadow-colored: 0 8px 24px rgba(102, 126, 234, 0.25);
    --shadow-gold: 0 8px 24px rgba(212, 175, 55, 0.25);
    
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    
    /* Bordes */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ==========================================
   MEJORAS A BOTONES GLOBALES
========================================== */
.btn {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    font-weight: 600;
    letter-spacing: 0.3px;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

/* Botón Primary con Gradiente */
.btn-primary {
    background: var(--primary-gradient);
    color: white;
}

.btn-primary:hover {
    box-shadow: var(--shadow-colored);
}

/* Botón Success con Gradiente */
.btn-success {
    background: var(--success-gradient);
    color: white;
}

.btn-success:hover {
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.25);
}

/* Botón Danger con Gradiente */
.btn-danger {
    background: var(--danger-gradient);
    color: white;
}

.btn-danger:hover {
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}

/* Botón Info con Gradiente */
.btn-info {
    background: var(--info-gradient);
    color: white;
}

.btn-info:hover {
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.25);
}

/* Botón Warning con Gradiente */
.btn-warning {
    background: var(--warning-gradient);
    color: white;
}

.btn-warning:hover {
    box-shadow: 0 8px 24px rgba(245, 158, 11, 0.25);
}

/* Botón con efecto de icono */
.btn i {
    transition: transform var(--transition-base);
}

.btn:hover i {
    transform: scale(1.1);
}

/* ==========================================
   MEJORAS A CARDS/BOXES
========================================== */
.box,
.content-card {
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-base);
    border: 1px solid #edf2f7;
    position: relative;
    overflow: hidden;
}

.box::before,
.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition-base);
}

.box:hover,
.content-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
}

.box:hover::before,
.content-card:hover::before {
    transform: scaleX(1);
}

/* ==========================================
   MEJORAS A INPUTS Y FORMULARIOS
========================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    letter-spacing: 0.2px;
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-size: 15px;
    transition: all var(--transition-base);
    background: #ffffff;
    font-family: inherit;
}

.form-control:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: #fafbff;
}

.form-control::placeholder,
input::placeholder,
textarea::placeholder {
    color: #cbd5e0;
}

/* ==========================================
   MEJORAS A TABLAS
========================================== */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

table thead {
    background: linear-gradient(135deg, #f8f9fc 0%, #f1f3f9 100%);
}

table th {
    padding: 16px;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
}

table td {
    padding: 16px;
    color: var(--text-secondary);
    border-bottom: 1px solid #edf2f7;
}

table tbody tr {
    transition: all var(--transition-fast);
}

table tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ==========================================
   MEJORAS A BADGES
========================================== */
.badge {
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.badge-primary {
    background: var(--primary-gradient);
    color: white;
}

.badge-success {
    background: var(--success-gradient);
    color: white;
}

.badge-danger {
    background: var(--danger-gradient);
    color: white;
}

.badge-warning {
    background: var(--warning-gradient);
    color: white;
}

.badge-info {
    background: var(--info-gradient);
    color: white;
}

.badge-secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    color: white;
}

/* ==========================================
   MEJORAS A ALERTS/NOTIFICATIONS
========================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
}

.alert i {
    font-size: 20px;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-color: #10b981;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border-color: #ef4444;
}

.alert-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-color: #f59e0b;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-color: #3b82f6;
}

/* ==========================================
   MEJORAS A MODALES
========================================== */
.modal-content {
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: none;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #f8f9fc 0%, #ffffff 100%);
    border-bottom: 2px solid #edf2f7;
    padding: 24px;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-gradient);
}

.modal-header h3,
.modal-header h4,
.modal-header h5 {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header i {
    font-size: 24px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 20px 24px;
    background: #f8f9fc;
    border-top: 1px solid #edf2f7;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ==========================================
   MEJORAS A PAGE HEADERS
========================================== */
.page-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #edf2f7;
    position: relative;
}

.page-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: var(--primary-gradient);
}

.page-header h1 {
    color: var(--text-primary);
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
    letter-spacing: -0.5px;
}

.page-header h1 i {
    font-size: 36px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header .subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin: 0;
}

/* ==========================================
   MEJORAS A STATS/MÉTRICAS
========================================== */
.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all var(--transition-base);
    border: 1px solid #edf2f7;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card .stat-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--primary-gradient);
    color: white;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.stat-card .stat-value {
    font-size: 36px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
    letter-spacing: -1px;
}

.stat-card .stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================
   MEJORAS A LOADING STATES
========================================== */
.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #edf2f7;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.loading-content {
    background: white;
    padding: 32px;
    border-radius: var(--radius-lg);
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* ==========================================
   MEJORAS A TOOLTIPS
========================================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: #1a202c;
    color: white;
    font-size: 12px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all var(--transition-base);
    z-index: 1000;
}

[data-tooltip]:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

/* ==========================================
   MEJORAS A SCROLLBARS
========================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f3f9;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #cbd5e1 0%, #94a3b8 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%);
}

/* ==========================================
   ANIMACIONES ADICIONALES
========================================== */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Clases de animación reutilizables */
.animate-slide-in-right {
    animation: slideInRight 0.4s ease;
}

.animate-slide-in-left {
    animation: slideInLeft 0.4s ease;
}

.animate-slide-in-up {
    animation: slideInUp 0.4s ease;
}

.animate-fade-in {
    animation: fadeIn 0.4s ease;
}

.animate-scale-in {
    animation: scaleIn 0.4s ease;
}

/* ==========================================
   UTILIDADES
========================================== */
.text-gradient {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-colored {
    box-shadow: var(--shadow-colored);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-md {
    border-radius: var(--radius-md);
}

.transition-all {
    transition: all var(--transition-base);
}

/* ==========================================
   ACCESIBILIDAD
========================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus visible para accesibilidad */
*:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
