/* ==========================================
   Edu.TuNghia1 — Màu: Navy + Trắng + Đồng
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f0f4f8;
    color: #333;
    font-size: 16px;
}

/* --- Header --- */
.header {
    background: #13355E;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 2px solid #A9792C;
    object-fit: contain;
    background: white;
    padding: 3px;
    box-sizing: border-box;
}

.header-text h1 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.header-text p {
    font-size: 13px;
    color: #A9792C;
}

/* --- Container --- */
.container {
    max-width: 720px;
    margin: 30px auto;
    padding: 0 16px;
}

/* --- Card --- */
.card {
    background: white;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.card-title {
    font-size: 18px;
    font-weight: 700;
    color: #13355E;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-title::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 22px;
    background: #A9792C;
    border-radius: 2px;
}

.card-sub {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

/* --- Form tra cứu --- */
.search-box {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-box input {
    flex: 1;
    min-width: 200px;
    padding: 14px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border 0.2s;
}

.search-box input:focus {
    border-color: #13355E;
}

.btn-search {
    padding: 14px 28px;
    background: #13355E;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-search:hover {
    background: #1a4a82;
}

.btn-search:disabled {
    background: #aaa;
    cursor: not-allowed;
}

/* --- Thông tin học sinh --- */
.student-info {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    border-left: 4px solid #A9792C;
}

.student-name {
    font-size: 20px;
    font-weight: 700;
    color: #13355E;
}

.student-meta {
    font-size: 14px;
    color: #555;
    margin-top: 4px;
}

/* --- Tab học kỳ --- */
.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.tab-btn {
    padding: 10px 24px;
    border: 2px solid #13355E;
    border-radius: 8px;
    background: white;
    color: #13355E;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: #13355E;
    color: white;
}

/* --- Bảng điểm --- */
.score-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.score-table th {
    background: #13355E;
    color: white;
    padding: 10px 12px;
    text-align: center;
    font-weight: 600;
}

.score-table th:first-child {
    text-align: left;
}

.score-table td {
    padding: 9px 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.score-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.score-table tr:nth-child(even) {
    background: #f8f9fa;
}

.score-table tr:hover {
    background: #e8f0fe;
}

/* Màu điểm */
.score-high { color: #1a7a1a; font-weight: 700; }
.score-mid  { color: #b36b00; font-weight: 600; }
.score-low  { color: #cc0000; font-weight: 600; }

/* --- Xếp loại --- */
.xeploai-box {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.xeploai-item {
    background: #f0f4f8;
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    flex: 1;
    min-width: 120px;
}

.xeploai-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.xeploai-value {
    font-size: 20px;
    font-weight: 700;
    color: #13355E;
}

/* --- Loading & Error --- */
.loading {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 16px;
}

.error-msg {
    background: #fff0f0;
    border: 1px solid #ffcccc;
    border-radius: 8px;
    padding: 14px 16px;
    color: #cc0000;
    font-size: 15px;
}

/* --- Footer --- */
.footer {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #888;
}

/* --- Responsive mobile --- */
@media (max-width: 480px) {
    .header-text h1 { font-size: 15px; }
    .score-table { font-size: 12px; }
    .score-table th, .score-table td { padding: 7px 6px; }
    .btn-search { width: 100%; }
    .search-box input { min-width: 100%; }
}
/* Loading Overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(19, 53, 94, 0.7);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.loading-overlay.show {
    display: flex;
}
.loading-spinner {
    width: 56px;
    height: 56px;
    border: 5px solid rgba(255,255,255,0.3);
    border-top-color: #A9792C;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}