/* Preloader Styles */
.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8); /* Hitam transparan */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s, visibility 0.3s;
}

.preloader.active {
  visibility: visible;
  opacity: 1;
}

/* Spinner Styles */
.spinner {
  position: relative;
  width: 50px;
  height: 50px;
}

.spinner div {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 5px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite, colorChange 3s linear infinite;
}

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

/* Animasi Perubahan Warna */
@keyframes colorChange {
  0% {
    border-top-color: #ff0000; /* Merah */
  }
  20% {
    border-top-color: #ff7f00; /* Oranye */
  }
  40% {
    border-top-color: #ffff00; /* Kuning */
  }
  60% {
    border-top-color: #00ff00; /* Hijau */
  }
  80% {
    border-top-color: #0000ff; /* Biru */
  }
  100% {
    border-top-color: #8b00ff; /* Ungu */
  }
}

/* Loading Text Styles */
#loadingText {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #ffffff; /* Warna teks putih */
  font-weight: bold;
  text-align: center;
  animation: fadeInOut 1.5s ease-in-out infinite;
}

/* Efek animasi teks */
@keyframes fadeInOut {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.country-btn {
    padding: 5px 20px; /* Atur padding untuk ukuran tombol */
    font-size: 14px; /* Ukuran teks tombol */
    display: inline-flex; /* Menjaga tombol tetap dalam satu baris */
    align-items: center; /* Vertikal align gambar dan teks */
    justify-content: center; /* Horizontally align gambar dan teks */
    width: auto; /* Atur lebar tombol agar menyesuaikan teks dan gambar */
    margin-bottom: 10px; /* Tambahkan margin ke bawah antar tombol */
    background-color: #f0f0f0; /* Latar belakang abu-abu muda */
    border: 1px solid #ddd; /* Border ringan */
    border-radius: 5px; /* Sudut tombol melengkung */
}

.country-btn.active {
    border-color: #007bff;
    background-color: #45068a; /* Latar belakang biru saat tombol aktif */
    color: white; /* Teks putih saat tombol aktif */
}

.centered-image {
    display: flex;
    justify-content: center; /* Menyusun gambar di tengah secara horizontal */
    align-items: center; /* Menyusun gambar di tengah secara vertikal */
    margin-top: 10px; /* Menambahkan sedikit jarak dari elemen sebelumnya */
  }

/* Container switch */
.custom-switch {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 34px;
}

/* Hide default checkbox */
.custom-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* Slider */
.custom-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 34px;
  transition: 0.4s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5px;
  font-size: 18px;
}

/* Light and Dark Icons */
.light-icon, .dark-icon {
  color: #fff;
  font-size: 20px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Light icon visible by default */
.light-icon {
  opacity: 1;
  transform: translateX(0);
}

/* Dark icon hidden by default */
.dark-icon {
  opacity: 0;
  transform: translateX(-20px);
}

/* Handle (small circle) */
.custom-slider:before {
  content: "";
  position: absolute;
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checked state */
input:checked + .custom-slider {
  background-color: #06baae;
}

input:checked + .custom-slider:before {
  transform: translateX(36px);
}

/* Show dark icon and hide light icon */
input:checked + .custom-slider .dark-icon {
  opacity: 1;
  transform: translateX(0);
}

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