/* Tema Gelap dan Font Dasar */
:root {
    --primary-color: #3a7af5;
    --secondary-color: #6c757d;
    --background-color: #121212;
    --surface-color: #1e1e1e;
    --text-color: #e0e0e0;
    --text-color-muted: #888;
    --border-color: #333;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    margin: 0;
    background-color: var(--background-color);
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--surface-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    flex-grow: 1;
}

/* Header dan Footer */
header {
    background-color: #1e1e1e;
    color: white;
    padding: 1.5rem 0;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

header h1 {
    margin: 0;
    font-size: 2.2rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo {
    width: 40px;
    height: 40px;
}

.subtitle {
    margin: 0.5rem 0 0;
    font-weight: 300;
    color: var(--text-color-muted);
}

footer {
    text-align: center;
    padding: 1rem;
    background-color: #1e1e1e;
    color: var(--text-color-muted);
    font-size: 0.9rem;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

/* Bagian (Sections) */
section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--surface-color);
}

section h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

section h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* Kontainer Unggah Baru */
.upload-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.upload-area {
    display: flex;
    flex-direction: column;
}

/* Zona Drop File (sekarang sebuah label) */
.drop-zone {
    flex-grow: 1;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.dragover {
    background-color: rgba(58, 122, 245, 0.1);
    border-color: var(--primary-color);
}

.drop-zone p {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text-color-muted);
}

/* Menyembunyikan input file dengan benar */
.file-input-hidden {
    display: none;
}

.file-list {
    margin-top: 1.5rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #2a2a2a;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    margin-bottom: 8px;
}

.remove-file-btn {
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.2rem;
    cursor: pointer;
}

/* Tombol */
.button-primary, .button-secondary {
    display: inline-block;
    border: none;
    padding: 12px 24px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.3s ease, transform 0.1s ease;
}

.button-primary {
    background-color: var(--primary-color);
    color: white;
}

.button-primary:hover:not(:disabled) {
    background-color: #1c63e5;
}

.button-primary:disabled {
    background-color: #333;
    color: #777;
    cursor: not-allowed;
}

.button-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.button-secondary:hover {
    background-color: #5a6268;
}

/* Tabs */
.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.tab-link {
    padding: 12px 20px;
    cursor: pointer;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 1rem;
    color: var(--text-color-muted);
    margin-bottom: -1px;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.tab-link.active, .tab-link:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

#download-report-btn {
    margin-left: auto;
    align-self: center;
    margin-bottom: 5px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.5s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Tabel */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th, td {
    padding: 12px;
    border: 1px solid var(--border-color);
    text-align: left;
}

thead {
    background-color: #2a2a2a;
}

tbody tr:nth-child(even) {
    background-color: #242424;
}

/* Filter dan Pencarian */
.filters input[type="text"], .filters select {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: #2a2a2a;
    color: var(--text-color);
}

/* Pagination */
.pagination button {
    background-color: #2a2a2a;
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    margin: 0 2px;
    cursor: pointer;
}

.pagination button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Dashboard */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.chart-container { padding: 1.5rem; border-radius: 8px; border: 1px solid var(--border-color); }
.summary-cards-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.summary-card { background-color: #2a2a2a; padding: 1.5rem; border-radius: 8px; text-align: center; border: 1px solid var(--border-color); }
.summary-card .count { font-size: 2.5rem; font-weight: 600; color: var(--primary-color); }
.summary-card .label { font-size: 1rem; color: var(--text-color-muted); }

/* Kode Pre/Code */
pre {
    background-color: #161616;
    color: #f1f1f1;
    padding: 1.5rem;
    border-radius: 5px;
    max-height: 600px;
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: 1px solid var(--border-color);
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.spinner {
    border: 8px solid #444;
    border-top: 8px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

/* Kelas Utilitas */
.hidden { display: none !important; }

/* Responsif */
@media (max-width: 992px) {
    .dashboard-grid, .upload-container {
        grid-template-columns: 1fr;
    }
}
@media (max-width: 768px) {
    .container { width: 95%; padding: 1rem; }
    header h1 { font-size: 1.8rem; }
    .tabs { flex-direction: column; align-items: stretch; }
    .tab-link { text-align: center; border-bottom: 1px solid var(--border-color); }
    #download-report-btn { margin-left: 0; margin-top: 10px; width: 100%; }
}
