/* style.css */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    font-size: 14px; /* Ukuran font standar */
}

.container {
    max-width: 1100px; /* Lebar maksimum container diperlebar sedikit */
    margin: 15px auto; /* Margin atas/bawah dikurangi */
    padding: 15px; /* Padding dikurangi */
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0,0,0,0.1); /* Shadow dikurangi */
}

header {
    background-color: #0056b3;
    color: white;
    padding: 10px 15px; /* Padding dikurangi */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.5em; /* Ukuran logo disesuaikan */
    font-weight: bold;
}

header nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

header nav ul li {
    margin-left: 15px; /* Jarak antar menu dikurangi */
}

header nav ul li a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95em; /* Ukuran font menu */
}

header nav ul li a:hover {
    text-decoration: underline;
}

main {
    padding: 15px 0; /* Padding main dikurangi */
}

footer {
    text-align: center;
    padding: 10px; /* Padding dikurangi */
    background-color: #333;
    color: white;
    margin-top: 15px; /* Margin atas dikurangi */
    font-size: 0.85em; /* Ukuran font footer */
}

h1, h2 {
    color: #0056b3;
    font-size: 1.6em; /* Ukuran H1/H2 disesuaikan */
    margin-top: 0; /* Hapus margin atas default */
    margin-bottom: 15px; /* Jarak bawah H1/H2 */
}

/* Form Styling */
.form-group {
    margin-bottom: 10px; /* Margin antar form group dikurangi */
}

.form-group label {
    display: block;
    margin-bottom: 3px; /* Margin bawah label dikurangi */
    font-weight: bold;
    font-size: 0.9em; /* Ukuran font label */
}

.form-group input[type="text"],
.form-group select {
    width: 100%;
    padding: 7px; /* Padding input/select dikurangi */
    border: 1px solid #ccc; /* Warna border disesuaikan */
    border-radius: 4px;
    box-sizing: border-box;
    font-size: 0.9em; /* Ukuran font input/select */
}

/* Style untuk form-group-inline (digunakan di filter) */
.form-group-inline {
    display: inline-block;
    vertical-align: top; /* Agar sejajar di bagian atas jika tingginya beda */
    margin-right: 15px; /* Jarak antar elemen filter */
    margin-bottom: 10px; /* Margin bawah elemen filter */
}

.form-group-inline label {
    display: inline-block; /* Label tetap di samping input */
    margin-right: 5px;
    font-weight: normal; /* Font label filter tidak terlalu tebal */
}

.form-group-inline input[type="text"],
.form-group-inline select {
    width: auto; /* Biarkan lebar sesuai konten */
    min-width: 120px; /* Lebar minimum untuk dropdown filter */
    padding: 5px 8px; /* Padding lebih kecil untuk filter */
    font-size: 0.85em; /* Ukuran font filter */
}

/* Filter Form Specific Styles */
.filter-form {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex; /* Menggunakan flexbox untuk tata letak horizontal */
    flex-wrap: wrap; /* Izinkan wrap ke baris baru */
    gap: 10px; /* Jarak antar item flex */
    align-items: center; /* Pusatkan item secara vertikal */
}

.filter-form .form-group-inline {
    margin-bottom: 0; /* Hapus margin-bottom default karena pakai gap */
    margin-right: 0; /* Hapus margin-right default karena pakai gap */
}


.btn {
    padding: 8px 12px; /* Padding tombol dikurangi */
    border: none;
    border-radius: 4px; /* Radius sedikit dikurangi */
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 0.9em; /* Ukuran font tombol */
    text-align: center;
    transition: background-color 0.2s ease; /* Transisi halus saat hover */
}

.btn-primary {
    background-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background-color: #0056b3;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

.btn-edit {
    background-color: #ffc107;
    color: #212529;
}

.btn-edit:hover {
    background-color: #e0a800;
}

.btn-delete {
    background-color: #dc3545;
    color: white;
}

.btn-delete:hover {
    background-color: #c82333;
}

.btn-filter {
    background-color: #28a745;
    color: white;
}

.btn-filter:hover {
    background-color: #218838;
}

.btn-reset {
    background-color: #f0ad4e;
    color: white;
}

.btn-reset:hover {
    background-color: #ec971f;
}


/* Table Styling */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px; /* Margin atas tabel dikurangi */
    font-size: 0.9em; /* Ukuran font tabel */
}
.data-table th{ 
    border: 1px solid #ccc;
    padding: 8px; /* Padding sel dikurangi */
    text-align: center;
}
.data-table td {
    border: 1px solid #ddd;
    padding: 8px; /* Padding sel dikurangi */
}

.data-table th {
    background-color: #f2f2f2;
    white-space: nowrap; /* Mencegah header wrap */
}

