/* theme.css */

/* GLOBAL TRANSITIONS FOR SMOOTH THEME SWAP */
body, nav, .site-footer, .bg-gradient, .wave-band, .orb, .geo-overlay, 
.contact-card, .book-card, .article-card, .setting-card, .stat-card, 
.sidebar-btn, .nav-btn, .action-btn, h1, h2, h3, p, span, a, 
.form-input, .form-textarea, .lib-search-bar input, .filter-pill, .settings-sidebar,
.slider, .category-chip, .articles-search-bar {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, background 0.4s ease, text-shadow 0.4s ease !important;
}

/* ---------------- DARK MODE ---------------- */
html[data-theme="dark"] body {
  background-color: #050505 !important;
  color: #e2e8f0 !important;
}

/* Hide Original Cosmic Purple Effects & Geo Overlay */
html[data-theme="dark"] .bg-gradient,
html[data-theme="dark"] #cosmos,
html[data-theme="dark"] .geo-overlay,
html[data-theme="dark"] .orb,
html[data-theme="dark"] .wave-band,
html[data-theme="dark"] .cursor-glow {
  display: none !important;
}

/* Individually Spinning Mandalas Container */
#dark-live-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
@keyframes spinMandala {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

html[data-theme="dark"] body::before {
  display: none !important;
}

/* Drifting Starry Layer and Nebula Behind Mandalas */
html[data-theme="dark"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background-color: #060608;
  background-image: 
    radial-gradient(1px 1px at 25px 5px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.5px 1.5px at 50px 25px, rgba(255,255,255,0.6), transparent),
    radial-gradient(1px 1px at 125px 20px, rgba(255,255,255,0.9), transparent),
    radial-gradient(2px 2px at 50px 75px, rgba(255,255,255,0.7), transparent),
    radial-gradient(1px 1px at 15px 125px, rgba(255,255,255,0.8), transparent),
    radial-gradient(1.5px 1.5px at 110px 140px, rgba(255,255,255,0.5), transparent),
    radial-gradient(circle at 20% 80%, rgba(139, 60, 247, 0.05), transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(139, 60, 247, 0.04), transparent 50%);
  background-size: 150px 150px, 150px 150px, 150px 150px, 150px 150px, 150px 150px, 150px 150px, 100% 100%, 100% 100%;
  animation: darkStars 180s linear infinite;
}
@keyframes darkStars {
  from { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
  to { background-position: -150px 150px, -150px 150px, -150px 150px, -150px 150px, -150px 150px, -150px 150px, 0 0, 0 0; }
}

/* Nav & Footer */
html[data-theme="dark"] nav {
  background: rgba(15, 15, 15, 0.9) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

html[data-theme="dark"] .site-footer {
  background: rgba(10, 10, 10, 0.95) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}
html[data-theme="dark"] .site-footer::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.2)) !important;
}

/* Brand Icon */
html[data-theme="dark"] .nav-brand .brand-icon {
  background: linear-gradient(135deg, #444, #111) !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  animation: none !important;
}

/* Cards & Elements */
html[data-theme="dark"] .contact-card,
html[data-theme="dark"] .book-card,
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .setting-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .settings-sidebar {
  background: rgba(20, 20, 20, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6) !important;
}

html[data-theme="dark"] .article-card:hover,
html[data-theme="dark"] .book-card:hover {
  transform: translateY(-8px) !important;
  border-top-color: rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.8), 0 0 24px rgba(255, 255, 255, 0.1) !important;
}

/* Typography Overrides for Dark Mode */
html[data-theme="dark"] .title-eng,
html[data-theme="dark"] .articles-title,
html[data-theme="dark"] .contact-title,
html[data-theme="dark"] .lib-title {
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
}

html[data-theme="dark"] .nav-links a {
  color: #cbd5e1 !important;
}
html[data-theme="dark"] .nav-links a:hover,
html[data-theme="dark"] .nav-links a.active {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.4) !important;
}

