/* universal box sizing & transisi */
* {
  box-sizing: border-box;
  /* Transisi halus diterapkan pada semua elemen */
  transition: all 0.4s ease-in-out; 
}

/* smooth scrolling pada seluruh halaman */
html {
    scroll-behavior: smooth;
}

body {
  font-family: 'Quicksand', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f6f6f6;
  line-height: 1.6;
}

/* logo */
.center-img {
    display: block;
    margin-left: auto;
    margin-right: auto;
    width: 250px;
}

/* styling header */
header {
  text-align: center;
  background-color: #4CAF50;
  color: white;
  padding: 30px 20px 10px 20px;
  border-bottom: 5px solid #388E3C;
}

header h1 {
  color: white;
  margin-bottom: 5px;
}

header p {
  color: white;
}

/* styling navigasi */
nav ul {
  padding-inline: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; 
}

nav li {
  list-style-type: none;
}
 
nav a {
  font-size: 18px;
  font-weight: 400;
  text-decoration: none;
  color: white;
  padding: 5px 10px;
  transition: all 0.3s ease;
}

nav a:hover {
  font-weight: bold;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
}

/* main layout menggunakan flexbox */
main {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  gap: 20px;
}

#content {
  flex: 3;
}

aside {
  flex: 1;
}

/* heading styling */
h2, h3 {
  color: #388E3C;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 5px;
  margin-top: 0;
}
 
footer {
  padding: 20px;
  color: white;
  background-color: #4CAF50;
  text-align: center;
  font-weight: bold;
}

/* profile aside styling */
.profile header {
  text-align: center;
}

.profile header h2 {
    color: #388E3C;
}

.profile img {
  width: 150px;
  margin-bottom: 10px;
}

/* card styling */
.card {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 20px;
  margin-top: 20px;
  background-color: white;
}

.card:hover {
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.15);
}

.featured-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  object-position: center;
  border-radius: 5px;
}

/* tabel profil */
.profile table {
  width: 100%;
  border-collapse: collapse;
}

.profile th, .profile td {
  padding: 10px 5px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.profile table td {
    word-wrap: break-word;
}

.profile tr:last-child th, .profile tr:last-child td {
  border-bottom: none;
}

/* media query untuk responsif */
@media screen and (max-width: 850px) {
  main {
    flex-direction: column;
  }

  #content, aside {
    flex: auto;
  }
}

/* styling pemerintahan */
.official-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 10px;
}

.official-item {
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;
    margin-top: 20px;
}

/* styling foto */
.official-photo {
    width: 140px;        
    height: 170px;       
    object-fit: cover;  
    object-position: top center; 
    border-radius: 8px;  
    box-shadow: 0 4px 6px rgba(0,0,0,0.15); 
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

.official-photo:hover {
    transform: scale(1.02); 
}

/* styling text nama & jabatan */
.official-info strong {
    display: block;
    color: #333;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.role-badge {
    display: inline-block;
    background-color: #4CAF50; 
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
}

/* styling google maps */
.map-container {
    margin-top: 15px;
    border-radius: 8px;
    overflow: hidden; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.map-container iframe {
    display: block; 
    width: 100%;    
}

/* animasi */
.fade-up {
    opacity: 0;
    transform: translateY(40px); 
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: opacity, transform; 
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.official-item:nth-child(2) {
    transition-delay: 0.2s; 
}

/* dark mode */

.dark-mode {
    background-color: #121212;
    color: #e0e0e0;
}

.dark-mode header {
    background-color: #2e7d32;
    border-bottom-color: #1b5e20;
}

.dark-mode h1, .dark-mode header p, .dark-mode nav a {
    color: #e0e0e0; 
}

.dark-mode footer {
    background-color: #2e7d32;
}

.dark-mode h2, .dark-mode h3 {
    color: #81C784;
    border-bottom-color: #333;
}

.dark-mode .profile header h2 {
    color: #e0e0e0;
}

.dark-mode .card {
    background-color: #1e1e1e;
    color: #bdbdbd;
    box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.4);
}

.dark-mode .card:hover {
    box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.6);
}

.dark-mode .profile table th, .dark-mode .profile table td {
    border-bottom-color: #333;
}

.dark-mode .official-info strong {
    color: #e0e0e0;
}

.dark-mode .featured-image {
    filter: brightness(0.8);
}

.dark-mode .featured-image:hover {
    filter: brightness(0.9);
}

/* styling tombol switch */
.switch {
  position: absolute; 
  top: 35px;
  right: 20px;
  display: inline-block;
  width: 55px;
  height: 25px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
}

.slider.round {
  border-radius: 25px;
}

/* styling toggle */

.mode-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 3px; 
    transition: opacity 0.4s, transform 0.4s; 
}

/* light mode */
.light-icon {
    left: 3px; 
    opacity: 1; 
}

/* dark mode */
.dark-icon {
    left: 3px; 
    opacity: 0; 
}

/* dark mode aktif */
input:checked + .slider {
  background-color: #212121; 
}

input:checked + .slider .light-icon {
    opacity: 0; 
    transform: translateX(30px); 
}

