:root {
  --bg-color: #0f172a;
  --bg-gradient: radial-gradient(circle at top center, #1e293b, #0f172a);
  --primary: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.4);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --font-family: system-ui, -apple-system, sans-serif;
  --font-arabic: 'Amiri', serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  min-height: 100dvh; /* Dynamic viewport height for mobile */
  overflow: hidden; /* Prevent scroll on mobile if possible */
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Background ambient glow */
.background-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 60%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin-bottom: 20px;
}

.logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(to right, #fff, #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.5px;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.icon-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Content Wrapper */
.content-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 40px;
}

/* Glass Panel */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

/* Stats Card */
.stats-card {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 16px;
  margin: 0 10px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: help; /* Hint that interaction is possible */
  user-select: none;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
}

.divider {
  width: 1px;
  height: 40px;
  background: var(--glass-border);
}

/* Main Action */
.main-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.zikir-display {
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
}

.arabic-text {
  font-family: var(--font-arabic);
  font-size: 2.5rem;
  line-height: 1.4;
  color: var(--primary);
  text-shadow: 0 0 20px var(--primary-glow);
  font-weight: 700;
}

#dzikir-text {
  font-size: 1.5rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Button */
#zikir-btn {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(145deg, #10b981, #059669);
  cursor: pointer;
  box-shadow: 0 10px 25px -5px var(--primary-glow),
              0 8px 10px -6px rgba(0, 0, 0, 0.1),
              inset 0 2px 4px rgba(255, 255, 255, 0.2);
  transition: transform 0.1s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s ease;
  outline: none;
}

#zikir-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 30px -10px var(--primary-glow),
              0 8px 10px -6px rgba(0, 0, 0, 0.1),
              inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

#zikir-btn:active {
  transform: scale(0.95);
  box-shadow: 0 5px 15px -5px var(--primary-glow);
}

#zikir-btn:focus-visible {
  box-shadow: 0 0 0 4px var(--bg-color), 0 0 0 6px var(--primary);
}

.btn-inner {
  font-size: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  pointer-events: none; /* Let button handle click */
}

/* Hint Text */
.hint-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* Footer */
.footer {
  text-align: center;
  padding: 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: auto;
}

.footer a {
  color: var(--text-main);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-muted);
}

/* Animations */
.sparkle {
  position: fixed;
  pointer-events: none;
  font-size: 1.5rem;
  animation: floatUp 0.8s ease-out forwards;
  z-index: 100;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0) scale(1) rotate(0deg); }
  100% { opacity: 0; transform: translateY(-50px) scale(1.5) rotate(20deg); }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  #zikir-btn { transition: none; }
  .sparkle { display: none; }
  .fade-in { animation: none; }
  .background-glow { display: none; }
}

/* Mobile Adjustments */
@media (max-height: 600px) {
  .content-wrapper { gap: 20px; }
  #zikir-btn { width: 120px; height: 120px; }
  .btn-inner { font-size: 3rem; }
  #dzikir-text { font-size: 1.5rem; }
}