/* Search Bars */
html[data-theme="dark"] .articles-search-bar,
html[data-theme="dark"] .lib-search-bar,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-textarea {
  background: rgba(25, 25, 25, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5), 0 4px 20px rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
}

html[data-theme="dark"] .articles-search-bar:focus-within,
html[data-theme="dark"] .lib-search-bar:focus-within,
html[data-theme="dark"] .form-input:focus,
html[data-theme="dark"] .form-textarea:focus {
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5), 0 4px 25px rgba(255, 255, 255, 0.1) !important;
}

html[data-theme="dark"] .search-icon,
html[data-theme="dark"] i.fas,
html[data-theme="dark"] i.far {
  color: #aaa !important;
}

/* Categories & Pills */
html[data-theme="dark"] .category-chip,
html[data-theme="dark"] .filter-pill,
html[data-theme="dark"] .article-top-category {
  background: rgba(30, 30, 30, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #ddd !important;
}

html[data-theme="dark"] .category-chip:hover,
html[data-theme="dark"] .category-chip.active,
html[data-theme="dark"] .filter-pill:hover,
html[data-theme="dark"] .filter-pill.active,
html[data-theme="dark"] .article-card:hover .article-top-category {
  background: rgba(60, 60, 60, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
  color: #fff !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15) !important;
}

/* Book Covers */
html[data-theme="dark"] .article-cover,
html[data-theme="dark"] .book-cover {
  background: linear-gradient(135deg, #1a1a1a, #0a0a0a) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5) !important;
}

/* Card Buttons (Read, Download, Volumes) */
html[data-theme="dark"] .book-btn,
html[data-theme="dark"] .vol-btn,
html[data-theme="dark"] .read-btn,
html[data-theme="dark"] .download-btn,
html[data-theme="dark"] .card-btn,
html[data-theme="dark"] .article-btn {
  background: rgba(30, 30, 35, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: #fff !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5) !important;
}
html[data-theme="dark"] .book-btn:hover,
html[data-theme="dark"] .vol-btn:hover,
html[data-theme="dark"] .read-btn:hover,
html[data-theme="dark"] .download-btn:hover,
html[data-theme="dark"] .card-btn:hover,
html[data-theme="dark"] .article-btn:hover {
  background: rgba(60, 60, 65, 0.9) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 15px rgba(255,255,255,0.2) !important;
  color: #fff !important;
}

/* Buttons */
html[data-theme="dark"] .nav-btn,
html[data-theme="dark"] .action-btn,
html[data-theme="dark"] .sidebar-btn {
  border-color: rgba(255, 255, 255, 0.25) !important;
  background: transparent !important;
  color: #fff !important;
}
html[data-theme="dark"] .nav-btn::before,
html[data-theme="dark"] .action-btn::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05)) !important;
}
html[data-theme="dark"] .nav-btn:hover,
html[data-theme="dark"] .action-btn:hover {
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.15) !important;
}

html[data-theme="dark"] .sidebar-btn:hover,
html[data-theme="dark"] .sidebar-btn.active {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #fff !important;
  font-weight: 700 !important;
}

/* Text Colors */
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .hero-desc,
html[data-theme="dark"] .stat-label,
html[data-theme="dark"] .contact-subtitle,
html[data-theme="dark"] .footer-copyright,
html[data-theme="dark"] .article-readtime {
  color: #94a3b8 !important;
}

/* Scrollbar */
html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #050505 !important;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: #050505 !important;
}
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4) !important;
}

/* Remove purple borders from sliders in settings */
html[data-theme="dark"] .slider {
  border-color: rgba(255, 255, 255, 0.2) !important;
}
html[data-theme="dark"] input:checked + .slider {
  background-color: #444 !important;
  border-color: #888 !important;
}
html[data-theme="dark"] input:checked + .slider:before {
  background-color: #fff !important;
}


/* ========================================================
   MASSIVE GLOBAL OVERRIDES TO STRIP ALL PURPLE IN DARK MODE 
   ======================================================== */
