/* ==========================================================================
   Base App Styles, Theming, Typography & Layout
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Scheherazade+New:wght@400;700&family=Tajawal:wght@400;500;700;800&family=Cairo:wght@400;600;700&display=swap');

:root {
  /* Emerald & Gold Theme (Dark by default) */
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-card: #1e293b;
  --bg-card-hover: #2d3748;
  --bg-accent: #064e3b;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-gold: #fbbf24;
  --text-emerald: #34d399;

  --border-subtle: #334155;
  --border-gold: #d97706;
  --border-emerald: #059669;

  --accent-gold: #f59e0b;
  --accent-gold-gradient: linear-gradient(135deg, #f59e0b, #d97706);
  --accent-emerald-gradient: linear-gradient(135deg, #10b981, #047857);
  --accent-ruby-gradient: linear-gradient(135deg, #ef4444, #b91c1c);
  --accent-blue-gradient: linear-gradient(135deg, #3b82f6, #1d4ed8);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.25);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.2);

  --font-arabic-quran: 'Amiri', 'Scheherazade New', serif;
  --font-arabic-ui: 'Tajawal', 'Cairo', sans-serif;
  --bottom-bar-height: 68px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-accent: #d1fae5;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-gold: #b45309;
  --text-emerald: #047857;

  --border-subtle: #e2e8f0;
  --border-gold: #f59e0b;
  --border-emerald: #10b981;

  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(16, 185, 129, 0.1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-arabic-ui);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  direction: rtl;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--bottom-bar-height);
  overflow-x: hidden;
}

/* Top App Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(17, 24, 39, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 18px;
}

[data-theme="light"] .app-header {
  background-color: rgba(255, 255, 255, 0.92);
}

.header-container {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--accent-emerald-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-arabic-quran);
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: var(--shadow-glow);
}

.brand-info h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.brand-info span {
  font-size: 0.75rem;
  color: var(--text-gold);
  font-weight: 500;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background-color: var(--bg-card-hover);
  transform: translateY(-1px);
}

/* Main Content Container */
.app-main {
  flex: 1;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
}

/* Tab Panels */
.tab-view-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-view-panel.active {
  display: block;
}

/* Panel Headers */
.section-hero {
  margin-bottom: 24px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  background: var(--bg-accent);
  color: var(--text-emerald);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 8px;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 580px;
  margin: 0 auto;
}

/* Mobile Bottom Navigation Bar */
.bottom-nav-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-bar-height);
  background-color: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 4px 8px;
  z-index: 1000;
}

[data-theme="light"] .bottom-nav-bar {
  background-color: rgba(255, 255, 255, 0.95);
}

.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-arabic-ui);
  cursor: pointer;
  padding: 6px 2px;
  border-radius: 8px;
  transition: all 0.2s ease;
  min-width: 0;
}

.nav-icon {
  font-size: 1.35rem;
  line-height: 1;
  transition: transform 0.2s;
}

.nav-label {
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-nav-item.active {
  color: var(--text-emerald);
}

.bottom-nav-item.active .nav-icon {
  transform: scale(1.15);
}

/* Footer Section */
.app-footer {
  margin-top: 40px;
  padding: 24px 16px 20px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-secondary);
  text-align: center;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.footer-credits {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.footer-version {
  font-size: 0.75rem;
  color: var(--text-gold);
  font-family: monospace;
  direction: ltr;
  margin-top: 4px;
}

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

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

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

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

.animate-slide-up {
  animation: slideUp 0.3s ease forwards;
}

.animate-pop {
  animation: pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.hidden {
  display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
