/* Global Fonts & Variables */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400;1,700&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

@font-face {
  font-family: 'KFGQPC Uthman Taha Naskh';
  src: url('https://cdn.jsdelivr.net/gh/fawazahmed0/quran-api@1/fonts/taha-naskh.woff2') format('woff2'),
       url('https://cdn.jsdelivr.net/gh/fawazahmed0/quran-api@1/fonts/taha-naskh.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-arabic: 'KFGQPC Uthman Taha Naskh', 'Amiri', serif;
  --font-sans: 'Plus Jakarta Sans', sans-serif;
  
  /* Info Kajian Sulawesi Style (Default Dark Theme) */
  --bg-primary: #0a110d;
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-arabic: #f3f4f6;
  --color-brand: #d4b872; /* Gold */
  --color-brand-hover: #bda25f;
  --color-brand-light: rgba(212, 184, 114, 0.1);
  --color-border: rgba(255, 255, 255, 0.08);
  --color-counter-bg: rgba(212, 184, 114, 0.08);
  --color-counter-text: #d4b872;
  --color-success: #34d399; /* Emerald 400 */
  --color-success-bg: rgba(52, 211, 153, 0.1);
  --color-shadow: rgba(0, 0, 0, 0.4);
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --gradient-radial-1: rgba(26, 77, 46, 0.25);
  --gradient-radial-2: rgba(212, 184, 114, 0.08);
}

[data-theme="light"] {
  /* Light Theme */
  --bg-primary: #f4f6f4;
  --text-primary: #101c15;
  --text-secondary: #2e3c33;
  --text-arabic: #101c15;
  --color-brand: #c29d38; /* Darker Gold */
  --color-brand-hover: #a3812b;
  --color-brand-light: rgba(194, 157, 56, 0.08);
  --color-border: rgba(16, 28, 21, 0.08);
  --color-counter-bg: rgba(194, 157, 56, 0.08);
  --color-counter-text: #c29d38;
  --color-success: #059669;
  --color-success-bg: rgba(5, 150, 105, 0.08);
  --color-shadow: rgba(0, 0, 0, 0.05);
  
  /* Glassmorphism in Light Mode */
  --glass-bg: rgba(255, 255, 255, 0.96);
  --glass-border: rgba(16, 28, 21, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(16, 28, 21, 0.05);
  --gradient-radial-1: rgba(5, 150, 105, 0.08);
  --gradient-radial-2: rgba(194, 157, 56, 0.05);
}

[data-theme="sepia"] {
  /* Sepia Theme */
  --bg-primary: #f4ecd8;
  --text-primary: #5c4326;
  --text-secondary: #4d3b25;
  --text-arabic: #43301a;
  --color-brand: #a85507;
  --color-brand-hover: #854202;
  --color-brand-light: rgba(168, 85, 7, 0.08);
  --color-border: rgba(92, 67, 38, 0.1);
  --color-counter-bg: rgba(168, 85, 7, 0.08);
  --color-counter-text: #a85507;
  --color-success: #b45309;
  --color-success-bg: rgba(180, 83, 9, 0.08);
  --color-shadow: rgba(92, 67, 38, 0.1);
  
  /* Glassmorphism in Sepia Mode */
  --glass-bg: rgba(253, 246, 227, 0.96);
  --glass-border: rgba(92, 67, 38, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(92, 67, 38, 0.08);
  --gradient-radial-1: rgba(168, 85, 7, 0.05);
  --gradient-radial-2: rgba(92, 67, 38, 0.03);
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  background-image: 
      radial-gradient(circle at 15% 30%, var(--gradient-radial-1), transparent 45%),
      radial-gradient(circle at 85% 70%, var(--gradient-radial-2), transparent 45%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  line-height: 1.6;
  padding: 16px;
  /* Extra bottom padding to clear floating elements */
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
}

/* App Container */
#app {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
}

/* Glassmorphism Utility */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* Header Styles */
header {
  padding: 14px 20px;
  border-radius: 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: env(safe-area-inset-top, 0px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.app-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-domain {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-icon {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.btn-icon:hover, .btn-icon:focus {
  background-color: var(--color-brand-light);
  color: var(--color-brand);
  border-color: var(--color-brand);
  outline: none;
}

/* Main View Body */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Home View Screen */
.home-screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fadeIn 0.3s ease;
}

.hero {
  text-align: center;
  padding: 28px 20px;
  border-radius: 24px;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.hero-img {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  border: 1px solid var(--color-brand);
  background-color: var(--color-brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: var(--glass-shadow);
}

.hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-brand);
  line-height: 1.3;
}

.hero p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-brand);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-left: 4px;
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.menu-card {
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.menu-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-brand);
}

.menu-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--color-brand-light);
  color: var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border: 1px solid rgba(212, 184, 114, 0.2);
}

.menu-text-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-text-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.chevron {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Home Reference Link */
.home-reference {
  margin-top: 16px;
  text-align: left;
  padding: 0 6px;
}

.home-reference-link {
  color: var(--text-secondary);
  font-size: 0.76rem;
  line-height: 1.55;
  text-decoration: none;
  display: block;
  text-align: left;
  opacity: 0.85;
  transition: color 0.2s ease, opacity 0.2s ease;
}

.home-ref-title {
  font-weight: 600;
  margin-bottom: 2px;
}

.home-reference-link:hover,
.home-reference-link:active {
  color: var(--color-brand);
  opacity: 1;
}

.home-reference-link:hover div,
.home-reference-link:active div {
  text-decoration: underline;
}

/* Compliance/Footer Info Section */
.home-compliance {
  border-radius: 20px;
  padding: 20px;
  text-align: center;
  margin-top: 10px;
}

.home-compliance h2 {
  font-size: 0.85rem;
  color: var(--color-brand);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
}

.home-compliance p {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.6;
}

.home-compliance-links {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.home-compliance-links a {
  color: var(--color-brand);
  font-size: 0.75rem;
  text-decoration: none;
  font-weight: 700;
}

/* Muqoddimah View */
.muqoddimah-screen {
  animation: fadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.muqoddimah-card {
  border-radius: 20px;
  padding: 20px;
}

.muqoddimah-content {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.muqoddimah-para {
  text-align: justify;
}

/* Reader View (Dhikr slides) */
.reader-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  animation: fadeIn 0.3s ease;
}

.progress-bar-container {
  width: 100%;
  height: 4px;
  background-color: var(--color-border);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-brand), var(--color-brand-hover));
  width: 0%;
  transition: width 0.3s ease;
}

.slide-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 20px;
}

.dhikr-card {
  border-radius: 24px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dhikr-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dhikr-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-brand);
  border-left: 3px solid var(--color-brand);
  padding-left: 8px;
}

/* Arabic Text styling */
.arabic-box {
  direction: rtl;
  font-family: var(--font-arabic);
  font-size: 1.8rem; /* default */
  line-height: 2.2;
  text-align: right;
  color: var(--text-arabic);
  word-spacing: 0.05em;
  padding: 16px 0;
  border-bottom: 1px dashed var(--color-border);
}

/* Latin/Transliteration styling */
.latin-box {
  font-style: italic;
  color: var(--color-brand);
  font-size: 0.92rem;
  line-height: 1.6;
  padding-left: 8px;
  border-left: 2px solid rgba(212, 184, 114, 0.4);
}

/* Translation styling */
.translation-box {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-align: justify;
}

/* Benefit / Hadith references */
.footnote-box {
  margin-top: 10px;
  border-radius: 16px;
  padding: 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footnote-label {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  color: var(--color-brand);
  letter-spacing: 0.05em;
}

/* Floating FAB Counter Button */
.counter-fab {
  position: fixed;
  bottom: calc(100px + env(safe-area-inset-bottom, 16px));
  right: 20px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background-color: var(--color-counter-bg);
  border: none;
  color: var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 120;
  box-shadow: 0 8px 24px var(--color-shadow);
  transition: transform 0.1s, background-color 0.2s, color 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

.counter-fab:active {
  transform: scale(0.95);
}

.counter-value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1;
}

/* SVG Progress circle around the FAB */
.fab-progress-svg {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 80px;
  height: 80px;
  transform: rotate(-90deg);
  pointer-events: none;
}

.fab-progress-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 3;
}

[data-theme="light"] .fab-progress-bg {
  stroke: rgba(0, 0, 0, 0.08);
}

.fab-progress-circle {
  fill: none;
  stroke: var(--color-brand);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 232.48;
  stroke-dashoffset: 232.48;
  transition: stroke-dashoffset 0.05s linear;
}

.counter-fab.completed .fab-progress-circle {
  stroke: var(--color-success);
}

.counter-fab.completed {
  background-color: var(--color-success-bg);
  color: var(--color-success);
  animation: pulseSuccess 0.5s ease-out;
}

/* Floating Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom, 16px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 450px;
  display: flex;
  justify-content: space-around;
  padding: 10px 6px;
  border-radius: 30px;
  z-index: 100;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  will-change: transform, opacity;
}

.bottom-nav.nav-hidden {
  transform: translate(-50%, calc(100% + 40px));
  opacity: 0;
  pointer-events: none;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.65rem;
  flex: 1;
  padding: 4px 0;
  cursor: pointer;
  background: none;
  border: none;
}

.nav-item.active {
  color: var(--color-brand);
  font-weight: 700;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* Modals & Slide Drawers */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.6);
  z-index: 150;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
}

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