html[data-theme="dark"] .book-card,
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .category-card,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .madhab-card {
  border-color: rgba(255, 255, 255, 0.1) !important;
  border-top-color: rgba(255, 255, 255, 0.25) !important;
  background: rgba(15, 15, 15, 0.6) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8) !important;
}

html[data-theme="dark"] .book-card:hover,
html[data-theme="dark"] .article-card:hover,
html[data-theme="dark"] .category-card:hover,
html[data-theme="dark"] .stat-card:hover,
html[data-theme="dark"] .madhab-card:hover {
  border-top-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 15px 40px rgba(0,0,0,0.8), 0 0 25px rgba(255,255,255,0.15) !important;
}

html[data-theme="dark"] .book-title-en,
html[data-theme="dark"] .book-author,
html[data-theme="dark"] .article-desc,
html[data-theme="dark"] .lib-subtitle,
html[data-theme="dark"] .explore-btn,
html[data-theme="dark"] .madhab-footer,
html[data-theme="dark"] .madhab-card-icon {
  color: #a1a1aa !important;
}

/* All Buttons (Card actions, nav, filters) */
html[data-theme="dark"] .book-action-icon,
html[data-theme="dark"] .action-btn,
html[data-theme="dark"] .nav-btn,
html[data-theme="dark"] .category-chip,
html[data-theme="dark"] .filter-pill,
html[data-theme="dark"] .vol-select {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  color: #a1a1aa !important;
}

html[data-theme="dark"] .book-action-icon:hover,
html[data-theme="dark"] .action-btn:hover,
html[data-theme="dark"] .nav-btn:hover,
html[data-theme="dark"] .category-chip:hover,
html[data-theme="dark"] .category-chip.active,
html[data-theme="dark"] .filter-pill:hover,
html[data-theme="dark"] .filter-pill.active {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  color: #ffffff !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2) !important;
}

html[data-theme="dark"] .book-open-btn {
  background: linear-gradient(135deg, #2a2a2a, #444) !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: #ffffff !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .book-open-btn:hover {
  background: linear-gradient(135deg, #444, #5a5a5a) !important;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2) !important;
}

/* Search Bars */
html[data-theme="dark"] .search-wrapper,
html[data-theme="dark"] .lib-search-bar {
  background: rgba(20, 20, 20, 0.8) !important;
  border-color: rgba(255, 255, 255, 0.2) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .search-wrapper:focus-within,
html[data-theme="dark"] .lib-search-bar:focus-within {
  border-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] .search-icon, 
html[data-theme="dark"] .search-clear {
  color: #a1a1aa !important;
}

/* Text Glows (Titles) */
html[data-theme="dark"] .title-eng,
html[data-theme="dark"] .title-ar,
html[data-theme="dark"] .lib-title,
html[data-theme="dark"] .article-title,
html[data-theme="dark"] h1, 
html[data-theme="dark"] h2,
html[data-theme="dark"] .post-title,
html[data-theme="dark"] .section-title,
html[data-theme="dark"] .madhab-title {
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.15), 0 0 40px rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}

/* Misc Text and Icons */
html[data-theme="dark"] .stat-icon,
html[data-theme="dark"] .brand-icon {
  color: #e2e8f0 !important;
  fill: #e2e8f0 !important;
  background: #2a2a2a !important;
  box-shadow: none !important;
  border-color: rgba(255,255,255,0.2) !important;
}
html[data-theme="dark"] .footer-brand svg,
html[data-theme="dark"] .footer-section a:hover {
  color: #ffffff !important;
  text-shadow: 0 0 10px rgba(255,255,255,0.3) !important;
  filter: none !important;
}
html[data-theme="dark"] .site-footer::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent) !important;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4)) !important;
}
html[data-theme="dark"] .site-footer {
  border-top-color: rgba(255,255,255,0.1) !important;
  background: rgba(10, 10, 10, 0.9) !important;
}
/* Article page specific */
html[data-theme="dark"] .article-header {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] .post-container {
  border-color: rgba(255,255,255,0.1) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,0.8) !important;
}

