@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Cinzel+Decorative:wght@700&display=swap');

:root {
  --black-luxury: #070a09;
  --emerald-deep: #051a11;
  --emerald-bright: #0c422c;
  --gold-primary: #d4af37;
  --gold-light: #ffe699;
  --gold-dark: #a67c1e;
  --glass-bg: rgba(7, 26, 17, 0.45);
  --glass-border: rgba(212, 175, 55, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
  --font-arabic: 'Cinzel Decorative', 'Times New Roman', serif;
  --font-modern: 'Outfit', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

body, html {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--black-luxury);
  font-family: var(--font-modern);
  color: #ffffff;
}

/* Background System */
.bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
}

.bg-image {
  width: 110%;
  height: 110%;
  object-fit: cover;
  position: absolute;
  top: -5%;
  left: -5%;
  transition: transform 0.1s ease-out; /* Parallax movement */
}

.bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(5, 26, 17, 0.75) 0%,
    rgba(7, 10, 9, 0.85) 60%,
    rgba(0, 0, 0, 0.95) 100%
  );
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 2;
}

/* Canvas overlay for sparkles/particles */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}

/* App Wrapper: Full screen click-catcher */
.app-wrapper {
  position: relative;
  width: 100%;
  height: 100dvh;
  z-index: 4;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 2.5rem 1.5rem 3rem 1.5rem;
  cursor: pointer;
}

/* Header/Branding */
.header {
  width: 100%;
  text-align: center;
  pointer-events: none; /* Let clicks pass to the body */
  animation: float-slow 4s ease-in-out infinite;
}

.branding-text {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--gold-dark) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(212, 175, 55, 0.3));
}

.branding-logo {
  font-family: var(--font-arabic);
  font-size: 1.8rem;
  margin-top: 0.5rem;
  color: var(--gold-primary);
  text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
  letter-spacing: 2px;
}

/* Counter Container */
.counter-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  z-index: 5;
}

.counter-value {
  font-size: 7.5rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: linear-gradient(to bottom, #ffffff 30%, #e2e8f0 70%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 20px rgba(0,0,0,0.6)) drop-shadow(0 0 10px rgba(212, 175, 55, 0.25));
  transition: transform 0.08s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.counter-value.bump {
  transform: scale(1.15);
}

.counter-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  font-weight: 600;
}

.global-counter {
  margin-top: 1.5rem;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.8rem;
  color: var(--gold-light);
  letter-spacing: 1px;
}

/* Bottom Controls */
.footer-controls {
  width: 100%;
  max-width: 450px;
  display: flex;
  gap: 1rem;
  z-index: 10; /* Make sure buttons can be clicked */
  pointer-events: auto; /* Stop passing clicks through when clicking buttons */
}

.btn {
  flex: 1;
  padding: 1rem 1.5rem;
  border-radius: 16px;
  border: none;
  font-family: var(--font-modern);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-setoran {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  color: #071a11;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn-setoran:hover, .btn-setoran:focus {
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.btn-reset {
  background: rgba(184, 15, 15, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.4);
  color: #fca5a5;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-reset:hover, .btn-reset:focus {
  background: rgba(184, 15, 15, 0.3);
  border-color: rgba(220, 38, 38, 0.8);
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.3);
  transform: translateY(-2px);
}

/* Dialog Glassmorphism (Reset Confirmation) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 90%;
  max-width: 400px;
  background: rgba(10, 25, 18, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  padding: 2rem;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-title {
  font-size: 1.4rem;
  color: var(--gold-primary);
  margin-bottom: 1rem;
  font-weight: 700;
}

.modal-text {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 2rem;
  line-height: 1.5;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
}

.modal-btn {
  flex: 1;
  padding: 0.85rem;
  border-radius: 12px;
  border: none;
  font-family: var(--font-modern);
  font-weight: 700;
  cursor: pointer;
  font-size: 0.9rem;
}

.modal-btn-confirm {
  background: #dc2626;
  color: white;
}

.modal-btn-cancel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: white;
}

/* Animations */
@keyframes float-slow {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

/* Loading Screen */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--black-luxury);
  z-index: 999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-logo {
  width: 120px;
  height: 120px;
  animation: pulse-gold 2.5s infinite ease-in-out;
}

.loader-text {
  margin-top: 1.5rem;
  font-size: 1rem;
  letter-spacing: 4px;
  color: var(--gold-primary);
  font-weight: 600;
  text-transform: uppercase;
}

@keyframes pulse-gold {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.4));
  }
  50% {
    transform: scale(1.08);
    filter: drop-shadow(0 0 25px rgba(212, 175, 55, 0.7));
  }
}
