/* ============================================================
   TABLES MODERN CSS
   Estilos modernos para tablas en todo el sistema
   DIPP-UNAH | v1.0.0
   ============================================================ */

/* ── Tabla Base Moderna ──────────────────────────────────── */
.table-modern,
.table-calificaciones,
.table-solicitudes,
#example {
    width: 100%;
    margin: 0;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}

.table-modern thead,
.table-calificaciones thead,
.table-solicitudes thead,
#example thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table-modern thead th,
.table-calificaciones thead th,
.table-solicitudes thead th,
#example thead th {
    background: #f8f9fa !important;
    color: #495057 !important;
    font-weight: 600 !important;
    padding: 14px 16px !important;
    border-bottom: 2px solid #e9ecef !important;
    text-align: left !important;
    font-size: 11.5px !important;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
}

.table-modern tbody tr,
.table-calificaciones tbody tr,
.table-solicitudes tbody tr,
#example tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f1f3f5;
}

.table-modern tbody tr:hover,
.table-calificaciones tbody tr:hover,
.table-solicitudes tbody tr:hover,
#example tbody tr:hover {
    background: #f8f9fa !important;
    transform: scale(1.001);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table-modern tbody td,
.table-calificaciones tbody td,
.table-solicitudes tbody td,
#example tbody td {
    padding: 13px 16px !important;
    color: #495057 !important;
    vertical-align: middle !important;
}

.table-modern tbody tr:nth-child(even),
.table-calificaciones tbody tr:nth-child(even) {
    background: #fafbfc;
}

.table-modern tbody tr:nth-child(even):hover,
.table-calificaciones tbody tr:nth-child(even):hover {
    background: #f8f9fa !important;
}

.table-modern tbody tr:last-child td,
.table-solicitudes tbody tr:last-child td {
    border-bottom: none;
}

/* ── Columnas Específicas ────────────────────────────────── */
.codigo-asignatura {
    font-weight: 600;
    color: #0066cc !important;
    font-family: 'Courier New', monospace;
}

.nombre-asignatura {
    font-weight: 500;
    color: #1a1a1a !important;
    max-width: 250px;
}

.td-bold {
    font-weight: 600;
    color: #1a2a3a;
}

.horario {
    white-space: nowrap;
}

.hora-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #e9ecef;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #495057;
}

.hora-badge svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

.dias {
    font-weight: 600;
    color: #6c757d !important;
    text-transform: uppercase;
    font-size: 12px;
}

.seccion {
    color: #6c757d !important;
    font-weight: 500;
}

.profesor {
    font-weight: 500;
    max-width: 200px;
}

/* ── Calificación Badges ─────────────────────────────────── */
.calificacion-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 14px;
}

.calificacion-aprobado {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #155724;
    border: 1px solid #b8dacc;
}

.calificacion-reprobado {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.calificacion-pendiente {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    border: 1px solid #ffd866;
}

.calificacion-nsp {
    background: #e9ecef;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

/* ── Observación DIPP ────────────────────────────────────── */
.obs-dipp {
    display: inline-block;
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.obs-dipp::before {
    content: "DIPP: ";
    font-weight: 700;
    color: #0066cc;
    font-style: normal;
}

/* ── Acciones en Tabla ───────────────────────────────────── */
.acciones-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-eliminar-sm {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    color: #dc3545;
    border: 1px solid #f5c2c7;
    border-radius: 7px;
    padding: 5px 11px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-eliminar-sm svg {
    width: 12px;
    height: 12px;
    stroke: #dc3545;
    fill: none;
    stroke-width: 2.5;
}

.btn-eliminar-sm:hover {
    background: #f8d7da;
    border-color: #dc3545;
}

.btn-download-pdf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1.5px solid #f5c2c7;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-download-pdf svg {
    width: 18px;
    height: 18px;
    stroke: #dc3545;
    fill: none;
    stroke-width: 2;
}

.btn-download-pdf:hover {
    background: #f8d7da;
    border-color: #dc3545;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.2);
    transform: translateY(-1px);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .table-modern thead th,
    .table-calificaciones thead th,
    .table-solicitudes thead th,
    #example thead th {
        padding: 12px 10px !important;
        font-size: 10px !important;
    }

    .table-modern tbody td,
    .table-calificaciones tbody td,
    .table-solicitudes tbody td,
    #example tbody td {
        padding: 10px !important;
        font-size: 12px;
    }

    .acciones-cell {
        flex-direction: column;
        gap: 4px;
    }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
    .table-modern tbody tr:hover,
    .table-calificaciones tbody tr:hover,
    .table-solicitudes tbody tr:hover,
    #example tbody tr:hover {
        transform: none;
        box-shadow: none;
    }

    .acciones-cell,
    .btn-eliminar-sm,
    .btn-download-pdf {
        display: none;
    }
}

