/**
 * Centro de Monitoreo Inteligente - Estilos principales
 * Este archivo contiene los estilos específicos para el módulo de monitoreo.
 */

/* Contenedor principal */
.smart-monitor-container {
    padding: 1.25rem;
    color: var(--bs-dark);
}

/* Header del dashboard */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
}

.dashboard-header h1 {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--bs-primary);
}

.dashboard-header .dashboard-actions {
    display: flex;
    gap: 0.5rem;
}

/* Tarjetas estadísticas */
.stat-card {
    background-color: var(--bs-white, #fff);
    border-radius: 0.75rem;
    box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.08);
    padding: 1.25rem;
    height: 100%;
    transition: all 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.stat-card-body {
    padding: 0.25rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    margin-right: 1rem;
    font-size: 1.5rem;
}

.stat-content {
    flex: 1;
}

.stat-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

/* Tarjetas y elementos gráficos */
.card {
    border: none;
    border-radius: 0.75rem;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 1.5rem;
}

.card:hover {
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: transparent;
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: none;
}

.card-header h5.card-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--bs-gray-700);
}

.card-header h5.card-title i {
    margin-right: 0.5rem;
    opacity: 0.8;
}

.card-body {
    padding: 1.25rem;
}

.chart-period .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Alertas y notificaciones */
.alerts-container {
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.alerts-container::-webkit-scrollbar {
    width: 6px;
}

.alerts-container::-webkit-scrollbar-track {
    background: transparent;
}

.alerts-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.alertas-table {
    font-size: 0.875rem;
}

.alertas-table th {
    font-weight: 500;
    padding: 0.75rem;
    vertical-align: middle;
}

.alertas-table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.alerta-row:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

.alert-empty {
    padding: 3rem 1.5rem;
    color: var(--bs-gray-600);
}

.alerts-small-list .list-group-item {
    padding: 0.75rem 1rem;
    border-left: none;
    border-right: none;
}

.alerts-small-list .list-group-item:first-child {
    border-top: none;
}

/* Timeline de eventos */
.timeline-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 1.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.timeline-container::-webkit-scrollbar {
    width: 6px;
}

.timeline-container::-webkit-scrollbar-track {
    background: transparent;
}

.timeline-container::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.timeline {
    position: relative;
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.timeline-item {
    position: relative;
    padding-left: 2.75rem;
    padding-bottom: 1.75rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 28px;
    left: 12px;
    height: calc(100% - 28px);
    width: 2px;
    background-color: var(--bs-gray-200);
}

.timeline-icon {
    position: absolute;
    left: 0;
    top: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.timeline-icon i {
    font-size: 14px;
    color: white;
}

.timeline-content {
    background-color: var(--bs-gray-100);
    border-radius: 0.75rem;
    padding: 1rem;
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -10px;
    top: 10px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 10px solid var(--bs-gray-100);
}

.timeline-content h6 {
    font-weight: 600;
    color: var(--bs-gray-800);
}

/* Score gauge */
.ia-score-gauge {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 12px solid var(--bs-gray-100);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.gauge-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

.gauge-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--bs-gray-600);
    margin-top: 0.25rem;
}

/* Filtros */
.filters-panel {
    background-color: var(--bs-gray-100);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

/* DataTables personalización */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1.25rem;
}

.dataTables_wrapper .dataTables_filter input {
    border-radius: 0.375rem;
    border: 1px solid var(--bs-gray-300);
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--bs-primary);
    border-color: var(--bs-primary);
    color: white !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bs-gray-200);
    border-color: var(--bs-gray-300);
}

.dataTables_wrapper table.dataTable {
    border-collapse: collapse;
}

.dataTables_wrapper table.dataTable thead th {
    border-bottom: 1px solid var(--bs-gray-300);
    padding: 0.75rem;
    font-weight: 600;
}

.dataTables_wrapper table.dataTable tbody td {
    padding: 0.75rem;
}

/* Personalización para modales */
.modal-content {
    border-radius: 0.75rem;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid var(--bs-gray-200);
    padding: 1.25rem;
}

.modal-header .modal-title {
    font-weight: 600;
    color: var(--bs-gray-800);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--bs-gray-200);
    padding: 1.25rem;
}

/* Responsive */
@media (max-width: 992px) {
    .smart-monitor-container {
        padding: 0.75rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .dashboard-header .dashboard-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
}

/* Modo oscuro */
body.dark-mode, 
body.dark-theme {
    --bs-body-bg: #121212;
    --bs-body-color: #e0e0e0;
    --bs-primary: #4e73df;
    --bs-secondary: #858796;
    --bs-success: #1cc88a;
    --bs-warning: #f6c23e;
    --bs-danger: #e74a3b;
    --bs-light: #f8f9fc;
    --bs-dark: #5a5c69;
}

body.dark-mode .stat-card, 
body.dark-mode .card,
body.dark-theme .stat-card, 
body.dark-theme .card {
    background-color: #1e1e1e;
    border-color: #333;
}

body.dark-mode .card-header, 
body.dark-mode .modal-header, 
body.dark-mode .modal-footer,
body.dark-theme .card-header, 
body.dark-theme .modal-header, 
body.dark-theme .modal-footer {
    border-color: #333;
}

body.dark-mode .timeline-content,
body.dark-theme .timeline-content {
    background-color: #333;
}

body.dark-mode .timeline-content::before,
body.dark-theme .timeline-content::before {
    border-right-color: #333;
}

body.dark-mode .timeline-item:not(:last-child)::after,
body.dark-theme .timeline-item:not(:last-child)::after {
    background-color: #444;
}

body.dark-mode .filters-panel,
body.dark-theme .filters-panel {
    background-color: #1e1e1e;
}

body.dark-mode .ia-score-gauge,
body.dark-theme .ia-score-gauge {
    border-color: #333;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button,
body.dark-theme .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #e0e0e0 !important;
}

body.dark-mode .dataTables_wrapper table.dataTable thead th,
body.dark-theme .dataTables_wrapper table.dataTable thead th {
    border-color: #444;
}

body.dark-mode .modal-content,
body.dark-theme .modal-content {
    background-color: #1e1e1e;
}

body.dark-mode .list-group-item,
body.dark-theme .list-group-item {
    background-color: #1e1e1e;
    border-color: #333;
}
}