* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html,
body,
body * {
  font-family: "Cairo", sans-serif;
}
html {
  scroll-behavior: smooth;
}

:root {
  --primary-color: #1b5e20;
  --primary-light: #2e7d32;
  --primary-rgb: 27, 94, 32;
  --secondary-color: #d4820a;
  --accent-color: #f9d423;
  --bg-color: #f8fbfa;
  --text-color: #1a1a1a;
  --text-secondary: #666;
  --card-bg: rgba(255, 255, 255, 0.8);
  --border-color: rgba(0, 0, 0, 0.08);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  --shadow-heavy: 0 16px 48px rgba(0, 0, 0, 0.12);
  --font-size-base: 16px;
  --font-size-ayah: 24px;
  --font-size-header: 20px;
  --font-weight: 400;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] {
  --primary-color: #4caf50;
  --primary-light: #66bb6a;
  --primary-rgb: 76, 175, 80;
  --secondary-color: #f9d423;
  --accent-color: #fff176;
  --bg-color: #0c0e0c;
  --text-color: #f0f0f0;
  --text-secondary: #aaa;
  --card-bg: rgba(30, 30, 30, 0.8);
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-heavy: 0 16px 48px rgba(0, 0, 0, 0.5);
  --glass-bg: rgba(30, 30, 30, 0.6);
  --glass-border: rgba(255, 255, 255, 0.05);
}

/* Selection styling */
::selection {
  background: rgba(var(--primary-rgb), 0.2);
  color: var(--text-color);
}

/* Animations */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

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

.animate-fade-up {
  animation: fadeUp var(--transition-slow) forwards;
  opacity: 0;
}

.animate-fade-in {
  animation: fadeIn var(--transition-slow) forwards;
  opacity: 0;
}

.animate-scale-in {
  animation: scaleIn var(--transition-slow) forwards;
  opacity: 0;
}

.delay-1 {
  animation-delay: 0.1s;
}

.delay-2 {
  animation-delay: 0.2s;
}

.delay-3 {
  animation-delay: 0.3s;
}

.delay-4 {
  animation-delay: 0.4s;
}

.delay-5 {
  animation-delay: 0.5s;
}

body {
  font-family:
    "Cairo",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  direction: rtl;
  padding-bottom: 0;
  font-weight: var(--font-weight);
  transition:
    background-color var(--transition-normal),
    color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

@media (max-width: 768px) {
  body {
    padding-bottom: 70px;
  }
}

/* Utilities */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
}

.glass-card:hover {
  box-shadow: var(--shadow-heavy);
  transform: translateY(-4px);
  border-color: var(--primary-color);
}

.background-ornament {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.12;
  pointer-events: none;
}

.ornament-1 {
  top: -150px;
  left: -150px;
  background: var(--primary-color);
}

.ornament-2 {
  bottom: -150px;
  right: -150px;
  background: var(--secondary-color);
}

/* App Header */
.app-header {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 15px;
  z-index: 1000;
  margin: 0 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.visitor-badge {
  display: none !important;
}

.app-header h1 {
  font-size: var(--font-size-header);
  color: var(--text-color);
  margin: 0;
  font-weight: 700;
  flex: 1;
  text-align: right;
}

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

.settings-btn,
.header-back-btn,
.menu-toggle-btn {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-color);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: all var(--transition-fast);
}

.menu-toggle-btn {
  background: var(--primary-color);
  color: white;
}

.settings-btn:hover,
.header-back-btn:hover {
  background: rgba(var(--primary-rgb), 0.1);
}

.app-content {
  padding: 40px 20px;
  max-width: 1000px;
  margin: 0 auto;
}

/* Home Section Styles */
.hero-section {
  text-align: center;
  padding: 0px 30px;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-light)
  );
  border-radius: var(--radius-lg);
  color: white;
  margin-bottom: 40px;
  box-shadow: var(--shadow-heavy);
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.1) 0%,
    transparent 70%
  );
  pointer-events: none;
}

.hero-icon {
  font-size: 80px;
  /* margin-bottom: 24px; */
  display: inline-block;
}

