/* Definisi Variabel Warna Tema Merah Putih */
:root {
    --primary-color: #d9251d; /* Merah Bendera */
    --secondary-color: #f8f9fa; /* Putih Gading (untuk latar) */
    --surface-color: #ffffff; /* Putih Bersih */
    --text-color: #212529; /* Hitam Teks */
    --subtle-text-color: #6c757d; /* Abu-abu */
    --border-color: #dee2e6;
}

/* Pengaturan Dasar Body */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
}

/* Kontainer Utama */
.container {
    background-color: var(--surface-color);
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    max-width: 900px;
    text-align: center;
    border-top: 5px solid var(--primary-color); /* Aksen Merah di Atas */
}

/* Bagian Header */
.header-section {
    margin-bottom: 30px;
}
.header-logo {
    max-width: 90px;
    margin-bottom: 15px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    padding: 4px;
}
h1 {
    color: var(--text-color);
    font-weight: 700;
    margin: 0 0 10px 0;
}
.subtitle {
    color: var(--subtle-text-color);
    margin: 0;
    font-size: 1.1em;
}

/* Grup Form */
.form-group {
    margin-bottom: 25px;
    text-align: left;
}
label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #34495e;
}
.label-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* Grup Checkbox */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    border: 1px solid var(--border-color);
    padding: 15px;
    border-radius: 12px;
}
.checkbox-group div {
    display: flex;
    align-items: center;
    gap: 8px;
}
.checkbox-group label {
    font-weight: 500;
    margin-bottom: 0;
}
input[type="checkbox"] {
    width: 1.2em;
    height: 1.2em;
    accent-color: var(--primary-color); /* Checkbox menjadi merah */
}

/* Grid Penerjemah */
.translator-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 30px;
}
@media (min-width: 768px) {
    .translator-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Area Teks */
textarea {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    font-size: 16px;
    line-height: 1.6;
    resize: vertical;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(217, 37, 29, 0.2);
}

/* Hasil Terjemahan */
#translation-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.result-box textarea {
    background-color: #f8f9fa;
    color: #333;
    font-weight: 500;
}
.result-lang-label {
    font-weight: bold;
    text-transform: capitalize;
    font-size: 0.9em;
}
.placeholder-box {
    width: 100%;
    height: 100%;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background-color: #f8f9fa;
    border: 2px dashed var(--border-color);
    color: var(--subtle-text-color);
}

/* Tombol */
.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}
.btn-translate, .btn-secondary {
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btn-translate {
    background-color: var(--primary-color);
    color: white;
}
.btn-translate:hover {
    background-color: #b21e17;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(217, 37, 29, 0.3);
}
.btn-secondary {
    background-color: var(--surface-color);
    color: #495057;
    border: 2px solid var(--border-color);
}
.btn-secondary:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}
.btn-contoh {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}
.btn-contoh:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Kotak Pesan & Debug */
.error-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    border-radius: 8px;
}
.debug-box {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-align: left;
    max-height: 200px;
    overflow-y: auto;
}
.debug-box pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.9em;
}

/* Animasi Loader */
#loader-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: none;
    justify-content: center; align-items: center; flex-direction: column;
    z-index: 1000;
}
.loader { display: flex; }
.loader div {
    width: 1rem; height: 1rem; margin: 0 0.5rem;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: pulse 1.4s infinite ease-in-out both;
}
.loader div:nth-child(1) { animation-delay: -0.32s; }
.loader div:nth-child(2) { animation-delay: -0.16s; }
.loader-text {
    margin-top: 1.5rem; font-size: 1.2em; color: #34495e; font-weight: 500;
}
@keyframes pulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1.0); opacity: 1; }
}