/* =====================================================
   EquiScore - Estilos Personalizados Modernos
   ===================================================== */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --dark-color: #1f2937;
    --light-color: #f9fafb;
    --border-color: #e5e7eb;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f8fafc;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.5;
    font-size: 0.875rem; /* Reducido de 1rem (16px) a 14px */
}

/* Fondo más sutil para mejor contraste */
.main-content-wrapper {
    background: #f8fafc;
}

/* Navbar Moderno */
.navbar-modern {
    background: white;
    box-shadow: var(--shadow-md);
    padding: 0.625rem 0; /* Reducido de 1rem */
    border-bottom: 1px solid var(--border-color);
}

.navbar-brand-modern {
    font-size: 1.125rem; /* Reducido de 1.5rem */
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.375rem; /* Reducido */
}

.navbar-brand-modern .brand-text {
    transition: opacity 0.3s ease;
}

.navbar-brand-modern i {
    font-size: 1.25rem; /* Reducido de 1.75rem */
}

/* Sidebar Moderno */
.sidebar-modern {
    background: white;
    min-height: calc(100vh - 80px);
    box-shadow: var(--shadow-md);
    border-right: 1px solid var(--border-color);
    padding: 1rem 0; /* Reducido de 1.5rem */
    transition: all 0.3s ease;
    position: relative;
    /* No establecer width: 100% para que respete el grid de Bootstrap */
}

/* Sidebar colapsado */
.sidebar-modern.collapsed {
    flex: 0 0 70px !important;
    max-width: 70px !important;
    min-width: 70px !important;
}

.sidebar-modern.collapsed .nav-link span,
.sidebar-modern.collapsed .nav-link .brand-text,
.sidebar-modern.collapsed hr,
.sidebar-modern.collapsed .text-uppercase {
    display: none;
}

.sidebar-modern.collapsed .nav-link {
    justify-content: center;
    padding: 0.5rem;
    margin: 0.125rem 0.5rem;
}

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

.sidebar-modern .nav-link {
    color: var(--text-secondary);
    padding: 0.5rem 1rem; /* Reducido de 0.75rem 1.5rem */
    margin: 0.125rem 0.75rem; /* Reducido */
    border-radius: 0.375rem; /* Reducido de 0.5rem */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem; /* Reducido de 0.75rem */
    font-weight: 500;
    font-size: 0.875rem; /* Asegurar tamaño consistente */
    position: relative;
}

.sidebar-modern .nav-link:hover {
    background: var(--light-color);
    color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar-modern.collapsed .nav-link:hover {
    transform: none;
}

.sidebar-modern .nav-link.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.sidebar-modern .nav-link i {
    font-size: 1rem; /* Reducido de 1.25rem */
    width: 20px; /* Reducido de 24px */
    text-align: center;
    flex-shrink: 0;
}

/* Tooltip para sidebar colapsado */
.sidebar-modern.collapsed .nav-link[title] {
    position: relative;
}

.sidebar-modern.collapsed .nav-link:hover::after {
    content: attr(title);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0.5rem;
    background: var(--dark-color);
    color: white;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow-lg);
}

.sidebar-modern.collapsed .nav-link:hover::before {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--dark-color);
    z-index: 1001;
}

/* Main content - solo ajustar cuando sidebar está colapsado */
.main-content-wrapper.expanded {
    flex: 0 0 calc(100% - 70px) !important;
    max-width: calc(100% - 70px) !important;
}

/* Cuando sidebar NO está colapsado, volver a los valores normales de Bootstrap */
.sidebar-modern:not(.collapsed) ~ main.main-content-wrapper,
.sidebar-modern:not(.collapsed) + main.main-content-wrapper {
    flex: 0 0 auto !important;
    max-width: 100% !important;
}

/* Ajustar contenedor cuando sidebar está colapsado */
#mainContainer.sidebar-collapsed .row {
    margin-left: 0;
    margin-right: 0;
}

/* Cuando sidebar está colapsado, forzar ancho */
#mainContainer.sidebar-collapsed .row > aside.col-md-3,
#mainContainer.sidebar-collapsed .row > aside.col-lg-2 {
    flex: 0 0 70px !important;
    max-width: 70px !important;
    min-width: 70px !important;
}

#mainContainer.sidebar-collapsed .row > main.col-md-9,
#mainContainer.sidebar-collapsed .row > main.col-lg-10 {
    flex: 0 0 calc(100% - 70px) !important;
    max-width: calc(100% - 70px) !important;
}

/* Cuando sidebar NO está colapsado, usar valores normales de Bootstrap */
#mainContainer:not(.sidebar-collapsed) .row > aside.col-md-3 {
    flex: 0 0 25% !important;
    max-width: 25% !important;
}

#mainContainer:not(.sidebar-collapsed) .row > aside.col-lg-2 {
    flex: 0 0 16.666667% !important;
    max-width: 16.666667% !important;
}

#mainContainer:not(.sidebar-collapsed) .row > main.col-md-9 {
    flex: 0 0 75% !important;
    max-width: 75% !important;
}

#mainContainer:not(.sidebar-collapsed) .row > main.col-lg-10 {
    flex: 0 0 83.333333% !important;
    max-width: 83.333333% !important;
}

/* Botón toggle */
.sidebar-toggle {
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    transform: scale(1.1);
    color: var(--primary-dark) !important;
}

.sidebar-toggle:focus {
    box-shadow: none;
    outline: none;
}

