/* ============================================================
   HISTORIAL ESTUDIANTE CSS
   Estilos para la página de historial académico
   DIPP-UNAH | v1.0.0
   ============================================================ */

/* ── GridPager ───────────────────────────────────────────── */
.GridPager span {
    font-weight: bold;
}

/* ── Banner Documento Oficial ────────────────────────────── */
.alert-documento-oficial {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #3b82f6;
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 24px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    animation: slideInDown 0.4s ease-out;
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-icon-doc {
    width: 44px;
    height: 44px;
    background: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.alert-icon-doc svg {
    width: 22px;
    height: 22px;
    stroke: #3b82f6;
}

.alert-content-doc {
    flex: 1;
}

.alert-title-doc {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.alert-text-doc {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.btn-solicitar-doc {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: white;
    color: #3b82f6;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.btn-solicitar-doc:hover {
    background: #f8fafc;
    border-color: #3b82f6;
    text-decoration: none;
    color: #2563eb;
}

.btn-solicitar-doc svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* ── Student Info Card ───────────────────────────────────── */
.student-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease-out;
}

.student-card-header {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.student-card-header svg {
    width: 24px;
    height: 24px;
    stroke: white;
}

.student-card-header h3 {
    color: white;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

.student-card-body {
    padding: 32px 24px;
}

/* ── Student Photo ───────────────────────────────────────── */
.student-photo-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.student-photo {
    width: 125px;
    height: 140px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ── Student Info Rows ───────────────────────────────────── */
.info-grid {
    display: grid;
    gap: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.info-label {
    color: #6c757d;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 500;
}

/* ── Indices especiales ──────────────────────────────────── */
.indice-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 16px;
}

.indice-global {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.indice-periodo {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
}

/* ── Modern Tabs ─────────────────────────────────────────── */
.nav-tabs {
    border: none;
    background: white;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 24px;
    display: flex;
    gap: 8px;
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.nav-tabs .nav-item {
    flex: 1;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    color: #6c757d;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s ease;
    background: transparent;
    width: 100%;
}

.nav-tabs .nav-link:hover {
    background: #f8f9fa;
    color: #0066cc;
}

.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.3);
}

/* ── Tab Content ─────────────────────────────────────────── */
.tab-content {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

.tab-pane {
    padding: 0;
}

/* ── Table Header ────────────────────────────────────────── */
.table-tab-header {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    padding: 16px 24px;
    text-align: center;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
}

.table-tab-header.empty {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

/* ── GridView Pager ──────────────────────────────────────── */
.GridPager {
    padding: 16px 24px !important;
    background: #f8f9fa !important;
    border-top: 2px solid #e9ecef !important;
}

.GridPager td {
    padding: 12px !important;
}

.GridPager a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    margin: 0 4px;
    border-radius: 6px;
    background: white;
    border: 1px solid #e9ecef;
    color: #0066cc;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.GridPager a:hover {
    background: #0066cc;
    color: white;
    border-color: #0066cc;
    transform: translateY(-2px);
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.3);
}

.GridPager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    margin: 0 4px;
    border-radius: 6px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.3);
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state-grid {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-grid svg {
    width: 64px;
    height: 64px;
    stroke: #adb5bd;
    margin-bottom: 16px;
}

.empty-state-grid h4 {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.empty-state-grid p {
    font-size: 14px;
    color: #6c757d;
}

/* ── Info Stats Badges ───────────────────────────────────── */
.stats-container {
    display: flex;
    gap: 16px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 200px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 16px 20px;
    border-left: 4px solid #0066cc;
}

.stat-card.global {
    border-left-color: #28a745;
}

.stat-card.periodo {
    border-left-color: #0066cc;
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
}

/* ── Loading State ───────────────────────────────────────── */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: #0066cc;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 992px) {
    .student-card-body {
        padding: 24px 16px;
    }

    .stats-container {
        flex-direction: column;
    }

    .stat-card {
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    .alert-documento-oficial {
        flex-direction: row;
        padding: 16px 18px;
        gap: 14px;
    }

    .alert-icon-doc {
        width: 40px;
        height: 40px;
    }

    .alert-icon-doc svg {
        width: 20px;
        height: 20px;
    }

    .alert-title-doc {
        font-size: 14px;
    }

    .alert-text-doc {
        font-size: 12px;
        margin-bottom: 10px;
    }

    .btn-solicitar-doc {
        font-size: 12px;
        padding: 7px 14px;
    }

    .student-photo {
        width: 100px;
        height: 112px;
    }

    .nav-tabs {
        flex-direction: column;
        gap: 6px;
    }

    .nav-tabs .nav-link {
        padding: 10px 16px;
        font-size: 13px;
    }

    .table-tab-header {
        font-size: 14px;
        padding: 12px 16px;
    }
}

@media (max-width: 576px) {
    .student-card-body {
        padding: 20px 12px;
    }

    .GridPager {
        padding: 12px !important;
    }

    .GridPager a,
    .GridPager span {
        min-width: 32px;
        height: 32px;
        font-size: 12px;
        margin: 0 2px;
    }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
    .nav-tabs {
        display: none;
    }

    .tab-content {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    .student-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* ── Accessibility ───────────────────────────────────────── */
.table tbody tr:focus-within {
    outline: 2px solid #0066cc;
    outline-offset: -2px;
}

/* ── Custom Scrollbar ────────────────────────────────────── */
.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #adb5bd;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

/* ══════════════════════════════════════════════════════════
   MODO OSCURO
══════════════════════════════════════════════════════════ */
[data-theme="dark"] .student-card,
[data-theme="dark"] .tab-content {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
[data-theme="dark"] .alert-documento-oficial {
    background: #1e293b;
    border-color: #334155;
    border-left-color: #3b82f6;
}
[data-theme="dark"] .alert-icon-doc { background: #0c1a3a; }
[data-theme="dark"] .alert-title-doc { color: #f1f5f9; }
[data-theme="dark"] .alert-text-doc { color: #94a3b8; }
[data-theme="dark"] .btn-solicitar-doc {
    background: #0f172a;
    border-color: #334155;
    color: #60a5fa;
}
[data-theme="dark"] .btn-solicitar-doc:hover { background: #1e293b; border-color: #3b82f6; }
[data-theme="dark"] .nav-tabs {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
[data-theme="dark"] .nav-tabs .nav-link { color: #94a3b8; }
[data-theme="dark"] .nav-tabs .nav-link:hover { background: #334155; color: #60a5fa; }
[data-theme="dark"] .info-label { color: #94a3b8; }
[data-theme="dark"] .info-value { color: #e2e8f0; }
[data-theme="dark"] .stat-card {
    background: linear-gradient(135deg,#1e293b,#0f172a);
    border-left-color: #3b82f6;
}
[data-theme="dark"] .stat-card.global { border-left-color: #22c55e; }
[data-theme="dark"] .stat-label { color: #94a3b8; }
[data-theme="dark"] .stat-value { color: #f1f5f9; }
[data-theme="dark"] .GridPager { background: #1e293b !important; border-top-color: #334155 !important; }
[data-theme="dark"] .GridPager a { background: #0f172a; border-color: #334155; color: #60a5fa; }
[data-theme="dark"] .GridPager a:hover { background: #3b82f6; border-color: #3b82f6; color: white; }
[data-theme="dark"] .empty-state-grid h4 { color: #94a3b8; }
[data-theme="dark"] .empty-state-grid p { color: #64748b; }
[data-theme="dark"] .table-responsive::-webkit-scrollbar-track { background: #1e293b; }
[data-theme="dark"] .table-responsive::-webkit-scrollbar-thumb { background: #334155; }

/* ── Estilos de filas del GridView (reemplazan ForeColor inline) ── */
.gv-row-hist {
    color: #000066 !important;
}

/* ── Dark mode: filas y headers del historial ─────────────── */
[data-theme="dark"] .gv-row-hist {
    color: #cbd5e1 !important;
    background-color: transparent !important;
}

/* El header azul se mantiene pero se ajusta para dark */
[data-theme="dark"] .gv-header-hist {
    background-color: #1e3a6e !important;
    color: white !important;
}

/* Tabla completa en dark mode */
[data-theme="dark"] .tab-content .table-bordered,
[data-theme="dark"] .tab-content .table {
    background: #1e293b;
    color: #cbd5e1;
    border-color: #334155 !important;
}
[data-theme="dark"] .tab-content .table-bordered td,
[data-theme="dark"] .tab-content .table-bordered th,
[data-theme="dark"] .tab-content .table td,
[data-theme="dark"] .tab-content .table th {
    border-color: #334155 !important;
}
[data-theme="dark"] .tab-content .table tbody tr:hover td {
    background: #1e3a5f !important;
    color: #e2e8f0 !important;
}
[data-theme="dark"] .tab-content .table tbody tr:nth-child(even) td {
    background: #1a2535 !important;
}

/* Tab content container */
[data-theme="dark"] .tab-content {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* Tabs de navegación */
[data-theme="dark"] .nav-tabs {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
[data-theme="dark"] .nav-tabs .nav-link {
    color: #94a3b8;
    background: transparent;
}
[data-theme="dark"] .nav-tabs .nav-link:hover {
    background: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #1e3a6e 0%, #1e4d94 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(0,87,194,.3);
}
