/* ═══════════════════════════════════════════════════════════════════════════
   HADITH SEARCH ENGINE — Professional CSS with Dark/Light Mode
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────────────────
   CSS Variables (Theme System)
   ───────────────────────────────────────────────────────────────────────── */
@font-face {
  font-family: Mehr;
  src: url(../fonts/mehr.ttf);
  src: url(../fonts/mehr.woff) format('woff');
  font-weight: normal;
}

:root {
  /* Light Mode Colors */
  --color-primary: #2c3e50;
  --color-primary-light: #34495e;
  --color-accent: #d4a574;
  --color-accent-light: #e8c5a0;
  --color-accent-dark: #a67c52;

  --bg-primary: #ffffff;
  --bg-secondary: #f8f7f6;
  --bg-tertiary: #efefee;
  --bg-hover: #f0f2f5;

  --text-primary: #2c3e50;
  --text-secondary: #5a6c7d;
  --text-tertiary: #8899aa;
  --text-muted: #aabbcc;

  --border-color: #e1e3e6;
  --border-light: #f0f0f0;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.15);

  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease-in-out;

  /* Typography */
  --font-urdu: 'Mehr', serif;
  --font-arabic: 'Scheherazade New', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --font-size-base: 1rem;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
}

/* Solarized Dark Theme */
[data-theme="dark"] .dark-mode {
  --color-primary: #93a1a1;
  --color-primary-light: #aab7b8;

  --color-accent: #b58900;
  --color-accent-light: #d6b84d;
  --color-accent-dark: #8c6d00;

  --bg-primary: #002b36;
  --bg-secondary: #073642;
  --bg-tertiary: #0d4452;
  --bg-hover: #124b59;

  --text-primary: #eee8d5;
  --text-secondary: #c7c1af;
  --text-tertiary: #93a1a1;
  --text-muted: #657b83;

  --border-color: #184956;
  --border-light: #0b3945;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-xl: 0 16px 40px rgba(0, 0, 0, 0.55);
}

/* ─────────────────────────────────────────────────────────────────────────
   Global Styles
   ───────────────────────────────────────────────────────────────────────── */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-urdu), var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: var(--transition-base);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-dark);
}

/* ─────────────────────────────────────────────────────────────────────────
   Typography Utilities
   ───────────────────────────────────────────────────────────────────────── */

.ur-display {
  font-family: var(--font-urdu);
  font-weight: var(--font-weight-semibold);
  font-size: 1.8rem;
}

.ur20 {
  font-family: var(--font-urdu);
  font-size: 1.25rem;
  line-height: 1.4;
}

.ur18 {
  font-family: var(--font-urdu);
  font-size: 1.125rem;
}

.ur16 {
  font-family: var(--font-urdu);
  font-size: 1rem;
}

.ur14 {
  font-family: var(--font-urdu);
  font-size: 0.875rem;
}

.ur12 {
  font-family: var(--font-urdu);
  font-size: 0.75rem;
}

.ar16 {
  font-family: var(--font-arabic);
  font-size: 1rem;
}

.ar14 {
  font-family: var(--font-arabic);
  font-size: 0.875rem;
}

.ar12 {
  font-family: var(--font-arabic);
  font-size: 0.75rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   HEADER
   ───────────────────────────────────────────────────────────────────────── */

.site-header {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-bottom: 1px solid var(--border-color);
  padding: 1.5rem 0;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition-base);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  color: inherit;
  flex: 1;
}

.brand-icon {
  font-size: 2.5rem;
  line-height: 1;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0px);
  }

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

.brand-title {
  margin: 0;
  color: var(--color-primary);
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.brand-sub {
  margin: 0.25rem 0 0;
  color: var(--color-accent);
  font-weight: var(--font-weight-medium);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.btn-reader {
  padding: 0.6rem 1.2rem;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-md);
}

.btn-reader:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
  text-decoration: none;
}

/* ─────────────────────────────────────────────────────────────────────────
   Theme Toggle Button
   ───────────────────────────────────────────────────────────────────────── */

