/* ================================
   THEME VARIABLES
================================ */
:root {
  /* Background */
  --color-bg: #1d311b;
  --color-bg-card: #2b4a30;
  --color-bg-dark: #26361f;
  --color-bg-accent: #2c5431;
  --color-bg-hover: #56a35c;

  /* Text */
  --color-text: #ffffff;
  --color-text-accent: #ffcc00;
  --color-text-dark: #000000;

  /* Buttons */
  --btn-primary-bg: #ff0000;
  --btn-primary-text: #ffffff;
  --btn-secondary-bg: #ffcc00;
  --btn-secondary-text: #000000;

  /* Progress Bar */
  --progress-green: #4caf50;
  --progress-orange: #ff9800;
  --progress-red: #f44336;

  /* Popup */
  --popup-bg: #ffffff;
  --popup-text: #333;
}

/* Tema alternatif contoh */
/* Light theme */

/* ☀️ Light Theme */
.theme-light {
  --color-bg: #f9f9f9;
  --color-bg-card: #ffffff;
  --color-bg-dark: #eeeeee;
  --color-bg-accent: #dddddd;
  --color-bg-hover: #cccccc;

  --color-text: #222;
  --color-text-accent: #ff5722;
  --color-text-dark: #000;

  --btn-primary-bg: #2196f3;
  --btn-primary-text: #fff;
  --btn-secondary-bg: #ffc107;
  --btn-secondary-text: #000;

  --progress-green: #4caf50;
  --progress-orange: #ff9800;
  --progress-red: #f44336;

  --popup-bg: #fff;
  --popup-text: #111;
}

/* 🔵 Modern Blue */
.theme-modern-blue {
  --color-bg: #0f172a;
  --color-bg-card: #1e293b;
  --color-bg-dark: #334155;
  --color-bg-accent: #1e40af;
  --color-bg-hover: #2563eb;

  --color-text: #e2e8f0;
  --color-text-accent: #38bdf8;
  --color-text-dark: #0f172a;

  --btn-primary-bg: #3b82f6;
  --btn-primary-text: #fff;
  --btn-secondary-bg: #38bdf8;
  --btn-secondary-text: #0f172a;

  --progress-green: #22c55e;
  --progress-orange: #facc15;
  --progress-red: #ef4444;

  --popup-bg: #1e293b;
  --popup-text: #e2e8f0;
}

/* 🔥 Elegant Red */
.theme-elegant-red {
  --color-bg: #1a0b0b;
  --color-bg-card: #2d1b1b;
  --color-bg-dark: #3b1f1f;
  --color-bg-accent: #5c1a1a;
  --color-bg-hover: #b91c1c;

  --color-text: #fef2f2;
  --color-text-accent: #f87171;
  --color-text-dark: #000;

  --btn-primary-bg: #dc2626;
  --btn-primary-text: #fff;
  --btn-secondary-bg: #facc15;
  --btn-secondary-text: #000;

  --progress-green: #16a34a;
  --progress-orange: #f97316;
  --progress-red: #dc2626;

  --popup-bg: #fff;
  --popup-text: #222;
}

/* 🟣 Futuristic Purple */
.theme-futuristic-purple {
  --color-bg: #12091d;
  --color-bg-card: #1e1233;
  --color-bg-dark: #2a1d40;
  --color-bg-accent: #5b21b6;
  --color-bg-hover: #7c3aed;

  --color-text: #e9d5ff;
  --color-text-accent: #c084fc;
  --color-text-dark: #12091d;

  --btn-primary-bg: #8b5cf6;
  --btn-primary-text: #fff;
  --btn-secondary-bg: #a78bfa;
  --btn-secondary-text: #12091d;

  --progress-green: #22c55e;
  --progress-orange: #facc15;
  --progress-red: #ef4444;

  --popup-bg: #1e1233;
  --popup-text: #f3e8ff;
}

/* 🟢 Neon Green */
.theme-neon-green {
  --color-bg: #000000;
  --color-bg-card: #0a0f0a;
  --color-bg-dark: #0f1a0f;
  --color-bg-accent: #064e3b;
  --color-bg-hover: #22c55e;

  --color-text: #d1fae5;
  --color-text-accent: #22ff88;
  --color-text-dark: #000;

  --btn-primary-bg: #22c55e;
  --btn-primary-text: #000;
  --btn-secondary-bg: #84cc16;
  --btn-secondary-text: #000;

  --progress-green: #22ff88;
  --progress-orange: #fde047;
  --progress-red: #f87171;

  --popup-bg: #0a0f0a;
  --popup-text: #d1fae5;
}