/* Alert Messages */
.alert {
    padding: 10px;
    margin-bottom: 10px; /* Margin bawah dikurangi */
    border-radius: 4px;
    font-size: 0.9em; /* Ukuran font alert */
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

/* Pagination */
.pagination {
    margin-top: 15px; /* Margin atas dikurangi */
    text-align: center;
    font-size: 0.9em; /* Ukuran font paging */
}

.pagination a {
    color: #007bff;
    padding: 6px 10px; /* Padding link paging dikurangi */
    text-decoration: none;
    border: 1px solid #ddd;
    margin: 0 3px; /* Jarak antar link paging dikurangi */
    border-radius: 4px;
}

.pagination a.active {
    background-color: #007bff;
    color: white;
    border: 1px solid #007bff;
}

.pagination a:hover:not(.active) {
    background-color: #ddd;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    header nav ul {
        margin-top: 10px;
    }
    header nav ul li {
        margin-left: 0;
        margin-right: 15px;
    }
    .filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    .form-group-inline {
        width: 100%;
        margin-right: 0;
    }
    .form-group-inline input[type="text"],
    .form-group-inline select {
        width: 100%;
    }
    .btn-filter, .btn-reset {
        width: 100%;
        margin-bottom: 10px;
    }
}
/* --- Styling for Fieldset and Legend (soal.php form) --- */
fieldset {
    border: 1px solid #ddd; /* Garis tipis abu-abu untuk fieldset */
    padding: 20px; /* Ruang di dalam fieldset */
    margin-bottom: 20px; /* Jarak antar fieldset */
    border-radius: 8px; /* Sudut sedikit membulat */
    background-color: #f9f9f9; /* Latar belakang sedikit berbeda */
}

legend {
    font-size: 1.2em; /* Ukuran teks legend lebih besar */
    font-weight: bold; /* Teks legend tebal */
    color: #0056b3; /* Warna teks legend */
    padding: 0; /* Padding horizontal untuk memisahkan garis fieldset */
    background-color: #fff; /* Latar belakang legend agar tidak transparan */
}

/* Penyesuaian untuk form-group di dalam fieldset agar tidak terlalu sempit */
fieldset .form-group {
    margin-bottom: 15px; /* Sesuaikan jarak antar input dalam fieldset */
}

/* Aturan tambahan agar teks label di dalam fieldset rapi */
fieldset label {
    display: block; /* Pastikan label mengambil baris penuh untuk konsistensi */
    margin-bottom: 5px; /* Jarak antara label dan input */
    font-weight: 600; /* Sedikit lebih tebal dari teks biasa */
}

/* Penyesuaian untuk input dan select di dalam fieldset */
fieldset input[type="text"],
fieldset textarea,
fieldset select {
    width: calc(100% - 22px); /* Sesuaikan lebar agar tidak terlalu besar */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Pastikan padding dan border termasuk dalam lebar */
    font-size: 1em;
}

fieldset textarea {
    min-height: 80px; /* Tinggi minimum untuk textarea */
    resize: vertical; /* Hanya izinkan resize secara vertikal */
}

/* Styling untuk file input (opsional, karena browser men-stylenya secara default) */
fieldset input[type="file"] {
    padding: 8px 0; /* Memberi sedikit padding vertical */
}
/* --- Styling for Checkbox List within Fieldset --- */
.soal-list {
    max-height: 400px; /* Batasi tinggi daftar soal */
    overflow-y: auto; /* Aktifkan scroll jika melebihi tinggi */
    border: 1px solid #e0e0e0;
    padding: 10px;
    background-color: #fff;
    border-radius: 5px;
    margin-top: 15px;
}

.soal-item {
    padding: 8px 0;
    border-bottom: 1px dotted #eee;
    display: flex;
    align-items: flex-start; /* Sejajarkan di atas */
}

.soal-item:last-child {
    border-bottom: none;
}

.soal-item input[type="checkbox"] {
    margin-right: 10px;
    min-width: 20px; /* Agar checkbox tidak terlalu kecil */
    min-height: 20px;
    align-self: center; /* Sejajarkan checkbox di tengah */
}

.soal-item label {
    display: block; /* Pastikan label mengambil sisa ruang */
    cursor: pointer;
    margin-bottom: 0; /* Hapus margin default label */
    font-weight: normal; /* Kembali ke normal */
    flex-grow: 1; /* Biarkan label mengisi ruang yang tersedia */
}

/* --- Styling for Link Ujian in Table --- */
.link-ujian-input {
    width: calc(100% - 70px); /* Kurangi lebar untuk tombol copy */
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: monospace; /* Font monospace agar terlihat seperti kode */
    font-size: 0.9em;
    background-color: #f5f5f5;
    vertical-align: middle;
}

.btn-copy {
    padding: 8px 12px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 5px;
    font-size: 0.9em;
    vertical-align: middle;
}

.btn-copy:hover {
    background-color: #0056b3;
}

/* Override btn-small if it interferes */
.btn-small {
    padding: 5px 10px;
    font-size: 0.85em;
}

.salah-jawaban {
    background-color: #ffe6e6; /* Merah muda terang */
    color: #cc0000; /* Merah gelap */
    font-weight: bold;
}