/* ============================================================
   PAGES COMMON CSS
   Estilos compartidos entre páginas de módulos específicos
   (Calificaciones, Planificación, Solicitudes, etc.)
   DIPP-UNAH | v1.0.0
   ============================================================ */

/* ── Layout Base ─────────────────────────────────────────── */
.main-content .container-fluid {
    background: transparent;
    padding: 0;
}

/* ── Header Links ────────────────────────────────────────── */
.header-links,
.header-links-estado {
    text-align: right;
    font-size: 14px;
}

.header-links a,
.header-links-estado a {
    color: #0066cc;
    text-decoration: none;
    transition: color 0.2s;
}

.header-links a:hover,
.header-links-estado a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* ── Info Card ───────────────────────────────────────────── */
.info-card {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #0066cc;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0, 102, 204, 0.1);
    animation: fadeInUp 0.5s ease-out;
}

.info-card p {
    margin: 0;
    color: #1565c0;
    font-weight: 500;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.6;
}

.info-card strong {
    color: #0052a3;
    font-weight: 700;
}

.info-card svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
    fill: none;
}

/* ── Table Card Container ────────────────────────────────── */
.table-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.table-header {
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    padding: 16px 24px;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-header svg {
    width: 20px;
    height: 20px;
    stroke: white;
    fill: none;
    flex-shrink: 0;
}

.table-header h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.5px;
}

/* ── Table Responsive ────────────────────────────────────── */
.table-responsive {
    padding: 0;
    overflow-x: auto;
}

/* ── Search Container ────────────────────────────────────── */
.search-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.search-wrapper {
    position: relative;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: #6c757d;
    pointer-events: none;
}

.search-input,
#filtroBusqueda {
    width: 100%;
    height: 46px;
    padding: 12px 16px 12px 48px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus,
#filtroBusqueda:focus {
    outline: none;
    border-color: #0066cc;
    background: white;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.search-input::placeholder,
#filtroBusqueda::placeholder {
    color: #adb5bd;
}

/* ── Botón Nueva Solicitud ───────────────────────────────── */
.btn-nueva-solicitud {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0066cc, #0052a3);
    color: white;
    border: none;
    border-radius: 9px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0, 102, 204, 0.3);
    transition: all 0.2s;
    margin-bottom: 20px;
}

.btn-nueva-solicitud svg {
    width: 16px;
    height: 16px;
    stroke: white;
    fill: none;
    stroke-width: 2.5;
}

.btn-nueva-solicitud:hover {
    background: linear-gradient(135deg, #0052a3, #003f80);
    box-shadow: 0 5px 16px rgba(0, 102, 204, 0.4);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* ── Empty State Card ────────────────────────────────────── */
.empty-state-card {
    background: linear-gradient(135deg, #e8f4fd 0%, #d6eaf8 100%);
    border: 1px solid #bee3f8;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    color: #1a3a5c;
    margin-bottom: 20px;
}

.empty-state-card svg {
    width: 48px;
    height: 48px;
    stroke: #0066cc;
    fill: none;
    stroke-width: 1.5;
    margin: 0 auto 14px;
    opacity: 0.6;
    display: block;
}

.empty-state-card p {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    color: #003366;
}

/* ── Badges de Estado ────────────────────────────────────── */
.badge-estado {
    display: inline-flex;
    align-items: center;
    border-radius: 20px;
    padding: 4px 11px;
    font-size: 11.5px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #b8dacc;
}

.badge-info-st {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffd866;
}

.badge-default {
    background: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ── Animaciones ─────────────────────────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .header-links,
    .header-links-estado {
        text-align: left;
        margin-top: 12px;
    }

    .table-header {
        padding: 14px 18px;
        font-size: 14px;
    }

    .search-container {
        padding: 16px;
    }
}

@media (max-width: 576px) {
    .info-card {
        padding: 14px 16px;
    }

    .info-card p {
        font-size: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
    .table-card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }

    .table-header {
        background: #f8f9fa !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ══════════════════════════════════════════════════════════
   MODO OSCURO
══════════════════════════════════════════════════════════ */
[data-theme="dark"] .table-card {
    background: #1e293b;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
[data-theme="dark"] .search-container {
    background: #1e293b;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
[data-theme="dark"] .search-input,
[data-theme="dark"] #filtroBusqueda {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
[data-theme="dark"] .search-input:focus,
[data-theme="dark"] #filtroBusqueda:focus {
    border-color: #3b82f6;
    background: #1e293b;
    box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
[data-theme="dark"] .empty-state-card {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border-color: #334155;
    color: #94a3b8;
}
[data-theme="dark"] .empty-state-card p { color: #94a3b8; }
[data-theme="dark"] .empty-state-card svg { stroke: #3b82f6; }
[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; }

/* ── Empty state genérico (usado en cancelar-clase, etc.) ── */
[data-theme="dark"] .empty-state {
    background: transparent;
}
[data-theme="dark"] .empty-state h4 { color: #94a3b8; }
[data-theme="dark"] .empty-state p  { color: #64748b; }
[data-theme="dark"] .empty-state svg { stroke: #475569; }

/* ── Table header genérico ───────────────────────────────── */
[data-theme="dark"] .table-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    border-bottom: 1px solid #334155;
}

/* ── GridView con estilos inline de ASP.NET ──────────────── */
/* BackColor="#006699" y ForeColor="#000066" se renderizan inline,
   necesitamos !important con alta especificidad para sobrescritos */
[data-theme="dark"] .table-card table thead tr th,
[data-theme="dark"] .table-card .table thead th,
[data-theme="dark"] .table-card .table-bordered thead th {
    background-color: #0f172a !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .table-card table tbody tr td,
[data-theme="dark"] .table-card .table tbody td,
[data-theme="dark"] .table-card .table-bordered tbody td {
    background-color: transparent !important;
    color: #cbd5e1 !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .table-card table tbody tr:nth-child(even) td {
    background-color: rgba(15, 23, 42, 0.5) !important;
}
[data-theme="dark"] .table-card table tbody tr:hover td {
    background-color: rgba(30, 58, 95, 0.6) !important;
}

/* Paginador */
[data-theme="dark"] .table-card .GridPager td,
[data-theme="dark"] .table-card .GridPager a,
[data-theme="dark"] .table-card .GridPager span {
    background-color: #1e293b !important;
    color: #94a3b8 !important;
    border-color: #334155 !important;
}
[data-theme="dark"] .table-card .GridPager a:hover {
    background-color: #334155 !important;
    color: #e2e8f0 !important;
}
