/* ==================== NO TRANSITION CLASS ==================== */
.no-transition, .no-transition * {
  transition: none !important;
}

/* ==================== CSS VARIABLES ==================== */
:root {
  /* Light Mode */
  --bg-body: #f5f7fa;
  --bg-container: #ffffff;
  --bg-card: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-hover: #f0f2f5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --text-tertiary: #718096;
  --border-color: #e2e8f0;
  --primary: #719D6E;
  --primary-dark: #5a7d58;
  --primary-light: #e8f3e7;
  --shadow: 0 2px 8px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark {
  --bg-body: #121212;
  --bg-container: #1e1e2a;
  --bg-card: #2a2a35;
  --bg-secondary: #252530;
  --bg-hover: #353540;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0c0;
  --text-tertiary: #8a8aa0;
  --border-color: #3a3a45;
  --primary: #719D6E;
  --primary-dark: #5a7d58;
  --primary-light: #2a3a2a;
  --shadow: 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-body);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Dark mode transition for all elements */
body, body * {
  transition: background-color 0.2s ease, 
              color 0.2s ease, 
              border-color 0.2s ease, 
              box-shadow 0.2s ease;
}

body.dark * {
  transition: background-color 0.2s ease, 
              color 0.2s ease, 
              border-color 0.2s ease, 
              box-shadow 0.2s ease;
}

/* Mobile Container */
.app-container {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  background: var(--bg-container);
  min-height: 100vh;
  position: relative;
  box-shadow: var(--shadow-md);
}

/* ==================== SPLASH SCREEN ==================== */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #719D6E 0%, #5a7d58 100%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 500px;
  margin: 0 auto;
  transition: opacity 0.5s ease;
}

body.dark .splash-screen {
  background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
}

.splash-content {
  text-align: center;
  color: white;
  padding: 20px;
}

.splash-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
  background: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.dark .splash-icon {
  background: var(--bg-card);
}

.splash-icon img {
  width: 50px;
  height: 50px;
}

.splash-content h2 {
  font-size: clamp(24px, 6vw, 28px);
  font-weight: 700;
  margin-bottom: 8px;
}

.splash-content p {
  font-size: clamp(12px, 3.5vw, 14px);
  margin-bottom: 20px;
  opacity: 0.9;
}

