:root {
  /* Dark Theme (Default) */
  --bg-main: #020617;
  --bg-sidebar: #0d1117;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --glass-bg: rgba(13, 17, 23, 0.8);
  --glass-border: rgba(255, 255, 255, 0.05);
  --card-bg: rgba(13, 17, 23, 0.4);
  --brand-500: #10b981;
  --brand-600: #059669;
  --accent-amber: #f59e0b;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --surface-card: rgba(13, 17, 23, 0.6);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --overlay-subtle: rgba(255, 255, 255, 0.05);
  --border-white-10: rgba(255, 255, 255, 0.1);
}

:root[data-theme="light"] {
  --bg-main: #f1f5f9;
  --bg-sidebar: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(0, 0, 0, 0.1);
  --card-bg: rgba(255, 255, 255, 0.8);
  --accent-amber: #d97706;
  --border-subtle: rgba(0, 0, 0, 0.05);
  --surface-card: #ffffff;
  --shadow-color: rgba(15, 23, 42, 0.08);
  --overlay-subtle: rgba(0, 0, 0, 0.05);
  --border-white-10: rgba(0, 0, 0, 0.1);
}

body {
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: colors 0.3s ease;
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-size: 16px;
  background-image:
    radial-gradient(
      circle at 20% 20%,
      rgba(16, 185, 129, 0.05) 0%,
      transparent 40%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(59, 130, 246, 0.05) 0%,
      transparent 40%
    );
  background-attachment: fixed;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
}

.glass-panel {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  box-shadow: 0 25px 50px -12px var(--shadow-color);
  transition: all 0.3s ease;
  background-color: var(--glass-bg);
  color: var(--text-primary);
}

.glass-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  padding: 1.5rem;
  transition: all 0.3s ease;
  background-color: var(--card-bg);
  color: var(--text-primary);
}

.arabic-text {
  font-family: "Amiri", serif;
  line-height: 1.8;
  text-align: right;
  direction: rtl;
  color: var(--accent-amber);
  transition: all 0.3s ease;
}

.font-amiri-quran {
  font-family: "Amiri Quran", "Amiri", serif;
}

.mushaf-page {
  position: relative;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 64rem;
  transition: all 0.7s ease;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.6);
  background: var(--bg-main);
  border-radius: 4px;
  padding: 2px;
}

/* Ornate Border */
.mushaf-border {
  position: relative;
  padding: 1rem;
  border: 4px solid rgba(16, 185, 129, 0.2);
  border-radius: 2px;
  background-image:
    linear-gradient(var(--bg-main), var(--bg-main)),
    radial-gradient(circle at 0px 0px, var(--brand-500) 0%, transparent 10%),
    radial-gradient(circle at 100% 0px, var(--brand-500) 0%, transparent 10%),
    radial-gradient(circle at 0px 100%, var(--brand-500) 0%, transparent 10%),
    radial-gradient(circle at 100% 100%, var(--brand-500) 0%, transparent 10%);
  background-clip: content-box, border-box, border-box, border-box, border-box;
}

@media (min-width: 768px) {
  .mushaf-border {
    padding: 4rem;
    border-width: 8px;
  }
}

.mushaf-container {
  text-align: justify;
  line-height: 2.5;
  direction: rtl;
  width: 100%;
  transition: all 0.5s ease;
}

/* @media (min-width: 768px) {
  .mushaf-container {
    line-height: 4.5;
  }
} */

/* Premium Ornate Ayah Marker */
.ayah-marker-ornate {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  margin: 0 0.5rem;
  vertical-align: middle;
  user-select: none;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .ayah-marker-ornate {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 1rem;
  }
}

.ayah-marker-ornate:hover {
  transform: scale(1.1);
}

.ayah-marker-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: rgba(16, 185, 129, 0.2);
  fill: currentColor;
}

.ayah-marker-num {
  position: relative;
  z-index: 10;
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  font-family: sans-serif;
}

.book-verse {
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 0.25rem;
  padding-left: 0.25rem;
  padding-right: 0.25rem;
  display: inline;
}

.book-verse:hover {
  background-color: rgba(16, 185, 129, 0.1);
}

.book-verse.active {
  color: #10b981;
  background-color: rgba(16, 185, 129, 0.05);
  box-shadow: 0 10px 15px -3px rgba(16, 185, 129, 0.1);
  outline: 1px solid rgba(16, 185, 129, 0.2);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  transition: background-color 0.2s ease;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #10b981;
}

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

.animate-fade {
  animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
