:root {
    --bg-color: #f3f3f3;
    --text-color: #333;
    --heading-color: #2c3e50;
    --description-color: #7f8c8d;
    --container-bg: white;
    --border-color: #eee;
    --table-header-bg: #f8f9fa;
    --table-hover-bg: #f5f5f5;
    --drop-area-border: #3498db;
    --drop-area-highlight: #ecf0f1;
    --primary-button-bg: #3498db;
    --primary-button-hover: #2980b9;
    --secondary-button-bg: #2c3e50;
    --secondary-button-hover: #1a2530;
    --success-button-bg: #27ae60;
    --success-button-hover: #219653;
    --error-bg: #f8d7da;
    --error-color: #721c24;
    --error-border: #dc3545;
    --warning-bg: #fff3cd;
    --warning-color: #856404;
    --warning-border: #ffc107;
    --spinner-bg: #f3f3f3;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --text-color: #e0e0e0;
        --heading-color: #f0f0f0;
        --description-color: #aaaaaa;
        --container-bg: #1e1e1e;
        --border-color: #333333;
        --table-header-bg: #2a2a2a;
        --table-hover-bg: #2c2c2c;
        --drop-area-border: #3498db;
        --drop-area-highlight: #1c2733;
        --primary-button-bg: #3498db;
        --primary-button-hover: #2980b9;
        --secondary-button-bg: #455a64;
        --secondary-button-hover: #37474f;
        --success-button-bg: #2ecc71;
        --success-button-hover: #27ae60;
        --shadow-color: rgba(0,0,0,0.2);
        --shadow-color-strong: rgba(0,0,0,0.4);
        --success-bg: #0d3320;
        --success-color: #8fff9f;
        --success-border: #28a745;
        --error-bg: #350d0d;
        --error-color: #ff8f8f;
        --error-border: #dc3545;
        --warning-bg: #332a0d;
        --warning-color: #ffdd8f;
        --warning-border: #ffc107;
        --spinner-bg: #333333;
    }
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: auto;
}

h1 {
    margin-bottom: 20px;
    color: var(--heading-color);
    font-size: 24px;
    font-weight: 500;
}

.description {
    margin-bottom: 20px;
    color: var(--description-color);
    line-height: 1.6;
}

#upload-container {
    display: flex;
    flex-direction: column;
    max-width: 90%;
    margin: 0 auto;
    width: 100%;
}

#upload-container h2 {
    font-family: 'Sagoe UI', sans-serif;
    font-size: 24;
    font-weight: 700; /* Sesuai dengan 'wght@700' di URL Google Font */
    text-shadow: 0px 2px 10px rgba(0, 0, 0, 0.3); 
}

#drop-area {
    border: 2px dashed var(--drop-area-border);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background-color: var(--container-bg);
    box-shadow: 0 4px 6px var(--shadow-color);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

#drop-area.highlight {
    background-color: var(--drop-area-highlight);
    border-color: var(--primary-button-hover);
    transform: scale(1.01);
}

#drop-area .icon {
    font-size: 48px;
    color: var(--primary-button-bg);
    margin-bottom: 15px;
}

#drop-area h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: var(--heading-color);
}

#drop-area p {
    color: var(--description-color);
    margin-bottom: 20px;
}

#fileElem {
    display: none;
}

.button {
    display: inline-block;
    background-color: var(--primary-button-bg);
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
    border: none;
    font-size: 16px;
}

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

#progress-container {
    margin-top: 20px;
    display: none;
}

#progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
}

#status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 5px;
    display: none;
}

.success {
    background-color: var(--success-bg);
    color: var(--success-color);
    border-left: 4px solid var(--success-border);
}

.error {
    background-color: var(--error-bg);
    color: var(--error-color);
    border-left: 4px solid var(--error-border);
}

.warning {
    background-color: var(--warning-bg);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-border);
}

.right-align {
    text-align: right;
}

#result-container {
    display: none;
    flex-grow: 1;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 0;
    margin: 0;
    z-index: 100;
    background-color: var(--container-bg);
}