input:checked + .slider .dark-icon {
    opacity: 1; 
    transform: translateX(30px); 
} 

/* 1. Styling Tombol Back to Top */
#backToTop {
    display: none; /* Tersembunyi saat awal */
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: #4CAF50; /* Warna Hijau Tema */
    color: white;
    cursor: pointer;
    padding: 15px;
    border-radius: 50%;
    font-size: 20px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: background-color 0.3s, transform 0.3s;
}

#backToTop:hover {
    background-color: #388E3C;
    transform: scale(1.1);
}

/* 2. Styling Menu Navigasi Aktif (ScrollSpy) */
/* Menu akan menyala putih saat bagiannya sedang dibaca */
nav a.active-link {
    background-color: white;
    color: #4CAF50;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* 1. Styling Jam & Sapaan */
#greeting-container {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #e8f5e9;
    background-color: rgba(0, 0, 0, 0.2);
    display: inline-block;
    padding: 5px 15px;
    border-radius: 20px;
}

/* 2. Styling Kursor Zoom pada Gambar */
.clickable-image {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}
.clickable-image:hover {
    transform: scale(1.02);
}

/* 3. Styling Lightbox Modal (Pop-up) */
.modal {
  display: none; /* Hidden by default */
  position: fixed; 
  z-index: 1000; 
  padding-top: 60px; 
  left: 0;
  top: 0;
  width: 100%; 
  height: 100%; 
  overflow: auto; 
  background-color: rgb(0,0,0); 
  background-color: rgba(0,0,0,0.9); 
}

/* Gambar di dalam Modal */
.modal-content {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 800px;
  border-radius: 5px;
  animation-name: zoom;
  animation-duration: 0.6s;
}

@keyframes zoom {
  from {transform:scale(0)} 
  to {transform:scale(1)}
}

/* Tombol Close (X) */
.close {
  position: absolute;
  top: 15px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  transition: 0.3s;
  cursor: pointer;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
  cursor: pointer;
}

/* Caption Gambar */
#caption {
  margin: auto;
  display: block;
  width: 80%;
  max-width: 700px;
  text-align: center;
  color: #ccc;
  padding: 10px 0;
  height: 150px;
}

/* Responsif untuk Modal */
@media only screen and (max-width: 700px){
  .modal-content {
    width: 100%;
  }
}

/* reading progress */
.progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  z-index: 9999; 
  background: transparent;
}

.progress-bar {
  height: 5px;
  background: #4CAF50; 
  width: 0%;
  box-shadow: 0 0 10px rgba(255, 235, 59, 0.7);
  transition: width 0.1s ease-out;
}

/* cursor kedip untuk efek typewriter */
.cursor {
    display: inline-block;
    width: 2px;
    background-color: white;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* scrollbar ijo */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #e0e0e0; 
}

::-webkit-scrollbar-thumb {
    background-color: #4CAF50; 
    border-radius: 6px;
    border: 3px solid #e0e0e0;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #388E3C; 
}

/* preload */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff; 
    z-index: 99999; 
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #4CAF50; 
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* custom cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid #4CAF50;
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: transform 0.1s, background-color 0.2s;
}


.custom-cursor.active {
    transform: translate(-50%, -50%) scale(1.8);
    background-color: rgba(76, 175, 80, 0.1);
    border-color: transparent;
}


@media (hover: none) and (pointer: coarse) {
    .custom-cursor {
        display: none;
    }
}

/* trivia card */
.trivia-card {
    background: linear-gradient(135deg, #4CAF50, #81C784);
    color: white;
    text-align: center;
}

.trivia-content {
    font-size: 1.1em;
    font-weight: 500;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fade-text {
    animation: fadeText 0.5s ease-in-out;
}

@keyframes fadeText {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.dark-mode .card.trivia-card {
    background: linear-gradient(135deg, #4CAF50, #81C784);
    color: white !important;
}

.dark-mode .card.trivia-card p,
.dark-mode .card.trivia-card h3 {
    color: white !important;
}

/* faq */
.accordion {
    margin-top: 10px;
}

.accordion-item {
    border-bottom: 1px solid #ddd;
}

.accordion-item:last-child {
    border-bottom: none;
}

.accordion-header {
    background-color: transparent;
    border: none;
    width: 100%;
    text-align: left;
    padding: 15px 0;
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: color 0.3s;
    font-family: 'Quicksand', sans-serif;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Icon panah sederhana menggunakan CSS pseudo-element */
.accordion-header::after {
    content: '+';
    font-size: 1.2rem;
    color: #4CAF50;
    transition: transform 0.3s;
}

.accordion-header.active::after {
    content: '-';
    transform: rotate(180deg);
}

.accordion-header:hover {
    color: #4CAF50;
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    color: #555;
}

.accordion-content p {
    margin: 0 0 15px 0;
}

/* FAQ di Dark Mode */
.dark-mode .accordion-header {
    color: #e0e0e0;
}

.dark-mode .accordion-header:hover {
    color: #81C784;
}

.dark-mode .accordion-content {
    color: #ccc;
}

.dark-mode .accordion-item {
    border-bottom-color: #444;
}