:root {
  --cream: #faf6ef;
  --gold: #c9963a;
  --gold-light: #e8c16e;
  --gold-dark: #8a6420;
  --green: #1a3d2b;
  --green-mid: #2d6148;
  --green-light: #4a8f6a;
  --white: #fffdf8;
  --text-dark: #1c1208;
  --text-mid: #3d2f10;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Lora', Georgia, serif;
  background-color: var(--cream);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(201,150,58,0.07) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(26,61,43,0.08) 0%, transparent 55%),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9963a' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* HEADER */
header {
  position: relative;
  background: linear-gradient(-45deg, #0f2318, var(--green), #1a3d2b, #0a1a11);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  padding: 70px 20px 80px;
  text-align: center;
  overflow: hidden;
  z-index: 1;
  border-bottom: 3px solid var(--gold);
}

header::before {
  content: '';
  position: absolute;
  inset: 0;
  mask-image: radial-gradient(circle, black, transparent 80%);
}

.header-ornament {
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  color: var(--gold-light);
  filter: drop-shadow(0 0 15px rgba(232, 193, 110, 0.4));
  margin-bottom: 16px;
  animation: fadeDown 0.8s ease forwards 0.2s;
  opacity: 0;
  display: block;
}

header h1 {
  font-family: 'Cinzel Decorative', serif;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  background: linear-gradient(to bottom, var(--gold-light), var(--gold), var(--gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.1em;
  font-weight: 700;
  animation: fadeDown 0.8s ease forwards 0.4s;
  opacity: 0;
}

/* NAVIGATION */
.nav-tabs {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-start;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background: rgba(26, 61, 43, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--gold-dark);
}

.nav-tabs a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 25px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-family: 'Cinzel Decorative', serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tabs a, .nav-item-dropdown {
  flex: 0 0 auto;
  padding: 15px 20px;
}

.nav-tabs a i { color: var(--gold-light); }

.nav-tabs a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

/* ZIKIR */
.zikir-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 20px;
}

.counter-container {
  background: rgba(255, 253, 248, 0.9);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 30px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.1);
  text-align: center;
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--gold-light);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.target-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.btn-target {
  padding: 6px 15px;
  border: 1px solid var(--gold-light);
  background: white;
  color: var(--text-mid);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.btn-target.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
  transform: scale(1.05);
}

.counter-display {
  margin: 15px 0;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#zikir-count {
  font-size: 6.5rem;
  font-weight: bold;
  color: var(--green);
  font-family: 'Cinzel Decorative', serif;
  text-shadow: 2px 2px 0px var(--gold-light);
  transition: transform 0.1s ease;
}

.target-label {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 10px;
}

.zikir-controls {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.btn-zikir.tambah {
  width: 100%;
  padding: 18px;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--green), var(--green-mid));
  color: white;
  border: none;
  border-radius: 15px;
  font-family: 'Cinzel Decorative', serif;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 10px 20px rgba(26, 61, 43, 0.2);
  transition: all 0.3s ease;
}

.btn-zikir.tambah:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 25px rgba(26, 61, 43, 0.3);
}

.btn-zikir.tambah:active {
  transform: scale(0.95);
}

.btn-zikir.reset {
  background: transparent;
  color: #888;
  font-size: 0.9rem;
  padding: 5px;
  text-decoration: underline;
  border: none;
  cursor: pointer;
}

.btn-zikir.reset:hover {
  color: var(--text-dark);
}

.notification {
  margin-top: 15px;
  min-height: 40px;
}

.badge-notif {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--green);
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.85rem;
  animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* FOOTER */
footer {
  background: #0a1a11;
  padding: 25px 20px;
  color: #fff;
  text-align: center;
}

footer p {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold-light);
  letter-spacing: 2px;
  font-size: 0.9rem;
}

@media (max-width: 480px) {
    .zikir-container {
        padding: 25px 15px; /* Kurangi padding agar lebih luas */
        margin: 10px;
    }

    .count-display {
        font-size: 5rem; /* Ukuran angka sedikit diperkecil agar pas */
    }

    .zikir-target {
        font-size: 1rem;
    }

    .zikir-controls {
        flex-direction: column; /* Tombol jadi atas-bawah */
        gap: 12px;
    }

    .btn-zikir {
        width: 100%; /* Tombol lebar penuh */
        padding: 15px;
        justify-content: center;
    }

    .btn-main-zikir {
        width: 180px; /* Ukuran tombol utama disesuaikan */
        height: 180px;
    }
}