/* Cards Modernas */
.card-modern {
    background: white;
    border-radius: 0.75rem; /* Reducido de 1rem */
    box-shadow: var(--shadow-lg);
    border: none;
    overflow: hidden;
    transition: all 0.3s ease;
    margin-bottom: 1rem; /* Reducido de 1.5rem */
}

.card-modern:hover {
    transform: translateY(-2px); /* Reducido de -4px */
    box-shadow: var(--shadow-xl);
}

.card-header-modern {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    padding: 0.875rem 1.25rem; /* Reducido de 1.25rem 1.5rem */
    border: none;
    font-weight: 600;
    font-size: 0.9375rem; /* Reducido de 1.1rem (17.6px a 15px) */
}

.card-body-modern {
    padding: 1rem 1.25rem; /* Reducido de 1.5rem */
}

/* Botones Modernos */
.btn-modern {
    border-radius: 0.375rem; /* Reducido de 0.5rem */
    padding: 0.5rem 1.125rem; /* Reducido de 0.625rem 1.5rem */
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem; /* Asegurar tamaño consistente */
}

.btn-modern:hover {
    transform: translateY(-1px); /* Reducido de -2px */
    box-shadow: var(--shadow-md);
}

.btn-modern-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.btn-modern-success {
    background: linear-gradient(135deg, var(--success-color), #34d399);
    color: white;
}

.btn-modern-danger {
    background: linear-gradient(135deg, var(--danger-color), #f87171);
    color: white;
}

/* Tablas Modernas */
.table-modern {
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead {
    background: var(--light-color);
}

.table-modern thead th {
    border: none;
    padding: 0.75rem 0.875rem; /* Reducido de 1rem */
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    font-size: 0.6875rem; /* Reducido de 0.75rem (12px a 11px) */
    letter-spacing: 0.05em;
}

.table-modern tbody tr {
    transition: all 0.2s ease;
}

.table-modern tbody tr:hover {
    background: var(--light-color);
    transform: scale(1.005); /* Reducido de 1.01 */
}

.table-modern tbody td {
    padding: 0.75rem 0.875rem; /* Reducido de 1rem */
    border-top: 1px solid var(--border-color);
    vertical-align: middle;
    font-size: 0.875rem; /* Asegurar tamaño consistente */
}

/* Badges Modernos */
.badge-modern {
    padding: 0.25rem 0.5rem; /* Reducido de 0.375rem 0.75rem */
    border-radius: 0.25rem; /* Reducido de 0.375rem */
    font-weight: 600;
    font-size: 0.6875rem; /* Reducido de 0.75rem (12px a 11px) */
}

/* Inputs Modernos */
.form-control-modern {
    border-radius: 0.375rem; /* Reducido de 0.5rem */
    border: 2px solid var(--border-color);
    padding: 0.5rem 0.875rem; /* Reducido de 0.75rem 1rem */
    transition: all 0.3s ease;
    font-size: 0.875rem; /* Asegurar tamaño consistente */
}

.form-control-modern:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Alertas Modernas */
.alert-modern {
    border-radius: 0.5rem; /* Reducido de 0.75rem */
    border: none;
    padding: 0.75rem 1.125rem; /* Reducido de 1rem 1.5rem */
    box-shadow: var(--shadow-md);
    font-size: 0.875rem; /* Asegurar tamaño consistente */
}

/* Stats Cards */
.stat-card {
    background: white;
    border-radius: 0.75rem; /* Reducido de 1rem */
    padding: 1rem 1.25rem; /* Reducido de 1.5rem */
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border-left: 3px solid var(--primary-color); /* Reducido de 4px */
}

.stat-card:hover {
    transform: translateY(-2px); /* Reducido de -4px */
    box-shadow: var(--shadow-xl);
}

.stat-card .stat-value {
    font-size: 1.5rem; /* Reducido de 2rem */
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.375rem 0; /* Reducido de 0.5rem */
}

.stat-card .stat-label {
    color: var(--text-secondary);
    font-size: 0.75rem; /* Reducido de 0.875rem */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Pista Actual - Destacado */
.current-competitor {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 2px solid var(--warning-color); /* Reducido de 3px */
    border-radius: 0.75rem; /* Reducido de 1rem */
    padding: 1.25rem 1.5rem; /* Reducido de 2rem */
    margin: 1rem 0; /* Reducido de 1.5rem */
    box-shadow: var(--shadow-xl);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
    }
}

/* Botones pequeños */
.btn-sm {
    padding: 0.25rem 0.5rem; /* Reducido */
    font-size: 0.75rem; /* Reducido */
}

/* Form labels más pequeños */
.form-label {
    font-size: 0.8125rem; /* Reducido de tamaño por defecto */
    margin-bottom: 0.375rem; /* Reducido */
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-modern {
        min-height: auto;
    }
    
    .card-modern {
        margin-bottom: 1rem;
    }
}

/* Utilidades */
.text-gradient {
    color: var(--primary-color);
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-size: 1.25rem; /* Reducido de tamaño por defecto */
}

/* Títulos más pequeños */
h1, .h1 { font-size: 1.75rem; }
h2, .h2 { font-size: 1.5rem; }
h3, .h3 { font-size: 1.25rem; }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: 0.875rem; }

/* Reducir márgenes de títulos */
h1, h2, h3, h4, h5, h6 {
    margin-bottom: 0.5rem;
}

/* Reducir padding de mb-4 */
.mb-4 {
    margin-bottom: 1rem !important; /* Reducido de 1.5rem */
}

.shadow-modern {
    box-shadow: var(--shadow-lg);
}

.rounded-modern {
    border-radius: 1rem;
}

/* Loading Spinner */
.spinner-modern {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