/* ══════════════════════════════════════════════════════════
   MODO OSCURO
══════════════════════════════════════════════════════════ */

/* Contenedor de tabla */
[data-theme="dark"] .table-card {
    background: #1e293b;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

/* Headers */
[data-theme="dark"] .table-modern thead th,
[data-theme="dark"] .table-calificaciones thead th,
[data-theme="dark"] .table-solicitudes thead th,
[data-theme="dark"] #example thead th {
    background: #0f172a !important;
    color: #94a3b8 !important;
    border-bottom-color: #334155 !important;
}

/* Filas */
[data-theme="dark"] .table-modern tbody td,
[data-theme="dark"] .table-calificaciones tbody td,
[data-theme="dark"] .table-solicitudes tbody td,
[data-theme="dark"] #example tbody td {
    color: #cbd5e1 !important;
    border-bottom-color: #334155 !important;
}

[data-theme="dark"] .table-modern tbody tr:nth-child(even),
[data-theme="dark"] .table-calificaciones tbody tr:nth-child(even),
[data-theme="dark"] #example tbody tr:nth-child(even) {
    background: #1a2535 !important;
}

[data-theme="dark"] .table-modern tbody tr:hover,
[data-theme="dark"] .table-calificaciones tbody tr:hover,
[data-theme="dark"] .table-solicitudes tbody tr:hover,
[data-theme="dark"] #example tbody tr:hover {
    background: #1e3a5f !important;
    box-shadow: none;
}

/* Columnas específicas */
[data-theme="dark"] .codigo-asignatura { color: #60a5fa !important; }
[data-theme="dark"] .nombre-asignatura { color: #f1f5f9 !important; }
[data-theme="dark"] .td-bold { color: #e2e8f0 !important; }
[data-theme="dark"] .dias { color: #94a3b8 !important; }
[data-theme="dark"] .seccion { color: #94a3b8 !important; }

/* Hora badge */
[data-theme="dark"] .hora-badge {
    background: #334155;
    color: #cbd5e1;
}

/* Botones de acción */
[data-theme="dark"] .btn-eliminar-sm {
    background: transparent;
    border-color: #7f1d1d;
    color: #fca5a5;
}
[data-theme="dark"] .btn-eliminar-sm svg { stroke: #fca5a5; }
[data-theme="dark"] .btn-eliminar-sm:hover { background: #2d1515; border-color: #ef4444; }

[data-theme="dark"] .btn-download-pdf {
    background: #1e293b;
    border-color: #7f1d1d;
}
[data-theme="dark"] .btn-download-pdf svg { stroke: #fca5a5; }
[data-theme="dark"] .btn-download-pdf:hover { background: #2d1515; border-color: #ef4444; }

/* Info card de planificación */
[data-theme="dark"] .info-card {
    background: linear-gradient(135deg,#0c1a3a,#0f2040);
    border-left-color: #3b82f6;
}
[data-theme="dark"] .info-card p { color: #93c5fd; }
[data-theme="dark"] .info-card strong { color: #60a5fa; }