.modal-content {
  max-width: 500px;
  width: 100%;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  padding: 24px 20px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

/* Centered Modal Overlay */
.modal-overlay.modal-center {
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* Completion & Alert Card (Cool Popup) */
.completion-card {
  max-width: 380px;
  width: calc(100% - 32px);
  border-radius: 28px;
  padding: 30px 22px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--color-brand);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(212, 184, 114, 0.2);
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.modal-overlay.active .completion-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Background subtle ambient glow */
.completion-glow {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--color-brand-light) 0%, transparent 70%);
  filter: blur(25px);
  pointer-events: none;
  z-index: 0;
}

/* Icon Box with pulsing aura */
.completion-icon-box {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212, 184, 114, 0.2), rgba(52, 211, 153, 0.15));
  border: 2px solid var(--color-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand);
  position: relative;
  z-index: 1;
  animation: pulseAura 2.2s infinite ease-in-out;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

@keyframes pulseAura {
  0% {
    box-shadow: 0 0 0 0 rgba(212, 184, 114, 0.4);
  }
  70% {
    box-shadow: 0 0 0 16px rgba(212, 184, 114, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(212, 184, 114, 0);
  }
}

.completion-check-icon {
  animation: checkmarkPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* Badge Tag */
.completion-badge-tag {
  font-size: 0.68rem;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--color-brand);
  background: var(--color-brand-light);
  border: 1px solid rgba(212, 184, 114, 0.25);
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  z-index: 1;
  margin-top: 2px;
}

/* Arabic Text */
.completion-arabic-text {
  font-family: var(--font-arabic);
  font-size: 1.6rem;
  line-height: 1.4;
  color: var(--color-brand);
  direction: rtl;
  z-index: 1;
  margin-top: 2px;
}

/* Title & Desc */
.completion-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: -4px;
  z-index: 1;
}