.hero-title {
  font-size: 42px;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero-subtitle {
  font-size: 20px;
  opacity: 0.9;
  margin-bottom: 24px;
  font-weight: 500;
}

.hero-description {
  font-size: 16px;
  opacity: 0.8;
  max-width: 600px;
  margin: 0 auto 30px;
  line-height: 1.8;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.feature-card {
  padding: 32px;
  text-align: center;
  text-decoration: none;
  color: var(--text-color);
  display: block;
}

.feature-icon {
  font-size: 54px;
  margin-bottom: 20px;
  transition: transform var(--transition-normal);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

.feature-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.stats-section {
  padding: 40px;
  margin-bottom: 48px;
  text-align: center;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.stat-number {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Daily Verse & Resume Reading */
.verse-card,
.resume-card {
  padding: 36px 24px;
  margin-bottom: 32px;
  position: relative;
  text-align: center;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.verse-card::before {
  content: '"';
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 80px;
  font-family: serif;
  color: var(--primary-color);
  opacity: 0.1;
}

.verse-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: block;
}

.daily-verse-content {
  font-family: "Amiri", serif;
  font-size: clamp(24px, 5vw, 30px);
  line-height: 1.8;
  margin-bottom: 24px;
  color: var(--text-color);
  position: relative;
  z-index: 1;
}

.verse-ref {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(var(--primary-rgb), 0.08);
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
}

.resume-card {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: right;
  padding: 24px;
  cursor: pointer;
  border-right: 4px solid var(--primary-color);
}

.resume-icon {
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.resume-content {
  flex: 1;
}

.resume-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.resume-details {
  font-size: 18px;
  font-weight: 700;
}

.resume-arrow {
  font-size: 20px;
  color: var(--primary-color);
  opacity: 0.5;
}

.resume-card:hover .resume-arrow {
  transform: translateX(-5px);
  opacity: 1;
}

/* Hadith Card */
.hadith-card {
  padding: 32px;
  margin-bottom: 32px;
  border-right: 4px solid var(--secondary-color);
  position: relative;
  overflow: hidden;
}

.hadith-card::before {
  content: "\F2AB";
  /* bi-chat-quote */
  font-family: "bootstrap-icons";
  position: absolute;
  top: -10px;
  left: -10px;
  font-size: 80px;
  color: var(--secondary-color);
  opacity: 0.05;
}

.hadith-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--secondary-color);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hadith-text {
  font-size: 18px;
  line-height: 1.8;
  color: var(--text-color);
  font-weight: 500;
}

/* Prayer Times Widget */
.prayer-widget {
  margin-bottom: 32px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

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

.pw-title {
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.pw-location {
  font-size: 13px;
  color: var(--text-secondary);
}

.pw-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 12px;
}

.pw-item {
  text-align: center;
  padding: 12px 8px;
  border-radius: var(--radius-md);
  background: rgba(var(--primary-rgb), 0.05);
  transition: all var(--transition-fast);
}

.pw-item.active {
  background: var(--primary-color);
  color: white;
  transform: scale(1.05);
  box-shadow: var(--shadow);
}

.pw-name {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}

.pw-time {
  font-size: 14px;
  font-weight: 700;
}

.pw-footer {
  text-align: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
  font-weight: 600;
  color: var(--primary-color);
}

.detect-location-container {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
}

.detect-location-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-fast);
}

.detect-location-btn:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

.detect-location-btn i {
  font-size: 16px;
}

/* Quick Tools */
.quick-tools {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 40px;
}

.tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
}

.tool-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-4px);
}

.tool-btn i {
  font-size: 20px;
}

.tool-label {
  font-size: 12px;
  font-weight: 600;
}

/* Sidebar */
.desktop-sidebar {
  position: fixed;
  right: -320px;
  top: 0;
  width: 320px;
  height: 100vh;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--border-color);
  z-index: 2000;
  transition: right 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  display: flex;
  flex-direction: column;
}

.desktop-sidebar.active {
  right: 0;
}

.sidebar-logo {
  padding: 30px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo-text {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary-color);
}

.sidebar-close-btn {
  background: var(--primary-color);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 4px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-color);
  transition: all var(--transition-fast);
}

.sidebar-nav-item:hover {
  background: rgba(var(--primary-rgb), 0.08);
}

.sidebar-nav-item.active {
  background: var(--primary-color);
  color: white;
}

.sidebar-nav-label {
  font-size: 15px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.sidebar-version {
  font-size: 12px;
  color: var(--text-secondary);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  z-index: 1999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Bottom Nav */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  display: none;
  justify-content: space-around;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-heavy);
  z-index: 1000;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 20px;
  transition: all var(--transition-fast);
  flex: 1;
}

.nav-item.active {
  color: var(--primary-color);
}

.nav-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.nav-label {
  font-size: 11px;
  font-weight: 600;
}

@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
  }

  .app-header {
    top: 10px;
    margin: 0 10px;
  }

  .hero-title {
    font-size: 32px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  padding: 32px;
  border-radius: var(--radius-lg);
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow-heavy);
  animation: scaleIn var(--transition-normal);
}

.modal .modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.modal .modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  background: rgba(var(--primary-rgb), 0.14);
  color: var(--primary-color);
}

.modal .modal-icon.warning {
  background: rgba(212, 130, 10, 0.18);
  color: #d4820a;
}

.modal .modal-icon.error {
  background: rgba(211, 47, 47, 0.18);
  color: #d32f2f;
}

.modal .modal-icon.success {
  background: rgba(27, 94, 32, 0.18);
  color: var(--primary-color);
}

.modal .modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-color);
}

.modal .modal-message {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-color);
  opacity: 0.88;
}

.modal .modal-actions {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.modal .modal-btn {
  min-width: 110px;
  border: none;
  border-radius: var(--radius-md);
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast),
    background-color var(--transition-fast),
    color var(--transition-fast),
    opacity var(--transition-fast);
}

.modal .modal-btn:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), 0.45);
  outline-offset: 2px;
}

.modal .modal-btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-light)
  );
  color: #fff;
  box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.3);
}

.modal .modal-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(var(--primary-rgb), 0.34);
}

.modal .modal-btn-primary:active {
  transform: translateY(0);
  opacity: 0.95;
}

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

.modal .modal-btn-secondary:hover {
  background: rgba(var(--primary-rgb), 0.16);
}

@media (max-width: 480px) {
  .modal {
    padding: 24px;
  }

  .modal .modal-actions {
    flex-direction: column;
  }

  .modal .modal-btn {
    width: 100%;
  }
}