/* Hardcode SVG lines to avoid purple stroke/fill */
html[data-theme="dark"] .category-card svg,
html[data-theme="dark"] .stat-card svg,
html[data-theme="dark"] .book-action-icon svg,
html[data-theme="dark"] .madhab-card-icon svg {
  stroke: #e2e8f0 !important;
  color: #e2e8f0 !important;
}

html[data-theme="dark"] .madhab-card-icon {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.4)) !important;
}

/* ---------------- LIGHT MODE ---------------- */
html[data-theme="light"] body {
  background-color: #f8fafc !important;
  color: #0f172a !important;
}

html[data-theme="light"] #cosmos,
html[data-theme="light"] .geo-overlay,
html[data-theme="light"] .orb,
html[data-theme="light"] .wave-band,
html[data-theme="light"] .cursor-glow {
  display: none !important;
}

html[data-theme="light"] .bg-gradient {
  background: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 100%) !important;
}

html[data-theme="light"] nav,
html[data-theme="light"] .site-footer {
  background: rgba(255, 255, 255, 0.8) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .site-footer::before {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.2), transparent) !important;
  filter: none !important;
}

html[data-theme="light"] .nav-brand,
html[data-theme="light"] .nav-brand .brand-icon {
  color: #0f172a !important;
}
html[data-theme="light"] .nav-brand .brand-icon {
  background: linear-gradient(135deg, #cbd5e1, #f1f5f9) !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .contact-card,
html[data-theme="light"] .book-card,
html[data-theme="light"] .article-card,
html[data-theme="light"] .setting-card,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .settings-sidebar {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-top: 1px solid rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .article-card:hover,
html[data-theme="light"] .book-card:hover {
  border-top-color: rgba(0, 0, 0, 0.2) !important;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1), 0 0 24px rgba(0, 0, 0, 0.02) !important;
}

html[data-theme="light"] .form-input,
html[data-theme="light"] .form-textarea,
html[data-theme="light"] .lib-search-bar,
html[data-theme="light"] .articles-search-bar {
  background: rgba(255, 255, 255, 0.9) !important;
  border: 1px solid rgba(0, 0, 0, 0.2) !important;
  color: #0f172a !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.02) !important;
}
html[data-theme="light"] .lib-search-bar input,
html[data-theme="light"] .articles-search-bar input {
  color: #0f172a !important;
}
html[data-theme="light"] .articles-search-bar:focus-within {
  border-color: rgba(0, 0, 0, 0.4) !important;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.05), 0 4px 25px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .search-icon,
html[data-theme="light"] i.fas,
html[data-theme="light"] i.far {
  color: #64748b !important;
}

html[data-theme="light"] .category-chip,
html[data-theme="light"] .filter-pill,
html[data-theme="light"] .article-top-category {
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #334155 !important;
}

html[data-theme="light"] .category-chip:hover,
html[data-theme="light"] .category-chip.active,
html[data-theme="light"] .filter-pill:hover,
html[data-theme="light"] .filter-pill.active,
html[data-theme="light"] .article-card:hover .article-top-category {
  background: #f1f5f9 !important;
  border-color: rgba(0, 0, 0, 0.3) !important;
  color: #0f172a !important;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .article-cover,
html[data-theme="light"] .book-cover {
  background: linear-gradient(135deg, #e2e8f0, #f8fafc) !important;
  border: 1px solid rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .title-eng,
html[data-theme="light"] .contact-title,
html[data-theme="light"] .lib-title,
html[data-theme="light"] h1,
html[data-theme="light"] h2,
html[data-theme="light"] h3,
html[data-theme="light"] .setting-info h3,
html[data-theme="light"] .tab-title,
html[data-theme="light"] .sidebar-title,
html[data-theme="light"] .stat-number,
html[data-theme="light"] .book-title,
html[data-theme="light"] .articles-title {
  text-shadow: none !important;
  color: #1e293b !important;
}

html[data-theme="light"] .nav-links a,
html[data-theme="light"] .sidebar-btn {
  color: #475569 !important;
}
html[data-theme="light"] .nav-links a:hover,
html[data-theme="light"] .nav-links a.active,
html[data-theme="light"] .sidebar-btn:hover,
html[data-theme="light"] .sidebar-btn.active {
  background: rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
  text-shadow: none !important;
}

html[data-theme="light"] .nav-btn,
html[data-theme="light"] .action-btn {
  border-color: rgba(0, 0, 0, 0.2) !important;
  background: rgba(0, 0, 0, 0.05) !important;
  color: #0f172a !important;
}
html[data-theme="light"] .nav-btn::before,
html[data-theme="light"] .action-btn::before {
  background: rgba(0, 0, 0, 0.05) !important;
}
html[data-theme="light"] .nav-btn:hover,
html[data-theme="light"] .action-btn:hover {
  background: rgba(0, 0, 0, 0.1) !important;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.1) !important;
}

html[data-theme="light"] .text-muted,
html[data-theme="light"] .hero-desc,
html[data-theme="light"] .stat-label,
html[data-theme="light"] .contact-subtitle,
html[data-theme="light"] p,
html[data-theme="light"] .book-author,
html[data-theme="light"] .article-readtime {
  color: #475569 !important;
}

html[data-theme="light"] .footer-section h3 {
  color: #0f172a !important;
}
html[data-theme="light"] .footer-section a {
  color: #475569 !important;
}
html[data-theme="light"] .footer-section a:hover {
  color: #0f172a !important;
  text-shadow: none !important;
}
html[data-theme="light"] .footer-copyright {
  color: #64748b !important;
}

/* Light scrollbar */
html[data-theme="light"] ::-webkit-scrollbar-track {
  background: #f8fafc !important;
}
html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2) !important;
  border-color: #f8fafc !important;
}
html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.4) !important;
}