/* ================================
   BASE
================================ */
body {
  max-width: 1140px;
  font-family: 'Roboto', sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  margin: auto;
  padding: 10px;
}

.header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 20px;
}

.header img.logo {
  max-width: 150px;
  margin-bottom: 20px;
}

.header img.banner {
  max-width: 100%;
  margin-bottom: 20px;
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.rtp-update {
  text-align: right;
  font-size: 0.85em;
  color: var(--color-text-accent);
}

/* ================================
   BUTTONS & SEARCH
================================ */
.header .buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  margin: 0 auto 20px;
}

.header .buttons a {
  background-color: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  text-align: center;
}

.header .buttons a.daftar {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
}

.header .search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  margin: 0 auto 20px;
}

.header .search input {
  padding: 10px;
  border-radius: 5px;
  border: none;
  width: 100%;
}

.header .search button {
  padding: 10px 20px;
  border-radius: 5px;
  border: none;
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}

/* ================================
   NAVIGATION
================================ */
.nav-wrapper {
  border: 12px solid var(--color-bg-accent);
  overflow-x: auto;
  max-width: 100%;
  margin: 0 auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-bg-card) var(--color-bg-accent);
}
.nav-container {
  display: grid;
  grid-template-rows: repeat(2, auto);
  grid-auto-flow: column;
  gap: 10px;
  background-color: var(--color-bg-accent);
  width: max-content;
}
.nav-menu {
  margin: 5px 0;
  padding: 10px 20px;
  color: var(--color-text);
  text-decoration: none;
  font-weight: bold;
  border-radius: 20px;
  background-color: var(--color-bg-card);
  transition: background-color 0.3s;
  white-space: nowrap;
  text-align: center;
}
.nav-menu:hover {
  background-color: var(--color-bg-hover);
}

/* Scrollbar Webkit */
.nav-wrapper::-webkit-scrollbar {
  height: 8px;
}
.nav-wrapper::-webkit-scrollbar-track {
  background: var(--color-bg-accent);
}
.nav-wrapper::-webkit-scrollbar-thumb {
  background-color: var(--color-bg-card);
  border-radius: 10px;
  border: 2px solid var(--color-bg-accent);
}
.nav-wrapper::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-bg-hover);
}