.theme-toggle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--color-accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: var(--transition-fast);
  position: relative;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--color-accent);
  transform: rotate(20deg);
  box-shadow: var(--shadow-md);
}

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

#themeIcon {
  transition: transform 0.3s ease-in-out;
}

.theme-toggle.active #themeIcon {
  animation: spinIcon 0.6s ease-in-out;
}

@keyframes spinIcon {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   HERO SECTION
   ───────────────────────────────────────────────────────────────────────── */

.hero-section {
  position: relative;
  padding: 3rem 0;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  overflow: hidden;
}

.hero-bg-pattern {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 35px, rgba(212, 165, 116, 0.05) 35px, rgba(212, 165, 116, 0.05) 70px);
  pointer-events: none;
}

.search-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  transition: var(--transition-base);
}

.search-card:hover {
  box-shadow: var(--shadow-xl);
  border-color: var(--color-accent-light);
}

.search-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.search-card-header span:first-child {
  font-size: 1.3rem;
}

.search-card-header span:last-child {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Form Labels */
.label-urdu {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.label-urdu .text-muted {
  font-weight: var(--font-weight-normal);
  font-size: 0.85rem;
}

/* Select2 Customization */
.select2-books+.select2-container {
  width: 100% !important;
}

.select2-container--bootstrap-5 .select2-selection {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition-fast);
  padding: 0.5rem;
  min-height: 42px;
}

.select2-container--bootstrap-5 .select2-selection:hover {
  border-color: var(--color-accent);
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.select2-container--bootstrap-5 .select2-dropdown {
  background-color: var(--bg-primary);
  border-color: var(--border-color);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}

.select2-container--bootstrap-5 .select2-results__option {
  color: var(--text-primary);
  padding: 0.5rem 1rem;
}

.select2-container--bootstrap-5 .select2-results__option--highlighted,
.select2-container--bootstrap-5 .select2-results__option:hover {
  background-color: var(--color-accent-light);
  color: var(--text-primary);
}

/* Single select text */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  color: var(--text-primary);
}

.select2-container--bootstrap-5.select2-container--disabled .select2-selection .select2-selection__rendered {
  color: var(--text-muted);
}

/* Multiple select area */
.select2-container--bootstrap-5 .select2-selection--multiple {
  background-color: var(--bg-primary);
}

/* Selected chips/tags */
.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered .select2-selection__choice {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Remove button inside chips */
.select2-container--bootstrap-5 .select2-selection__choice__remove {
  color: var(--text-secondary);
  margin-right: 6px;
}

.select2-container--bootstrap-5 .select2-selection__choice__remove:hover {
  color: #ff6b6b;
}

/* Search input */
.select2-container--bootstrap-5 .select2-search input {
  background-color: transparent !important;
  color: var(--text-primary) !important;
}

/* Placeholder */
.select2-container--bootstrap-5 .select2-selection__placeholder {
  color: var(--text-muted);
}

/* Dropdown */
.select2-container--bootstrap-5 .select2-dropdown {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

/* Dropdown options */
.select2-container--bootstrap-5 .select2-results__option {
  background-color: transparent;
  color: var(--text-primary);
}

/* Hover / highlighted option */
.select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

/* Selected dropdown item */
.select2-container--bootstrap-5 .select2-results__option[aria-selected="true"] {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Arrow */
.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow b {
  border-color: var(--text-secondary) transparent transparent transparent;
}

/* Focus state */
.select2-container--bootstrap-5.select2-container--focus .select2-selection {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 0.2rem rgba(212, 165, 116, 0.15);
}

/* Search Input */
.search-input-wrap {
  position: relative;
  display: flex;
  gap: 0.5rem;
}

.search-input {
  flex: 1;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-family: var(--font-urdu);
  font-size: 1.1rem;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
  background-color: var(--bg-primary);
}

.search-btn {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-md);
  white-space: nowrap;
}

.search-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.search-btn:active:not(:disabled) {
  transform: translateY(0);
}

.search-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Search Tips */
.search-tips {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 4px solid var(--color-accent);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.search-tips i {
  color: var(--color-accent);
  margin-top: 2px;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   RESULTS SECTION
   ───────────────────────────────────────────────────────────────────────── */

.results-section {
  padding: 3rem 0;
  min-height: 400px;
}

.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  padding: 1rem 1.5rem;
  background: var(--bg-secondary);
  border-radius: 12px;
  border-left: 4px solid var(--color-accent);
}

.results-meta-text {
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
}

.results-meta-time {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────────────────────────────────
   HADITH RESULT CARD
   ───────────────────────────────────────────────────────────────────────── */

.hadith-result {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition-base);
  cursor: pointer;
}

.hadith-result:hover {
  border-color: var(--color-accent-light);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.hadith-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.hadith-ref {
  font-weight: var(--font-weight-bold);
  color: var(--color-accent);
  font-size: 1.05rem;
}

.hadith-chain {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: var(--font-urdu);
  line-height: 1.5;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.hadith-text {
  color: var(--text-primary);
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 1rem 0;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-right: 3px solid var(--color-accent);
}

.hadith-text em {
  background: rgba(212, 165, 116, 0.2);
  color: var(--color-accent-dark);
  font-style: normal;
  padding: 2px 4px;
  border-radius: 3px;
}

.hadith-translation {
  color: var(--text-secondary);
  font-family: var(--font-urdu);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.hadith-grade {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: var(--color-accent-light);
  color: white;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: var(--font-weight-semibold);
  margin-top: 0.5rem;
}

.hadith-grade.grade-green {
  background: #27ae60;
}

.hadith-grade.grade-orange {
  background: #f39c12;
}

.hadith-grade.grade-red {
  background: #e74c3c;
}

.hadith-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

.hadith-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.hadith-action-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.hadith-action-btn:hover {
  background: var(--bg-secondary);
  color: var(--color-accent);
}

/* ─────────────────────────────────────────────────────────────────────────
   PAGINATION
   ───────────────────────────────────────────────────────────────────────── */

.pagination-wrap {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.pagination-btn {
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
}

.pagination-btn:hover:not(:disabled) {
  border-color: var(--color-accent);
  background: var(--bg-secondary);
  color: var(--color-accent);
}

.pagination-btn.active {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-dark) 100%);
  color: white;
  border-color: var(--color-accent);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ─────────────────────────────────────────────────────────────────────────
   MESSAGE BOX (Error/Info)
   ───────────────────────────────────────────────────────────────────────── */

.msg-box {
  padding: 1.5rem;
  border-radius: 12px;
  margin: 2rem 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

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

.msg-box.error {
  background: #ffe0e0;
  color: #c00;
  border-left: 4px solid #e74c3c;
}

.msg-box.info {
  background: #e0f2f1;
  color: #00695c;
  border-left: 4px solid #17a2b8;
}

.msg-box.success {
  background: #e0ffe0;
  color: #006600;
  border-left: 4px solid #27ae60;
}

.msg-box i {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────────────
   GLOBAL LOADER
   ───────────────────────────────────────────────────────────────────────── */

.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.loader-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.loader-ring {
  width: 50px;
  height: 50px;
  border: 4px 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);
  }
}

.loader-ring::after {
  content: '';
  position: absolute;
  width: 50px;
  height: 50px;
  border: 4px solid rgba(212, 165, 116, 0.3);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 1.2s linear infinite reverse;
}

/* ─────────────────────────────────────────────────────────────────────────
   Form Elements
   ───────────────────────────────────────────────────────────────────────── */

.form-control,
.form-select {
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-accent);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

/* ─────────────────────────────────────────────────────────────────────────
   Bootstrap Overrides
   ───────────────────────────────────────────────────────────────────────── */

.text-muted {
  color: var(--text-tertiary) !important;
}

.container-xl {
  max-width: 1000px;
}

/* ─────────────────────────────────────────────────────────────────────────
   Responsive Design
   ───────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .ur-display {
    font-size: 1.4rem;
  }

  .ur20 {
    font-size: 1.1rem;
  }

  .ur18 {
    font-size: 1rem;
  }

  .ur16 {
    font-size: 0.95rem;
  }

  .header-inner {
    flex-wrap: wrap;
    gap: 1rem;
  }

  .brand-wrap {
    order: 1;
    width: 100%;
  }

  .header-actions {
    order: 2;
    width: 100%;
    justify-content: flex-end;
  }

  .search-card {
    padding: 1.5rem;
  }

  .search-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .search-input-wrap {
    flex-direction: column;
  }

  .search-btn {
    width: 100%;
    justify-content: center;
  }

  .hadith-result {
    padding: 1rem;
  }

  .hadith-header {
    flex-direction: column;
  }

  .hadith-text {
    font-size: 1rem;
  }

  .ar16 {
    font-size: 0.95rem;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 0.95rem;
  }

  .brand-icon {
    font-size: 2rem;
  }

  .brand-title {
    font-size: 1.3rem;
  }

  .ur-display {
    font-size: 1.2rem;
  }

  .search-card {
    padding: 1rem;
  }

  .search-card-header {
    margin-bottom: 1.5rem;
  }

  .results-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .hadith-result {
    margin-bottom: 1rem;
  }

  .hadith-text {
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0.75rem 0;
    padding: 0.75rem;
  }

  .pagination-wrap {
    gap: 0.25rem;
  }

  .pagination-btn {
    min-width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   READER PAGE STYLES (read.php)
   ───────────────────────────────────────────────────────────────────────── */

/* Filter Card */
.filter-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin: 2rem 0;
}

.filter-card-title {
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-select {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  padding: 0.7rem 1rem;
  font-family: var(--font-urdu);
  transition: var(--transition-fast);
}

.filter-select:hover {
  border-color: var(--color-accent);
}

.filter-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.filter-select:disabled {
  background-color: var(--bg-secondary);
  color: var(--text-muted);
  cursor: not-allowed;
}

/* Inline Search */
.inline-search-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.inline-search-wrap .form-control {
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-family: var(--font-urdu);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.inline-search-wrap .form-control:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.1);
}

.btn-clear-hl {
  padding: 0.75rem 1.2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  transition: var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-clear-hl:hover {
  background: var(--color-accent-light);
  color: white;
  border-color: var(--color-accent);
}

.btn-clear-hl:active {
  transform: scale(0.98);
}

/* Hadith Reader Area */
.hadith-reader-area {
  padding: 3rem 0;
  min-height: 400px;
}

.hadith-reader-h2 {
  font-family: var(--font-urdu);
  font-size: 1.8rem;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  line-height: 1.3;
}

.hadith-reader-h2-ar {
  font-family: var(--font-arabic);
  font-size: 1.4rem;
  font-weight: var(--font-weight-medium);
  color: var(--color-accent);
  line-height: 1.4;
}

.hadith-heading-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-color);
}

.hadith-nav-btns {
  display: flex;
  gap: 1rem;
  white-space: nowrap;
}

.btn-nav {
  padding: 0.7rem 1.2rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-urdu);
}

.btn-nav:hover:not(:disabled) {
  background: var(--color-accent-light);
  color: white;
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-nav:active:not(:disabled) {
  transform: translateY(0);
}

.btn-nav:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Meta Row */
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-left: 3px solid var(--color-accent);
}

.meta-label {
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
}

.meta-ar {
  color: var(--text-primary);
  font-family: var(--font-arabic);
}

.meta-ur {
  color: var(--text-primary);
  font-family: var(--font-urdu);
}

.meta-sep {
  color: var(--text-muted);
  margin: 0 0.5rem;
}

/* ─── Taraqeem Box Container ─── */
.taraqeem-box-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  margin: 1.5rem 0;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.taraqeem-box-label {
  flex-basis: 100%;
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.taraqeem-box {
  background: var(--color-accent);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.dark-mode .taraqeem-box {
  background: var(--color-accent-dark);
  box-shadow: var(--shadow-md);
}

/* ─── Hadith Divider ─── */
.hadith-divider {
  height: 2px;
  background: linear-gradient(to right, var(--border-color), var(--color-accent), var(--border-color));
  margin: 2rem 0;
  border-radius: 1px;
}

/* ─── Hadith Reference Heading ─── */
.hadith-reference-heading {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--color-accent);
  margin-bottom: 1.5rem;
}

.hadith-reference-heading .ur16 {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.hadith-reference-heading .ar18 {
  color: var(--text-secondary);
  font-family: var(--font-arabic);
}

/* Hadith Chips Row */
.hadith-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 8px;
}

.chip {
  padding: 0.5rem 1rem;
  background: var(--color-accent-light);
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: var(--font-weight-medium);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.chip-type {
  background: var(--color-accent);
}

.chip-hukam {
  background: #27ae60;
}

/* Hadith Text Blocks */
.hadith-text-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow-sm);
}

.text-block-label {
  font-weight: var(--font-weight-semibold);
  color: var(--text-secondary);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  display: block;
}

.hadith-full-ar {
  font-family: var(--font-arabic);
  font-size: 1.3rem;
  line-height: 2;
  color: var(--text-primary);
  text-align: right;
}

.hadith-full-ur {
  font-family: var(--font-urdu);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
  text-align: right;
}

.hadith-hashia {
  font-family: var(--font-urdu);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
  text-align: right;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 8px;
  border-right: 3px solid var(--color-accent-light);
}

.arabic-block {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
}

.urdu-block {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
}

.hashia-block {
  background: var(--bg-secondary);
}

/* Reader Loader */
.reader-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 4rem 2rem;
  text-align: center;
}

.loader-ring {
  width: 60px;
  height: 60px;
  border: 4px solid rgba(212, 165, 116, 0.2);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Reader Empty State */
.reader-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-muted);
}

.reader-empty i {
  font-size: 3rem;
  opacity: 0.5;
}

.reader-empty p {
  font-family: var(--font-urdu);
  font-size: 1.1rem;
}

/* Variants Section */
.variants-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--border-color);
}

