@import url("https://fonts.googleapis.com/css2?family=Merriweather:wght@700;900&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* ========================================
   ENGLISH TESTING SYSTEM - MAIN STYLES
   ======================================== */

:root {
    --primary-color: #1a4f90;
    --primary-dark: #10233b;
    --primary-light: #2766b8;
    --secondary-color: #123f74;
    --secondary-dark: #0f2f58;
    --accent-color: #0c66d4;
    --danger-color: #D32F2F;
    --success-color: #1a4f90;
    --warning-color: #245ea9;
    --info-color: #2766b8;
    --text-primary: #10233b;
    --text-secondary: #5d7490;
    --background-color: #edf3fa;
    --white: #FFFFFF;
    --border-color: rgba(18, 36, 58, 0.12);
    --shadow: 0 12px 28px rgba(12, 28, 46, 0.08);
    --shadow-hover: 0 20px 44px rgba(12, 28, 46, 0.14);
    --border-radius: 12px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background:
        radial-gradient(circle at 10% 12%, rgba(39, 102, 184, 0.08), transparent 42%),
        radial-gradient(circle at 88% 12%, rgba(18, 63, 116, 0.08), transparent 42%),
        linear-gradient(180deg, #f8fbff 0%, var(--background-color) 100%);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background: linear-gradient(120deg, var(--secondary-color), var(--primary-light));
    color: var(--white);
    border-color: transparent;
}

.btn-primary:hover {
    background: linear-gradient(120deg, var(--primary-dark), var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-danger {
    background-color: var(--danger-color);
    color: var(--white);
}

.btn-warning {
    background-color: var(--warning-color);
    color: var(--white);
}

.btn-outline {
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(18, 36, 58, 0.24);
    color: var(--text-primary);
}

.btn-outline:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: transparent;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.125rem;
}

/* ========================================
   FORMS
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(39, 102, 184, 0.18);
}

.form-control::placeholder {
    color: #999;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.form-error {
    color: var(--danger-color);
    font-size: 0.875rem;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

/* ========================================
   CARDS
   ======================================== */
.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-hover);
}

.card-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 0;
}

.card-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 20px;
}

/* ========================================
   TABLES
   ======================================== */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--white);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th,
.table td {
    padding: 14px 16px;
    text-align: left;
}

.table th {
    background: linear-gradient(120deg, var(--secondary-color), var(--primary-light));
    color: var(--white);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
}

.table tr:nth-child(even) {
    background-color: #f7faff;
}

.table tr:hover {
    background-color: #eef4ff;
}

.table-responsive {
    overflow-x: auto;
}

/* ========================================
   ALERTS
   ======================================== */
.alert {
    padding: 16px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background-color: #eef4ff;
    border-color: var(--success-color);
    color: var(--success-color);
}

.alert-danger {
    background-color: #FFEBEE;
    border-color: var(--danger-color);
    color: var(--danger-color);
}

.alert-warning {
    background-color: #FFF3E0;
    border-color: var(--warning-color);
    color: var(--warning-color);
}

.alert-info {
    background-color: #e8eff8;
    border-color: var(--info-color);
    color: var(--info-color);
}

/* ========================================
   BADGES
   ======================================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary { background-color: var(--primary-color); color: var(--white); }
.badge-secondary { background-color: var(--secondary-color); color: var(--white); }
.badge-success { background-color: var(--success-color); color: var(--white); }
.badge-danger { background-color: var(--danger-color); color: var(--white); }
.badge-warning { background-color: var(--warning-color); color: var(--white); }
.badge-info { background-color: var(--info-color); color: var(--white); }

/* ========================================
   MODAL
   ======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(16, 35, 59, 0.45);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background:
        linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 52px rgba(12, 28, 46, 0.2);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ========================================
   UTILITIES
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--text-secondary); }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.d-flex { display: flex; }
.flex-column { flex-direction: column; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.grid {
    display: grid;
    gap: 24px;
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease;
}

.animate-slide-in {
    animation: slideIn 0.5s ease;
}

/* ========================================
   LOADING
   ======================================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 1s ease-in-out infinite;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========================================
   PAGINATION
   ======================================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    transition: var(--transition);
}

.pagination a:hover {
    background: linear-gradient(120deg, var(--secondary-color), var(--primary-light));
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .active {
    background: linear-gradient(120deg, var(--secondary-color), var(--primary-light));
    color: var(--white);
    border-color: var(--primary-color);
}

/* ========================================
   EMPTY STATE
   ======================================== */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* ========================================
   PROGRESS BAR
   ======================================== */
.progress {
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.progress-bar-striped {
    background-image: linear-gradient(45deg, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
}

/* ========================================
   DROPDOWN
   ======================================== */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle::after {
    content: ' ▼';
    font-size: 0.75rem;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 180px;
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    padding: 8px 0;
    display: none;
    z-index: 100;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-item {
    display: block;
    padding: 10px 20px;
    color: var(--text-primary);
    transition: var(--transition);
}

.dropdown-item:hover {
    background-color: #F5F5F5;
    color: var(--primary-color);
}

/* ========================================
   CHECKBOX & RADIO
   ======================================== */
.checkbox-wrapper,
.radio-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.checkbox-wrapper input,
.radio-wrapper input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ========================================
   TABS
   ======================================== */
.tabs {
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 24px;
}

.tab-buttons {
    display: flex;
    gap: 4px;
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s;
}

/* ========================================
   STATUS BADGES
   ======================================== */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-badge.pending {
    background-color: #FFF3E0;
    color: #E65100;
}

.status-badge.pending::before {
    background-color: #FF9800;
}

.status-badge.active {
    background-color: #e8eff8;
    color: #123f74;
}

.status-badge.active::before {
    background-color: #2766b8;
}

.status-badge.completed {
    background-color: #E3F2FD;
    color: #1565C0;
}

.status-badge.completed::before {
    background-color: #2196F3;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 576px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .btn {
        padding: 10px 20px;
    }
    
    .card {
        padding: 16px;
    }
    
    .table th,
    .table td {
        padding: 10px 12px;
        font-size: 0.875rem;
    }
}