/* ================================
   GAME LIST & CARDS
================================ */
.container {
  width: 100%;
  max-width: 1140px;
  margin: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.game-card {
  background: var(--color-bg-card);
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.game-card img {
  width: 100%;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.game-title {
  background: var(--color-bg-dark);
  min-height: 24px;
  font-size: 0.7em;
  font-weight: bold;
  padding: 5px;
  color: var(--color-text-accent);
  text-transform: uppercase;
  text-align: center;
  align-content: center;
}

/* Progress Bar */
.progress-bar-container {
  background: #37693a;
  border-radius: 8px;
  overflow: hidden;
  margin: 10px 0;
  position: relative;
}
.progress-bar {
  height: 18px;
  text-align: right;
  padding-right: 10px;
  color: transparent;
  line-height: 18px;
  border-radius: 8px 0 0 8px;
  font-size: 0.9em;
  width: 0;
  transition: width 1s ease-in-out;
  background-image: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 40px 40px;
  animation: moveBackground 1s linear infinite;
}
@keyframes moveBackground {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 40px 40px;
  }
}
.progress-bar.green {
  background-color: var(--progress-green);
}
.progress-bar.orange {
  background-color: var(--progress-orange);
}
.progress-bar.red {
  background-color: var(--progress-red);
}

.progress-bar-text {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  font-weight: bold;
  font-size: 0.85em;
}

.game-info {
  min-height: 114px;
  background: var(--color-bg-dark);
  padding: 10px;
  border-radius: 8px;
  margin-top: 10px;
}
.game-info p {
  margin: 5px 0;
  font-size: 0.8em;
}
.gacor-time {
  color: var(--color-text-accent);
  font-weight: bold;
}

.pola-slot {
  min-height: 84px;
  margin: 5px 0;
  font-size: 0.8em;
  color: var(--color-text);
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  flex-direction: column;
}
.pola-slot-table {
  width: 100%;
  border-collapse: collapse;
}
.pola-slot-table td {
  padding: 5px;
  text-align: left;
  font-size: 0.8em;
}
.pola-slot-table .pola-value {
  text-align: right;
  font-weight: bold;
}
.pola-slot-table .pola-result {
  text-align: center;
}
.pola-slot-table .pola-result span {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}
.pola-slot-table .pola-result .success {
  background-color: var(--progress-green);
}
.pola-slot-table .pola-result .fail {
  background-color: var(--progress-red);
}
.pola-unavailable {
  color: #ff4444;
  font-weight: bold;
}

/* ================================
   RESPONSIVE
================================ */
@media screen and (max-width: 1024px) {
  .container {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
  }
  .game-title {
    font-size: 0.9em;
  }
  .progress-bar {
    height: 16px;
    font-size: 0.8em;
  }
  .progress-bar-text {
    font-size: 0.8em;
  }
  .game-info p {
    font-size: 0.75em;
  }
  .pola-slot {
    font-size: 0.75em;
  }
}
@media screen and (max-width: 768px) {
  .container {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }
  .game-card {
    padding: 8px;
  }
  .game-title {
    font-size: 0.8em;
  }
  .progress-bar {
    height: 14px;
    font-size: 0.75em;
  }
  .progress-bar-text {
    font-size: 0.75em;
  }
  .game-info p {
    font-size: 0.7em;
  }
  .pola-slot {
    font-size: 0.7em;
  }
}

/* ================================
   POPUP
================================ */
.popup {
  display: none;
  position: fixed;
  z-index: 9;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
  justify-content: center;
  align-items: center;
}
.popup-container {
  padding: 20px;
  border: none;
  width: auto%;
}
.popup-content {
  background-color: var(--popup-bg);
  border-radius: 8px;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
  padding: 20px;
  max-width: 400px;
  margin: auto;
  text-align: center;
  color: var(--popup-text);
}
.popup-content h2 {
  font-size: 24px;
  margin-bottom: 20px;
}

/* Input Fields */
.popup-content input[type='number'] {
  width: 100%; /* Buat input memenuhi lebar yang tersedia */
  padding: 10px;
  margin-bottom: 15px; /* Spasi antara input dan tombol */
  border-radius: 5px;
  border: 1px solid #ccc;
  font-size: 16px;
  box-sizing: border-box; /* Pastikan padding tidak mempengaruhi lebar total */
  background-color: --color-bg-card; /* Warna background input */
  transition: border-color 0.3s ease;
}

.popup-content input[type='number']:focus {
  border-color: #4caf4c; /* Warna border saat input aktif */
  outline: none;
}

.popup-content button {
  width: 100%;
  background-color: var(--color-bg-hover);
  color: white;
  padding: 10px;
  border-radius: 5px;
  border: none;
  font-size: 16px;
  cursor: pointer;
}
.popup-content button:hover {
  background-color: var(--progress-green);
}
.close {
  color: #aaa;
  float: right;
  font-size: 28px;
  font-weight: bold;
}
.close:hover,
.close:focus {
  color: black;
  cursor: pointer;
}

/* ================================
   SIMULATION & FILTER
================================ */
.simulasi-button {
  background-color: var(--btn-secondary-bg);
  color: var(--btn-secondary-text);
  padding: 5px 10px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  margin-top: 10px;
  display: inline-block;
}
.simulation-result-container {
  text-align: center;
  padding: 20px;
}
.probability-text {
  font-weight: bold;
  color: var(--progress-green);
}
.winning-amount-text {
  font-weight: bold;
  color: var(--progress-orange);
}
.explanation {
  margin-top: 20px;
  text-align: left;
  color: #555;
  font-size: 0.9em;
  line-height: 1.5;
}
.bar-chart {
  margin-top: 20px;
  width: 100%;
  background-color: #f1f1f1;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  height: 30px;
}
.bar {
  height: 100%;
  color: white;
  text-align: right;
  padding-right: 10px;
  line-height: 30px;
  white-space: nowrap;
  border-radius: 8px 0 0 8px;
  transition: width 0.4s ease-in-out;
  background-color: var(--progress-green);
}

/* Header container + Filter */
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px;
  background-color: var(--color-bg-accent);
  border-radius: 5px;
}
.running-text {
  flex: 1;
  color: var(--color-text-accent);
  font-weight: bold;
  padding-right: 20px;
}
.filter-container {
  position: relative;
  display: inline-block;
  text-align: right;
}
.filter-container select {
  padding: 8px 12px;
  padding-right: 30px;
  font-size: 16px;
  border-radius: 5px;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #333;
  cursor: pointer;
  appearance: none;
}
.filter-container select:hover {
  border-color: var(--progress-green);
}
.filter-container select:focus {
  border-color: var(--progress-green);
  box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
  outline: none;
}
.filter-container::after {
  content: '\25BC';
  font-size: 12px;
  color: #333;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}
