/* Estilos personalizados para la aplicación DigiTest */

/* Variables CSS personalizadas */
:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
}

/* Estilos generales */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* Tarjetas con bordes de color */
.border-left-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 4px solid var(--success-color) !important;
}

.border-left-info {
    border-left: 4px solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.border-left-danger {
    border-left: 4px solid var(--danger-color) !important;
}

/* Sombras personalizadas */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

/* Animaciones */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

/* Nuevas animaciones y efectos */
@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

/* Hover effects para tarjetas */
.card {
    background-color: #ffffff !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
}

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

/* Estilos para gráficos */
.dash-graph {
    border-radius: 8px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    .btn {
        font-size: 0.875rem;
    }
}

/* Loading spinner personalizado */
.custom-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Estilos para la tabla de datos */
.dash-table-container {
    border-radius: 8px;
    overflow: hidden;
    background: #ffffff !important;
}

/* Estilos para alertas */
.alert {
    border-radius: 8px;
    border: none;
    animation: slideInUp 0.3s ease-out;
    background: #ffffff !important;
    border: 1px solid #dee2e6 !important;
}

.alert-success {
    background: #d4edda !important;
    color: #155724 !important;
    border-color: #c3e6cb !important;
}

.alert-info {
    background: #cce7ff !important;
    color: #004085 !important;
    border-color: #b3d7ff !important;
}

.alert-warning {
    background: #fff3cd !important;
    color: #856404 !important;
    border-color: #ffeaa7 !important;
}

.alert-danger {
    background: #f8d7da !important;
    color: #721c24 !important;
    border-color: #f5c6cb !important;
}

/* Navbar personalizada */
.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

/* Footer personalizado */
.footer {
    background-color: var(--dark-color);
    color: white;
    padding: 1rem 0;
    margin-top: 2rem;
}

/* Estilos para métricas */
.metric-card {
    transition: all 0.3s ease;
    background: #ffffff !important;
    border-radius: 10px;
    border: 1px solid #dee2e6;
}

.metric-card:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

/* Estilos para filtros */
.filter-section {
    background: #ffffff !important;
    color: #212529 !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 8px !important;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

.filter-section .card-header {
    background: transparent !important;
    border: none !important;
    font-weight: 600;
    color: #212529 !important;
}

/* Personalización de dropdowns */
.Select-control {
    border-radius: 6px !important;
}

/* Estilos para botones */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    transition: transform 0.1s ease-in-out;
}

/* Estilos para el login */
.login-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Indicadores de estado */
.status-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-success { background-color: var(--success-color); }
.status-warning { background-color: var(--warning-color); }
.status-danger { background-color: var(--danger-color); }
.status-info { background-color: var(--info-color); }

/* Utilidades */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Estilos para charts responsivos */
.chart-container {
    position: relative;
    height: 400px;
    width: 100%;
    background: #ffffff !important;
    border-radius: 8px;
}

/* Plotly charts background */
.js-plotly-plot {
    background: #ffffff !important;
}

.plotly {
    background: #ffffff !important;
}

/* Loading components */
._dash-loading {
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(1px);
}

._dash-loading > div {
    background: transparent !important;
}

/* Custom spinner colors */
.spinner-border-primary {
    color: #007bff !important;
}

/* Loading overlay styles */
.loading-overlay {
    backdrop-filter: blur(2px);
    transition: all 0.3s ease-in-out;
}

.loading-overlay > div {
    max-width: 300px;
    animation: slideInUp 0.4s ease-out;
}

/* Responsive design mejorado */
@media (max-width: 768px) {
    .metric-card {
        margin-bottom: 1rem;
    }
    
    .chart-container {
        height: 300px;
    }
    
    .card-body {
        padding: 1rem;
    }
}

@media (max-width: 576px) {
    .chart-container {
        height: 250px;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

/* Prevent dark overlays and ensure clean backgrounds */
.modal-backdrop {
    display: none !important;
}

.modal {
    background: rgba(255, 255, 255, 0.95) !important;
}

/* Ensure all containers have white backgrounds */
.container-fluid,
.container,
.row,
.col {
    background: transparent !important;
}

/* Fix any potential z-index issues */
.navbar {
    z-index: 1030 !important;
}

.loading-overlay {
    z-index: 9999 !important;
}