.completion-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  z-index: 1;
  padding: 0 6px;
}

/* Action Button */
.completion-action-btn {
  width: 100%;
  margin-top: 8px;
  padding: 13px 20px;
  border-radius: 16px;
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 1;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, filter 0.2s;
}

.completion-action-btn:hover {
  filter: brightness(1.08);
}

.completion-action-btn:active {
  transform: scale(0.97);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-brand);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Settings Options */
.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0;
}

.setting-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.theme-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.theme-option {
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--color-border);
  cursor: pointer;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.03);
}

.theme-option.active {
  border-color: var(--color-brand);
  background-color: var(--color-brand-light);
  color: var(--color-brand);
}

.range-slider {
  width: 100%;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-brand);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-container {
  display: flex !important;
  flex-direction: row !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 12px 0 !important;
  border-bottom: 1px solid var(--color-border);
}

.toggle-container:last-of-type {
  border-bottom: none !important;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  transition: .3s;
  border-radius: 22px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--color-brand);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

/* Slide Nav / Footer Buttons */
.nav-buttons {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.btn {
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background-color: var(--color-brand-light);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-brand), var(--color-brand-hover));
  color: #0a110d;
  font-weight: 700;
  flex: 1;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseSuccess {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

/* PWA Install Banner */
#install-banner-overlay {
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

#install-banner {
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Prayer Widget Dashboard */
.prayer-widget {
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 20px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pw-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pw-clock-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pw-clock {
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pw-countdown {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pw-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  border-top: 1px solid var(--color-border);
  padding-top: 14px;
}

.pw-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.pw-icon {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, color 0.2s;
}

.pw-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.pw-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.pw-time {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Active Highlighted Prayer Item */
.pw-item.active .pw-name {
  color: var(--color-brand);
  font-weight: 700;
}

.pw-item.active .pw-time {
  color: var(--color-brand);
  font-weight: 800;
}

.pw-item.active .pw-icon {
  color: var(--color-brand);
  transform: scale(1.1);
}

.pw-item.active .pw-icon svg {
  fill: var(--color-brand-light);
}

/* Dropdown styling */
.pw-city-select {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  outline: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
}

.pw-city-select option {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

/* Responsive Desktop Scaling */
@media (min-width: 768px) {
  #app {
    max-width: 720px;
  }
  .bottom-nav {
    max-width: 680px;
  }
  .modal-content {
    max-width: 720px;
    border-radius: 24px !important;
    margin-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }
  .counter-fab {
    right: calc(50% - 360px + 20px);
  }
}

@media (min-width: 1024px) {
  #app {
    max-width: 850px;
  }
  .bottom-nav {
    max-width: 810px;
  }
  .modal-content {
    max-width: 850px;
    border-radius: 24px !important;
    margin-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  }
  .counter-fab {
    right: calc(50% - 425px + 20px);
  }
}
