/* --- General Styling & Accessibility --- */
:root {
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --text-color: #212529;
  --bg-color: #ffffff;
  --light-gray: #f8f9fa;
  --border-color: #dee2e6;
  --muted-text: #6c757d;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  margin: 0;
  color: var(--text-color);
  background-color: var(--bg-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

main {
  flex-grow: 1;
  padding: 2rem 0;
}

/* --- Accessibility Helpers --- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: #fff;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --- Header & Navigation --- */
header {
  background: var(--bg-color);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

header .container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo a {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-color);
}

.logo sup {
  font-size: 0.8rem;
  color: var(--primary-color);
  vertical-align: top;
}

.tagline {
  font-style: italic;
  font-size: 1rem;
  color: var(--muted-text);
  margin-right: 1.5rem;
}

nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

nav a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.2s;
}

nav a:hover,
nav a:focus {
  color: var(--primary-color);
  outline: none;
}

/* --- Language Switcher & User Area --- */
.lang-switcher-container {
  margin-left: 1rem;
}

.lang-switcher-form select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background-color: var(--bg-color);
  font-size: 0.9rem;
  cursor: pointer;
}

/* ======================================================= */
/* --- CSS BARU UNTUK AREA PENGGUNA & DROPDOWN-NYA --- */
/* ======================================================= */
.user-area {
    position: relative; /* Penting untuk posisi dropdown */
    margin-left: auto; /* Mendorong ke paling kanan */
    display: flex;
    align-items: center;
}
.user-area .guest-prompt {
    display: flex;
    align-items: center;
    gap: 10px;
}
.guest-prompt .prompt-text {
    font-size: 0.9em;
    color: var(--muted-text);
}
.user-area .button-sm {
    padding: 6px 12px;
    font-size: 0.9em;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
}
.user-area .button-primary {
    background-color: var(--primary-color);
    color: white;
}
.user-area .button-secondary {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}
.user-area .user-profile-button {
    background-color: var(--success-color);
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
    white-space: nowrap;
}

/* Styling Dropdown Profil (hanya jika memiliki class 'show') */
.user-area .profile-dropdown {
    display: none; /* Sembunyi secara default */
    position: absolute;
    top: 120%;
    right: 0;
    background-color: white;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border-radius: 5px;
    min-width: 180px;
    z-index: 1000;
    overflow: hidden;
    padding: 0.5rem 0;
    border: 1px solid var(--border-color);
}
.user-area .profile-dropdown.show {
    display: block; /* Tampilkan jika JS menambahkan class 'show' */
}
.user-area .profile-dropdown a {
    color: black;
    padding: 10px 15px;
    text-decoration: none;
    display: block;
    font-size: 0.9em;
}
.user-area .profile-dropdown a:hover {
    background-color: #f1f1f1;
}
.user-area .profile-dropdown .divider {
    height: 1px;
    margin: 0.5rem 0;
    overflow: hidden;
    background-color: #e9ecef;
}

/* --- Dropdown Navigasi Utama (Docs, dll) --- */
nav ul .dropdown {
  position: relative;
}
nav ul .dropdown-toggle::after {
  content: ' ▼';
  display: inline-block;
  font-size: 0.7em;
  margin-left: 0.3em;
}
nav ul .dropdown-menu {
  display: none; /* Sembunyi secara default */
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  list-style: none;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
  min-width: 160px;
  z-index: 1000;
}
nav ul .dropdown-menu.show {
  display: block; /* Tampilkan jika JS menambahkan class 'show' */
}
nav ul .dropdown-menu a {
  display: block;
  padding: 0.5rem 1rem;
}
nav ul .dropdown-menu a:hover,
nav ul .dropdown-menu a:focus {
  background-color: var(--light-gray);
  color: var(--primary-color);
}
/* ======================================================= */
/* --- AKHIR BLOK CSS BARU --- */
/* ======================================================= */


/* --- Buttons & Links --- */
.button {
  background-color: var(--primary-color);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-decoration: none;
  display: inline-block;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
}
.button:hover {
  background-color: var(--primary-hover);
  color: #fff;
}
.button:focus {
  background-color: var(--primary-hover);
  color: #fff;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.4);
}
nav a.button {
  color: #fff;
}