/* Dashboard Links in Footer */
.footer-dashboard-links {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
  justify-content: flex-start;
}
.site-footer > .footer-dashboard-links {
  justify-content: center;
}
.dashboard-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease, text-shadow 0.3s ease;
}
.dashboard-link:hover {
  color: var(--white) !important;
  text-shadow: 0 0 10px rgba(192,132,252,0.6);
}
html[data-theme="light"] .dashboard-link:hover {
  color: #0f172a !important;
  text-shadow: none !important;
}

/* Global Thread Accordions & Content Boxes in Dark Mode */
html[data-theme="dark"] .thread-item::before {
  background: rgba(255, 255, 255, 0.15) !important;
}
html[data-theme="dark"] .thread-item::after {
  background: #000000 !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.2) !important;
}
html[data-theme="dark"] .thread-item.open::after {
  background: #ffffff !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.4) !important;
}
html[data-theme="dark"] .thread-header {
  background: rgba(20, 20, 20, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .thread-header:hover {
  background: rgba(40, 40, 40, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 4px 15px rgba(255, 255, 255, 0.05) !important;
}
html[data-theme="dark"] .accordion-btn {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
  color: #ffffff !important;
}
html[data-theme="dark"] .thread-item.open .accordion-btn {
  background: rgba(255, 255, 255, 0.25) !important;
}
html[data-theme="dark"] .thread-content-inner {
  background: rgba(10, 10, 10, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] .thread-ref {
  color: #a1a1aa !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}
html[data-theme="dark"] .zoomable-img {
  border-color: rgba(255, 255, 255, 0.15) !important;
}
html[data-theme="dark"] .zoomable-img:hover {
  border-color: rgba(255, 255, 255, 0.45) !important;
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1) !important;
}

/* Make sure all inputs, textareas and select dropdowns globally follow dark theme */
html[data-theme="dark"] .lib-search-bar input,
html[data-theme="dark"] .articles-search-bar input,
html[data-theme="dark"] .videos-search-bar input,
html[data-theme="dark"] input[type="text"],
html[data-theme="dark"] input[type="search"],
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
  color: #ffffff !important;
}
html[data-theme="dark"] ::placeholder {
  color: #52525b !important;
}

/* ── GLOBAL ARTICLE COVER & SVG SIZING ── */
.article-cover {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  overflow: hidden !important;
}

.article-cover svg {
  width: 52px !important;
  height: 52px !important;
  max-width: 52px !important;
  max-height: 52px !important;
  color: var(--purple-glow) !important;
  filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.6)) !important;
  opacity: 0.95 !important;
  flex-shrink: 0 !important;
}

.article-cover img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}

