*, *::before, *::after {
  box-sizing: border-box;
}

: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-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);
}

/* ZAKAT */
.zakat-card {
  width: 100%;
  max-width: 550px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 20px;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.1);
  border: 1px solid var(--gold-light);
  max-width: 550px;
  margin: 0 auto;
  animation: fadeUp 0.8s ease;
}

.zakat-card h2 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--green);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.8rem;
  border-bottom: 2px solid var(--gold-light);
  padding-bottom: 10px;
}

.form-input {
  margin-bottom: 1.8rem;
  position: relative;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.6rem;
  color: var(--text-dark);
  font-size: 0.95rem;
}

input, select {
  width: 100%;
  padding: 1rem;
  border: 2px solid #eee;
  border-radius: 12px;
  font-size: 1rem;
  font-family: 'Lora', serif;
  transition: all 0.3s ease;
  background-color: #fcfcfc;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  background-color: white;
  box-shadow: 0 0 10px rgba(201, 150, 58, 0.15);
}

.zakat-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
  flex-direction: column;
}

button#btn-hitung {
  width: 50%;
  flex: 2;
  padding: 1rem;
  background: linear-gradient(135deg, var(--green), #24523a);
  color: var(--gold-light);
  border: none;
  border-radius: 12px;
  font-family: 'Cinzel Decorative', serif;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(26, 61, 43, 0.2);
  transition: all 0.3s ease;
}

#btn-reset-zakat {
  width: 49%;
  flex: 1;
  padding: 1rem;
  background: #eeb53a;
  color: #000000;
  border: none;
  border-radius: 12px;
  font-family: 'Cinzel Decorative', serif;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

#btn-reset-zakat:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

button#btn-hitung:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

button#btn-hitung:active {
  transform: scale(0.98);
}

.result-box {
  margin-top: 2.5rem;
  padding: 2rem;
  background: linear-gradient(to bottom right, #fdfbf7, #f0f7f4);
  border: none;
  border-left: 5px solid var(--gold);
  border-radius: 16px;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.02);
  animation: bounceIn 0.6s ease;
}

.result-box h3 {
  font-family: 'Cinzel Decorative', serif;
  font-size: 1.1rem;
  color: var(--green);
  margin-bottom: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.result {
  display: flex;
  justify-content: space-between;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: var(--text-mid);
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}

.result strong {
  color: var(--text-dark);
}

.zakat-amount {
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: var(--green);
  border-radius: 12px;
  color: var(--gold-light) !important;
  border: none;
}

.zakat-amount span {
  font-weight: bold;
}

.zakat-amount strong {
  color: white;
  font-size: 1.4rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@media (max-width: 600px) {
  .zakat-card {
    margin: 10px;
  }

  #btn-hitung {
    padding: 1rem;
    font-size: 1rem;
  }

  #res-zakat {
    font-size: 1.2rem;
  }
}

@media (max-width: 600px) {
  .zakat-card {
    margin: 10px;
  }

  #btn-hitung {
    padding: 1rem;
    font-size: 1rem;
  }

  #res-zakat {
    font-size: 1.2rem;
  }
}

/* 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;
}