.splash-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ==================== STATUS BAR ==================== */
.status-bar {
  padding: 12px 16px 6px;
  background: var(--bg-container);
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ==================== HEADER ==================== */
.app-header {
  padding: 8px 16px 12px;
  background: var(--bg-container);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon img {
  width: 24px;
  height: 24px;
  filter: brightness(0) invert(1);
}

.logo-text h1 {
  font-size: clamp(16px, 4.5vw, 18px);
  font-weight: 700;
  color: var(--text-primary);
}

.logo-text h1 span { color: var(--primary); }
.logo-text p { font-size: 10px; color: var(--text-tertiary); margin-top: -2px; }

.theme-toggle {
  width: 40px;
  height: 40px;
  background: var(--bg-hover);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s;
  border: none;
}

.theme-toggle:active { transform: scale(0.95); }

/* ==================== TOP TABS ==================== */
.top-tabs {
  display: flex;
  background: var(--bg-container);
  border-bottom: 1px solid var(--border-color);
  padding: 0 8px;
  gap: 4px;
  overflow-x: auto;
}

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

.top-tab {
  flex: 1;
  min-width: 70px;
  padding: 12px 8px;
  background: none;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: clamp(10px, 3vw, 12px);
  font-weight: 500;
  color: var(--text-tertiary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.top-tab i { font-size: clamp(16px, 4.5vw, 18px); }
.top-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.top-tab:active { transform: scale(0.96); }

/* ==================== SECTIONS ==================== */
.section { display: none; padding: 20px 16px 80px; }
.section.active { display: block; animation: fadeIn 0.3s ease; }

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

/* ==================== HERO BANNER ==================== */
.hero-banner {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 20px;
  height: 200px;
}

.hero-video-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.bg-video { width: 100%; height: 100%; object-fit: cover; }

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(113,157,110,0.85) 0%, rgba(90,125,88,0.85) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 40px 20px;
  color: white;
  text-align: center;
}

.hero-content h1 {
  font-size: clamp(20px, 5.5vw, 28px);
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.3;
}

.gradient-text { color: #ffd700; }
.hero-content p { font-size: clamp(12px, 3.5vw, 14px); opacity: 0.9; }

/* ==================== GREETING CARD ==================== */
.greeting-card {
  background: var(--primary-light);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.greeting-text h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.greeting-text p { font-size: 12px; color: var(--text-secondary); }
.greeting-icon {
  width: 50px;
  height: 50px;
  background: white;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: var(--primary);
}

body.dark .greeting-icon {
  background: var(--bg-card);
}

/* ==================== SECTION TITLE ==================== */
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
}
.section-title span { color: var(--primary); }

/* ==================== FEATURES GRID ==================== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.feature-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
}
.feature-card:active { transform: scale(0.97); }

body.dark .feature-card {
  background: var(--bg-card);
}

.feature-icon {
  width: 50px;
  height: 50px;
  background: var(--primary-light);
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.feature-icon i { font-size: 24px; color: var(--primary); }

.feature-card h3 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.feature-card p { font-size: 11px; color: var(--text-tertiary); margin-bottom: 12px; }
.feature-btn { background: none; border: none; color: var(--primary); font-size: 11px; font-weight: 500; cursor: pointer; }

/* ==================== QUOTE CARD ==================== */
.quote-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
}
.quote-icon i { font-size: 28px; color: var(--primary); }
.quote-content p { font-size: 14px; font-style: italic; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.5; }
.quote-source { font-size: 11px; color: var(--primary); font-weight: 500; }

/* ==================== RECOMMENDATION ==================== */
.recommendation-card {
  background: var(--bg-secondary);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}
.recommendation-icon i { font-size: 32px; color: var(--primary); }
.recommendation-content h4 { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.recommendation-content p { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; font-family: 'Cairo', sans-serif; }
.recommendation-btn { background: none; border: none; color: var(--primary); font-size: 11px; font-weight: 500; cursor: pointer; }

/* ==================== ARTICLES ==================== */
.articles-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.article-item {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}
.article-item:active { transform: scale(0.98); }
.article-icon i { font-size: 24px; color: var(--primary); }
.article-content h4 { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 4px; }
.article-content p { font-size: 11px; color: var(--text-tertiary); }

/* ==================== PRAYER SECTION ==================== */
.prayer-section {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 16px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.method-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  background: var(--bg-secondary);
  padding: 10px;
  border-radius: 20px;
}
.method-selector label { font-size: 13px; color: var(--text-secondary); }
.method-selector select {
  flex: 1;
  padding: 8px 12px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-container);
  color: var(--text-primary);
  font-size: 12px;
}
.method-selector button {
  background: var(--primary);
  border: none;
  padding: 8px 16px;
  border-radius: 20px;
  color: white;
  font-size: 12px;
  cursor: pointer;
}

.current-time-info {
  background: var(--bg-secondary);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
  text-align: center;
}
.time-display { font-size: 20px; font-weight: 600; color: var(--text-primary); margin-bottom: 6px; }
.location-info { font-size: 12px; color: var(--text-tertiary); margin-bottom: 4px; }
.next-prayer-info { font-size: 12px; color: var(--primary); font-weight: 500; }

.prayer-times {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.prayer-item {
  text-align: center;
  padding: 10px 4px;
  background: var(--bg-secondary);
  border-radius: 12px;
}
.prayer-name {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.prayer-time { font-size: 11px; font-weight: 600; color: var(--text-primary); }

.countdown-container {
  text-align: center;
  padding: 12px;
  background: var(--primary-light);
  border-radius: 12px;
  margin-bottom: 12px;
}
.countdown-label { font-size: 12px; color: var(--text-secondary); margin-bottom: 6px; }
.countdown-timer { font-size: 20px; font-weight: 700; color: var(--primary); }

.adzan-controls { display: flex; justify-content: space-between; align-items: center; }
.test-adzan-btn {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-primary);
  cursor: pointer;
}

/* ==================== STATS ==================== */
.stats-section {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.stat-item {
  text-align: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 12px;
}
.stat-number { font-size: 18px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 10px; color: var(--text-tertiary); margin-top: 4px; }

/* ==================== IFRAME ==================== */
.iframe-wrapper {
  position: relative;
  width: 100%;
  height: calc(100vh - 180px);
  min-height: 500px;
}
.content-frame { 
  width: 100%; 
  height: 100%; 
  border: none; 
  border-radius: 12px;
  background: var(--bg-container);
}
.iframe-loader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-container);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  transition: opacity 0.3s ease;
}
.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ==================== ADZAN ALERT STYLES ==================== */
.adzan-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.adzan-alert-overlay.closing {
  animation: fadeOut 0.3s ease forwards;
}

.adzan-alert-modal {
  background: linear-gradient(135deg, #1a472a 0%, #0d2818 100%);
  border-radius: 32px;
  max-width: 90%;
  width: 400px;
  padding: 0;
  overflow: hidden;
  animation: slideUp 0.4s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark .adzan-alert-modal {
  background: linear-gradient(135deg, #0d2818 0%, #061207 100%);
}

.adzan-alert-icon {
  background: linear-gradient(135deg, #719D6E, #5a7d58);
  padding: 25px;
  text-align: center;
}

.adzan-alert-icon i {
  font-size: 60px;
  color: white;
  filter: drop-shadow(2px 4px 8px rgba(0,0,0,0.3));
}

.adzan-alert-content {
  padding: 25px;
  text-align: center;
}

.adzan-alert-content h2 {
  color: #ffd700;
  font-size: 24px;
  margin-bottom: 20px;
  font-weight: 700;
}

.adzan-alert-marquee {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 15px;
  margin: 15px 0;
  direction: rtl;
  font-family: 'Cairo', 'Amiri', serif;
  font-size: 20px;
  font-weight: 600;
  color: #ffd700;
  line-height: 2;
}

.adzan-alert-marquee p {
  margin: 5px 0;
  animation: fadeInOut 1s ease;
}

.adzan-message {
  color: white;
  font-size: 16px;
  line-height: 1.6;
  margin: 15px 0;
}

.adzan-alert-buttons {
  margin-top: 20px;
}

.adzan-alert-close {
  background: linear-gradient(135deg, #ffd700, #ffed4a);
  border: none;
  padding: 12px 30px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  color: #1a472a;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.adzan-alert-close:hover,
.adzan-alert-close:active {
  transform: scale(0.98);
}

/* ==================== LOCATION NOTIFICATION ==================== */
.location-notification {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  color: white;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 9999;
  transform: translateY(100px);
  transition: transform 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.location-notification.show {
  transform: translateY(0);
}

.location-notification i {
  margin-right: 8px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

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

@keyframes fadeInOut {
  0% { opacity: 0; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1); }
  100% { opacity: 1; transform: scale(1); }
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: var(--primary);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr 1fr; }
  .prayer-times { gap: 6px; }
  .prayer-item { padding: 8px 4px; }
  .stats-section { gap: 8px; }
  .hero-banner { height: 180px; }
  .hero-content { padding: 30px 16px; }
  .section { padding: 16px 12px 80px; }
  .iframe-wrapper { height: calc(100vh - 160px); }
  .adzan-alert-modal { width: 90%; }
  .adzan-alert-content h2 { font-size: 20px; }
  .adzan-alert-marquee { font-size: 18px; }
  .adzan-message { font-size: 14px; }
}

@media (max-width: 380px) {
  .prayer-name span { font-size: 9px; }
  .prayer-time { font-size: 10px; }
  .top-tab { min-width: 60px; font-size: 9px; }
  .top-tab i { font-size: 14px; }
  .feature-card h3 { font-size: 13px; }
  .feature-card p { font-size: 10px; }
  .greeting-card { padding: 12px; }
  .greeting-icon { width: 40px; height: 40px; font-size: 22px; }
}

@media (min-width: 768px) {
  .app-container {
    max-width: 500px;
    border-radius: 20px;
    margin: 20px auto;
    overflow: hidden;
  }
  body {
    padding: 20px;
    background: var(--bg-body);
  }
}

/* ==================== UTILITIES ==================== */
.tap-effect:active { 
  transform: scale(0.96); 
  transition: transform 0.1s ease;
}

/* Safe Area untuk iOS */
@supports (padding: max(0px)) {
  .app-container {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
  .status-bar {
    padding-top: max(12px, env(safe-area-inset-top));
  }
}