/* ═══════════════════════════════════════
   RESPONSIVE LAYOUT & NAVIGATION OVERRIDES
   ═══════════════════════════════════════ */

/* Tablet Viewport (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  nav {
    width: 95% !important;
    padding: 8px 14px !important;
  }
  .nav-links {
    gap: 2px !important;
  }
  .nav-links a {
    font-size: 0.85rem !important;
    padding: 5px 9px !important;
  }
  .nav-btn {
    padding: 7px 14px !important;
    font-size: 0.85rem !important;
  }
}

/* Mobile & Small Tablet Viewport (<= 768px) */
@media (max-width: 768px) {
  /* Hide standard nav links and Join button */
  .nav-links {
    display: none !important;
  }
  
  nav .nav-btn {
    display: none !important;
  }

  /* Fullscreen mobile menu overlay */
  .nav-links.mobile-active {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(8, 3, 20, 0.98) !important;
    backdrop-filter: blur(25px) !important;
    -webkit-backdrop-filter: blur(25px) !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 24px !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    transform: translateY(-20px) !important;
    transition: opacity 0.3s ease, transform 0.3s ease !important;
    pointer-events: none !important;
    padding: 20px !important;
    margin: 0 !important;
  }

  html[data-theme="light"] .nav-links.mobile-active {
    background: rgba(255, 255, 255, 0.99) !important;
  }

  .nav-links.mobile-active.show {
    opacity: 1 !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .nav-links.mobile-active li {
    width: 100% !important;
    text-align: center !important;
  }

  .nav-links.mobile-active a {
    font-size: 1.4rem !important;
    font-weight: 600 !important;
    padding: 10px 24px !important;
    display: inline-block !important;
    width: 80% !important;
    max-width: 280px !important;
    border-radius: 30px !important;
  }

  /* Hamburger Menu Toggle Icon */
  .nav-hamburger {
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    width: 22px !important;
    height: 16px !important;
    cursor: pointer !important;
    z-index: 1000000 !important;
    position: relative !important;
    margin-left: auto !important; /* Push to the right side */
  }

  .nav-hamburger span {
    display: block !important;
    width: 100% !important;
    height: 2px !important;
    background-color: #ffffff !important;
    border-radius: 2px !important;
    transition: transform 0.3s ease, opacity 0.3s ease !important;
  }

  html[data-theme="light"] .nav-hamburger span {
    background-color: #1e293b !important;
  }

  /* Hamburger icon animations */
  .nav-hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg) !important;
  }

  .nav-hamburger.active span:nth-child(2) {
    opacity: 0 !important;
  }

  .nav-hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg) !important;
  }

  /* Compact nav element for mobile devices */
  nav {
    width: 92% !important;
    padding: 10px 18px !important;
    top: 15px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
  }

  .nav-brand {
    font-size: 0.95rem !important;
  }
}

/* Grids Responsiveness */
.lib-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
}

@media (max-width: 600px) {
  .videos-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
}

@media (max-width: 480px) {
  .lib-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .book-card {
    padding: 10px !important;
  }
  .book-cover {
    margin-bottom: 10px !important;
  }
  .book-title {
    font-size: 0.95rem !important;
  }
  .book-author {
    font-size: 0.75rem !important;
  }
}