/* ... (SISA FILE CSS TETAP SAMA) ... */
/* --- Page Layout --- */
h1, h2, h3 { margin-top: 0; }
section { margin-bottom: 2.5rem; }
.welcome-section { text-align: center; padding: 2rem 0; border-bottom: 1px solid var(--border-color); }
.welcome-section .subtitle { font-size: 1.2rem; color: var(--muted-text); }
.quote-section { text-align: center; padding: 2rem; background-color: var(--light-gray); border: 1px solid var(--border-color); border-radius: 5px; margin-bottom: 2.5rem; }
.quote-section h2 { margin-top: 0; margin-bottom: 1rem; color: var(--primary-color); }
.quote-content p { font-size: 1.2rem; font-style: italic; margin-bottom: 0.5rem; }
.quote-content cite { font-style: normal; color: var(--muted-text); }
.news-container { display: flex; flex-direction: column; gap: 2.5rem; }
.news-item { border-bottom: 1px solid var(--border-color); padding-bottom: 1.5rem; }
.news-item:last-child { border-bottom: none; }
.news-title { margin-bottom: 0.5rem; }
.news-meta { font-size: 0.9rem; color: var(--muted-text); margin: 0 0 1rem; }
.news-message { line-height: 1.7; }
table { width: 100%; border-collapse: collapse; margin-top: 2rem; }
table th, table td { padding: 0.8rem 1rem; text-align: left; border-bottom: 1px solid var(--border-color); }
table thead { background-color: var(--light-gray); }
table tbody tr:hover { background-color: #f1f1f1; }
footer { background-color: var(--light-gray); border-top: 1px solid var(--border-color); text-align: center; padding: 1.5rem 0; margin-top: 2rem; color: var(--muted-text); }
footer a { color: var(--primary-color); }
#backToTopBtn { display: none; position: fixed; bottom: 20px; right: 30px; z-index: 99; border: none; outline: none; background-color: var(--primary-color); color: white; cursor: pointer; padding: 10px 15px; border-radius: 50%; font-size: 18px; transition: opacity 0.3s, visibility 0.3s; }
#backToTopBtn:hover, #backToTopBtn:focus { background-color: var(--primary-hover); outline: none; }
@media (max-width: 768px) {
  header .container { flex-direction: column; gap: 1rem; }
  nav ul { flex-wrap: wrap; justify-content: center; gap: 1rem; }
  .lang-switcher-container { margin-left: 0; }
  table thead { display: none; }
  table, table tbody, table tr, table td { display: block; width: 100%; }
  table tr { margin-bottom: 1rem; border: 1px solid var(--border-color); border-radius: 5px; }
  table td { text-align: right; padding-left: 50%; position: relative; border-bottom: 1px solid #eee; }
  table td::before { content: attr(data-label); position: absolute; left: 0; width: 45%; padding-left: 1rem; font-weight: bold; text-align: left; }
}
.calendar-section { padding: 2rem; background-color: var(--light-gray); border: 1px solid var(--border-color); border-radius: 5px; margin-bottom: 2.5rem; }
.calendar-section h2 { margin-top: 0; margin-bottom: 1.5rem; text-align: center; color: var(--primary-color); }
.events-list { display: flex; flex-direction: column; gap: 1rem; }
.event-item { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem; background-color: var(--bg-color); border: 1px solid #ddd; border-radius: 5px; flex-wrap: wrap; }
.event-details { display: flex; flex-direction: column; gap: 0.25rem; }
.event-name { font-weight: bold; font-size: 1.1rem; }
.event-type { font-size: 0.85rem; font-weight: 500; padding: 0.2rem 0.6rem; border-radius: 12px; color: #fff; background-color: var(--muted-text); width: fit-content; }
.event-type-nasional { background-color: #c82333; }
.event-type-international { background-color: #0069d9; }
.event-type-optional { background-color: #218838; }
.event-type-keagamaan { background-color: #ffc107; color: var(--text-color); }
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.65); z-index: 1001; display: none; align-items: center; justify-content: center; padding: 1rem; backdrop-filter: blur(3px); }
.modal-content { background-color: var(--bg-color); padding: 2rem; border-radius: 8px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4); max-width: 600px; width: 100%; position: relative; max-height: 85vh; overflow-y: auto; animation: modal-fade-in 0.3s ease; }
@keyframes modal-fade-in { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.modal-close-btn { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 2.2rem; line-height: 1; color: var(--muted-text); cursor: pointer; padding: 0; transition: color 0.2s; }
.modal-close-btn:hover, .modal-close-btn:focus { color: var(--text-color); outline: none; }
#history-modal-title { margin-top: 0; margin-bottom: 1.5rem; padding-right: 2.5rem; color: var(--primary-color); }
#history-modal-body { line-height: 1.7; white-space: pre-wrap; }
@media (max-width: 500px) {
  .event-item { flex-direction: column; align-items: flex-start; }
  .event-item .button { margin-top: 1rem; width: 100%; text-align: center; }
}