.variants-title {
  font-family: var(--font-urdu);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.variant-group {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--color-accent);
}

.variant-tarqeem-label {
  font-family: var(--font-urdu);
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.variant-hadith {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  transition: var(--transition-fast);
}

.variant-hadith:last-child {
  margin-bottom: 0;
}

.variant-hadith:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent-light);
}

.variant-hno {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.variant-arabic {
  font-family: var(--font-arabic);
  font-size: 1.1rem;
  line-height: 1.8;
  margin: 0.75rem 0;
  color: var(--text-primary);
  text-align: right;
}

.variant-urdu {
  font-family: var(--font-urdu);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0.75rem 0;
  color: var(--text-secondary);
  text-align: right;
}

.variant-load-btn {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.btn-variant-load {
  padding: 0.6rem 1.2rem;
  background: var(--color-accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--font-urdu);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.btn-variant-load:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-variant-load:active {
  transform: translateY(0);
}

/* Site Footer */
.site-footer {
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
  border-top: 1px solid var(--border-color);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 3rem;
}

/* ─────────────────────────────────────────────────────────────────────────
   Print Styles
   ───────────────────────────────────────────────────────────────────────── */

@media print {

  .site-header,
  .hero-section,
  .search-card,
  .pagination-wrap,
  .theme-toggle {
    display: none;
  }

  .hadith-result {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .hadith-text {
    color: #000;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Accessibility
   ───────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* High contrast mode support */
@media (prefers-contrast: more) {
  .hadith-text {
    border-right-width: 4px;
  }

  .search-tips {
    border-left-width: 5px;
  }

  .results-meta {
    border-left-width: 5px;
  }
}