#result-frame {
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
    display: block;
    background-color: var(--container-bg);
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

#back-button {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background-color: var(--secondary-button-bg);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 15px;
    cursor: pointer;
    font-size: 14px;
    display: none;
    box-shadow: 0 2px 5px var(--shadow-color-strong);
    transition: background-color 0.3s;
}

#back-button:hover {
    background-color: var(--secondary-button-hover);
}

/* Styles for file history section */
#file-history-container {
    margin-top: 30px;
    max-width: 90%;
    margin: 30px auto 0;
    width: 100%;
}

#file-history-container h2 {
    font-size: 20px;
    margin-bottom: 15px;
    color: var(--heading-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

#file-history-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: var(--container-bg);
    box-shadow: 0 1px 3px var(--shadow-color);
    border-radius: 8px;
    overflow: hidden;
}

#file-history-table th:nth-child(1),
#file-history-table td:nth-child(1) {
    text-align: center; /* Diubah ke center */
    width: 70px; /* Lebar kolom pertama */
}

#file-history-table th:nth-child(2),
#file-history-table td:nth-child(2) {
    text-align: center; /* Diubah ke center */
    width: 120px; /* Lebar kolom kedua */
}

#file-history-table th:nth-child(3),
#file-history-table td:nth-child(3) {
    width: 600px; /* Lebar kolom ketiga */
}

#file-history-table th:nth-child(4),
#file-history-table td:nth-child(4) {
    text-align: center; /* Diubah ke center */
    width: 130px; /* Lebar kolom keempat */
}

#file-history-table th:nth-child(5),
#file-history-table td:nth-child(5) {
    text-align: center; /* Diubah ke center */
    width: 25%; /* Lebar kolom keempat */
}

/* Tambahkan kode berikut untuk setiap kolom lainnya sesuai kebutuhan */
/* Style yang ada tetap diterapkan */
#file-history-table th,
#file-history-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

#file-history-table th {
    background-color: var(--table-header-bg);
    font-weight: 600;
    color: var(--heading-color);
}


#file-history-table tr:hover {
    background-color: var(--table-hover-bg);
}

.file-action-button {
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin-right: 5px;
    transition: all 0.2s ease;
}

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

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

.download-button {
    background-color: var(--success-button-bg);
    color: white;
}

.download-button:hover {
    background-color: var(--success-button-hover);
}

.no-files-message {
    text-align: center;
    padding: 20px;
    color: var(--description-color);
    font-style: italic;
}

#loading-spinner {
    border: 3px solid var(--spinner-bg);
    border-top: 3px solid var(--primary-button-bg);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
    margin-right: 5px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.timestamp {
    white-space: nowrap;
}

.ellipsis {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#progress-container {
    margin-top: 20px;
    display: none;
    position: relative; /* Menambahkan posisi relative ke container */
}

#progress-message {
    margin-bottom: 10px;
    color: var(--description-color);
}

#progress-bar {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    overflow: hidden;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    background: linear-gradient(
        to right,
        rgba(212, 252, 121, 0.7) 0%,
        rgba(150, 230, 161, 0.7) 16.6%,
        rgba(194, 233, 251, 0.7) 33.3%,
        rgba(119, 161, 252, 0.7) 50%,
        rgba(250, 208, 196, 0.7) 66.6%,
        rgba(255, 154, 158, 0.7) 83.3%,
        rgba(212, 252, 121, 0.7) 100%
    );
    background-size: 200% 100%;
    animation: gradientFlow 10s linear infinite;
    color: white; /* Warna teks */
    text-align: center;
}

#progress-bar::-webkit-progress-bar {
    background: transparent; /* Menghapus latar belakang dari progress bar */
    border-radius: 5px;
}

#progress-bar::-webkit-progress-value {
    background-color: transparent; /* Membuat nilai progress transparan */
}


@keyframes gradientFlow {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: -200% 0%;
    }
}

    