:root {
  --primary-color: #120907;
  --primary-dark: #065f46;
  --secondary-color: #002b4c ;
  --accent-color: #f0fdf4;
  --text-primary: #064e3b;
  --text-secondary: #059669;
  --border-color: #a7f3d0;
  --shadow-light: 0 1px 3px rgba(5, 150, 105, 0.12);
  --shadow-medium: 0 4px 6px rgba(5, 150, 105, 0.12);
  --shadow-heavy: 0 10px 25px rgba(5, 150, 105, 0.15);
  --audio-player-height: 80px;
}

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

body {
  font-family: 'Cairo', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 50%, #f0fdfa 100%);
  transition: padding-bottom 0.3s ease;
}

body.audio-player-active {
  padding-bottom: var(--audio-player-height);
}

.App {
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}


.nav-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  box-shadow: var(--shadow-medium);
  position: sticky;
  top: 0;
  z-index: 40;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
  z-index: 50;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}


.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 50;
  gap: 0.25rem;
  border-radius: 0.5rem;
  transition: background-color 0.3s ease;
}

.hamburger-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.hamburger-line {
  width: 1.5rem;
  height: 2px;
  background-color: white;
  border-radius: 1px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.hamburger-line.open:nth-child(1) {
  transform: rotate(45deg) translateY(6px);
}

.hamburger-line.open:nth-child(2) {
  opacity: 0;
}

.hamburger-line.open:nth-child(3) {
  transform: rotate(-45deg) translateY(-6px);
}


.desktop-nav {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
  position: relative;
  font-size: 0.875rem;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}


.nav-item-mega {
  position: relative;
}

.mega-menu-panel {
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  background: #ffffff;
  color: var(--text-primary);
  box-shadow: var(--shadow-heavy);
  border-radius: 0.75rem;
  padding: 1.5rem 1.75rem;
  min-width: 520px;
  max-width: 720px;
  display: none;
  z-index: 60;
  margin-top: 20px;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.mega-menu-column {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mega-menu-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.mega-menu-link {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.25rem 0;
  border-radius: 0.25rem;
  transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.mega-menu-link:hover {
  background-color: var(--accent-color);
  color: var(--primary-color);
  transform: translateX(-2px);
}

.nav-item-mega.open .mega-menu-panel {
  display: block;
}

.mega-menu-search {
  margin-bottom: 1rem;
}

.mega-menu-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
  font-size: 0.875rem;
}

.mega-menu-search-input:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 1px;
}

.scholar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0;
  text-decoration: none;
  color: var(--text-primary);
  border-radius: 0.35rem;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.scholar-item:hover {
  background-color: var(--accent-color);
  transform: translateX(-2px);
}

.scholar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 9999px;
  object-fit: cover;
  border: 1px solid #e5e7eb;
}

.scholar-avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f3f4f6;
  font-size: 0.9rem;
}

.scholar-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.mega-menu-empty {
  font-size: 0.8rem;
  color: #6b7280;
}


@media (min-width: 1024px) {
  
  .nav-item-mega:hover .mega-menu-panel {
    display: block;
  }
}

@media (max-width: 1024px) {
  .mega-menu-panel {
    min-width: 100%;
    inset-inline-start: 0;
    inset-inline-end: 0;
  }

  
  .mega-menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  
  .mobile-mega-menu .mega-menu-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .mega-menu-grid {
    grid-template-columns: 1fr;
  }
}


.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 45;
  animation: fadeIn 0.3s ease;
}


.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: white;
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.2);
  z-index: 50;
  animation: slideInRight 0.3s ease;
  overflow-y: auto;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }

  to {
    transform: translateX(0);
  }
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.mobile-menu-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: white;
}

.mobile-menu-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
}

.mobile-menu-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.mobile-nav-links {
  list-style: none;
  padding: 1rem 0;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
  border-right: 3px solid transparent;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background-color: var(--accent-color);
  color: var(--primary-color);
  border-right-color: var(--primary-color);
}

.mobile-nav-icon {
  font-size: 1.25rem;
  width: 1.5rem;
  text-align: center;
}

.mobile-nav-text {
  font-weight: 500;
  font-size: 1rem;
}


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

  .desktop-nav {
    display: none;
  }
}


.search-container {
  background: white;
  border-radius: 2rem;
  box-shadow: var(--shadow-medium);
  margin: 1rem auto 2rem;
  max-width: 600px;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  position: relative;
}

.search-input {
  flex: 1 1;
  border: none;
  outline: none;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  background: transparent;
  color: var(--text-primary);
  min-width: 0;
  
}

.search-input::placeholder {
  color: #9ca3af;
}

.search-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 1.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.search-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}


@media (max-width: 640px) {
  .search-container {
    margin: 1rem;
    border-radius: 1.5rem;
    padding: 0.25rem;
  }

  .search-input {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }

  .search-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .search-btn span:last-child {
    display: none;
    
  }
}


.card {
  background: white;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-light);
  border: 1px solid #f0fdf4;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  word-wrap: break-word;
  min-height: 350px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-heavy);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
}


@media (max-width: 768px) {
  .card {
    padding: 1.25rem;
    border-radius: 0.75rem;
    min-height: 320px;
  }

  .card h4 {
    font-size: 1rem;
    min-height: 2.8rem;
  }
}

@media (max-width: 480px) {
  .card {
    padding: 0.875rem;
    min-height: 300px;
  }
}


.card h4 {
  font-size: 1.125rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
  font-weight: 700;
  min-height: 3.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card p {
  flex: 1 1;
  margin-bottom: 1rem;
  line-height: 1.7;
  font-size: 0.9rem;
}

.card .attachments-grid {
  margin-bottom: 1rem;
  max-height: 9rem;
  overflow-y: auto;
  padding-inline-end: 0.25rem;
}

.card .attachments-grid::-webkit-scrollbar {
  width: 6px;
}

.card .attachments-grid::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 3px;
}

.card .attachments-grid::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 3px;
}

.card .attachment-link {
  padding: 0.5rem 0.75rem;
  margin: 0.25rem;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.card .attachment-link:hover {
  background: #e9ecef;
  transform: translateY(-1px);
}


.card>div:last-child {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #f0f0f0;
}


.content-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
}

.content-header .mb-8,
.content-header .mb-6 {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding: 0;
}

/* Scroll vertical para los filtros de categorías en móvil
   (div con clases: mb-6 flex flex-wrap gap-2 lg:gap-3 dentro de .content-header) */
@media (max-width: 640px) {
  .content-header .mb-6.flex.flex-wrap.gap-2 {
    max-height: 5.5rem; 
    overflow-y: auto;
    padding-inline-end: 0.25rem;
  }

  .content-header .mb-6.flex.flex-wrap.gap-2::-webkit-scrollbar {
    width: 6px;
  }

  .content-header .mb-6.flex.flex-wrap.gap-2::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
  }

  .content-header .mb-6.flex.flex-wrap.gap-2::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
  }

  
  section .mb-6.flex.flex-wrap.gap-3 {
    max-height: 5.5rem;
    overflow-y: auto;
    padding-inline-end: 0.25rem;
  }

  section .mb-6.flex.flex-wrap.gap-3::-webkit-scrollbar {
    width: 6px;
  }

  section .mb-6.flex.flex-wrap.gap-3::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 3px;
  }

  section .mb-6.flex.flex-wrap.gap-3::-webkit-scrollbar-thumb {
    background: #9ca3af;
    border-radius: 3px;
  }
}


.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 480px) {
  .content-grid {
    gap: 1.75rem;
  }
}

@media (min-width: 768px) {
  .content-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }
}

@media (min-width: 1024px) {
  .content-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem;
  }
}


.hero {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 2rem 1rem;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
}

@keyframes float {

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

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

.calligraphy {
  font-family: 'Amiri', serif;
  font-weight: 700;
  line-height: 1.2;
}


.stats-container {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.stats-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  padding: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 200px;
  max-width: 300px;
}

.stats-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
}

.stats-number {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stats-label {
  font-size: 0.75rem;
  opacity: 0.8;
}


@media (max-width: 639px) {
  .stats-container {
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.5rem 0;
  }
  
  .stats-card {
    min-width: unset;
    max-width: unset;
    padding: 1rem;
  }
  
  .stats-number {
    font-size: 1.25rem;
  }
  
  .stats-label {
    font-size: 0.75rem;
  }
}


@media (min-width: 640px) {
  .hero {
    padding: 2.5rem 1rem;
    margin-bottom: 2rem;
  }

  .stats-container {
    gap: 1.5rem;
  }

  .stats-card {
    padding: 1.25rem;
  }

  .stats-number {
    font-size: 1.75rem;
  }

  .stats-label {
    font-size: 0.875rem;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 3rem 1rem;
  }

  .stats-container {
    gap: 2rem;
    margin: 2.5rem 0;
  }

  .stats-card {
    padding: 2rem;
    min-width: 220px;
    max-width: 280px;
  }

  .stats-number {
    font-size: 2rem;
    margin-bottom: 0.75rem;
  }

  .stats-label {
    font-size: 0.875rem;
  }
}


.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  border: none;
  font-size: 0.875rem;
  min-height: 44px;
  
  text-align: center;
  white-space: nowrap;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-medium);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: #0f766e;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

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


.category-filter-btn {
  
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
  font-size: 0.875rem;
  min-height: 44px;
  white-space: nowrap;
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.category-filter-btn:hover {
  background: var(--primary-color);
  color: #ffffff;
  transform: translateY(-1px);
}

.category-filter-btn.active {
  
  background: var(--primary-color);
  color: #ffffff;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-medium);
}


@media (max-width: 640px) {
  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.8125rem;
    min-height: 40px;
  }
}

@media (max-width: 480px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    min-height: 36px;
  }
}


.content-type-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
}

.content-type-badge.type-books {
  background: #f59e0b;
}

.content-type-badge.type-articles {
  background: #3b82f6;
}

.content-type-badge.type-fatwa {
  background: #10b981;
}

.content-type-badge.type-audios {
  background: #8b5cf6;
}

.content-type-badge.type-videos {
  background: #ec4899;
}

.content-type-badge.type-quran {
  background: #059669;
}

.content-type-badge.type-poster {
  background: #6366f1;
}

.content-type-badge.type-cards {
  background: #14b8a6;
}

.content-type-badge.type-hadith {
  background: #0ea5e9;
}

.content-type-badge.type-ibntaymiyyah {
  background: #7c3aed;
}


.attachment-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
  min-height: 36px;
  
  word-break: break-all;
  max-width: 100%;
}

.attachment-link:hover {
  background: #f3f4f6;
  transform: translateY(-1px);
  box-shadow: var(--shadow-light);
}


@media (max-width: 640px) {
  .attachment-link {
    padding: 0.375rem 0.625rem;
    font-size: 0.6875rem;
    min-height: 32px;
    gap: 0.375rem;
  }
}

@media (max-width: 480px) {
  .attachment-link {
    padding: 0.25rem 0.5rem;
    font-size: 0.625rem;
    min-height: 28px;
    gap: 0.25rem;
  }
}


.btn-icon {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  
  min-width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.favorite-btn {
  color: #9ca3af;
  transition: all 0.2s ease;
  cursor: pointer;
}

.favorite-btn:hover {
  color: #ef4444;
  transform: scale(1.1);
  background: rgba(239, 68, 68, 0.1);
}

.favorite-btn.favorited {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.favorite-btn.favorited:hover {
  color: #dc2626;
  transform: scale(1.1);
  background: rgba(220, 38, 38, 0.15);
}


@media (max-width: 640px) {
  .btn-icon {
    min-height: 40px;
    min-width: 40px;
    padding: 0.375rem;
  }
}

@media (max-width: 480px) {
  .btn-icon {
    min-height: 36px;
    min-width: 36px;
    padding: 0.25rem;
  }
}


.audio-player-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--audio-player-height);
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  transition: transform 0.3s ease;
}

.audio-player-container.hidden {
  transform: translateY(100%);
}

.audio-player-content {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 8px 1rem;
  max-width: 1200px;
  margin: 0 auto;
  gap: 0.75rem;
  justify-content: space-between;
}

.audio-reciter-select {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  body.reciter-active .audio-progress-container {
    display: none;
  }
}

.audio-info {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.audio-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.audio-subtitle {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1.2;
  margin-top: 2px;
}

.audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.audio-control-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 40px;
  min-width: 40px;
}

.audio-control-btn:hover {
  background: #f3f4f6;
  color: var(--primary-color);
}

.audio-control-btn.active {
  color: var(--primary-color);
  background: var(--accent-color);
}

.play-pause-btn {
  background: var(--primary-color) !important;
  color: white !important;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin: 0 0.25rem;
}

.play-pause-btn:hover {
  background: var(--primary-dark) !important;
  transform: scale(1.05);
}


.audio-progress-container {
  flex: 2 1;
  margin: 0 1rem;
  display: flex;
  align-items: center;
  height: 100%;
}

.audio-progress-bar {
  appearance: none;
  width: 100%;
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.audio-progress-bar::-webkit-slider-thumb {
  appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
  -webkit-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

.audio-progress-bar::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px rgba(5, 150, 105, 0.3);
}

.audio-progress-bar::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}


.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  position: relative;
}

.volume-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.volume-button svg {
  color: var(--text-primary);
}

.volume-button:hover {
  transform: translateY(-1px);
}

.volume-slider-container {
  position: absolute;
  bottom: 120%;
  inset-inline-end: 0;
  background: #ffffff;
  height: 180px;           
  padding: 0.75rem 0.7rem;
  border-radius: 9999px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  display: none;
  align-items: center;
  justify-content: center;
}

.volume-control.open .volume-slider-container {
  display: flex;
}

.volume-slider {
  
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
}


.custom-volume-track {
  position: relative;
  width: 10px;
  height: 160px;
  border-radius: 9999px;
  background: #e5e7eb;
}

.custom-volume-thumb {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%; 
  background: var(--primary-color);
  box-shadow: 0 0 0 2px #ffffff;
}

.audio-secondary-controls {
  display: flex;
  gap: 0.25rem;
  height: 100%;
  align-items: center;
}


@media (max-width: 768px) {
  .audio-player-content {
    padding: 8px 0.75rem;
    gap: 0.5rem;
    row-gap: 0.25rem;
  }

  .audio-progress-container {
    margin: 0 0.5rem;
  }

  .volume-control {
    display: none;
    
  }

  .audio-control-btn:not(.play-pause-btn) {
    min-width: 36px;
    min-height: 36px;
    padding: 0.375rem;
  }
}

@media (max-width: 640px) {
  .audio-player-content {
    padding: 8px 0.5rem;
    gap: 0.25rem;
  }

  .audio-progress-container {
    margin: 0 0.25rem;
  }

  .audio-controls .audio-control-btn:first-child,
  .audio-controls .audio-control-btn:last-child {
    display: none;
    
  }

  .audio-secondary-controls .audio-control-btn:first-child span:last-child {
    display: none;
    
  }
}

@media (max-width: 480px) {
  .audio-info {
    min-width: 80px;
    max-width: 120px;
  }

  .audio-title {
    font-size: 0.75rem;
  }

  .audio-subtitle {
    font-size: 0.6875rem;
  }

  .play-pause-btn {
    width: 40px !important;
    height: 40px !important;
  }

  .audio-control-btn:not(.play-pause-btn) {
    min-width: 32px;
    min-height: 32px;
    padding: 0.25rem;
  }

  .audio-secondary-controls {
    gap: 0;
  }
}


.audio-progress-bar {
  appearance: none;
  background: #e5e7eb;
  border-radius: 2px;
}

.audio-progress-bar::-webkit-slider-thumb {
  appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
  -webkit-transition: all 0.2s ease;
  transition: all 0.2s ease;
}

.audio-progress-bar::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 0 6px rgba(5, 150, 105, 0.3);
}

.audio-progress-bar::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.2);
}


.volume-slider {
  appearance: none;
  background: #e5e7eb;
  border-radius: 2px;
}

.volume-slider::-webkit-slider-thumb {
  appearance: none;
  height: 12px;
  width: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

.volume-slider::-moz-range-thumb {
  height: 12px;
  width: 12px;
  border-radius: 50%;
  border: none;
}


.video-player-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.video-player-modal.hidden {
  display: none;
}

.video-player-content {
  background: black;
  border-radius: 1rem;
  width: 60vw;
  max-width: 900px;
  max-height: 60vh;
  box-shadow: var(--shadow-heavy);
  display: flex;
  flex-direction: column;
}

.video-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid #374151;
}

.video-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.close-video-btn {
  color: #9ca3af;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.close-video-btn:hover {
  color: white;
}

.video-player {
  width: 100%;
  border-radius: 0 0 1rem 1rem;
}


.tafsir-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 10040;
}

.tafsir-modal.hidden {
  display: none;
}

.tafsir-modal-content {
  background: #ffffff;
  border-radius: 0;
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  box-shadow: var(--shadow-heavy);
  border: 1px solid rgba(16, 185, 129, 0.12);
  display: flex;
  flex-direction: column;
}

.tafsir-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: #ffffff;
}

.tafsir-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.tafsir-modal-ayah {
  font-size: 0.8rem;
  opacity: 0.9;
}

.tafsir-modal-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.25rem;
  color: #e5e7eb;
}

.tafsir-modal-close:hover {
  color: #ffffff;
}

.tafsir-modal-body {
  padding: 1rem 1.25rem 1.25rem;
  background: #f9fafb;
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tafsir-sources-scroll {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  padding-top: 0.25rem;
}

.tafsir-sources-scroll::-webkit-scrollbar {
  height: 6px;
}

.tafsir-sources-scroll::-webkit-scrollbar-track {
  background: #eef2f7;
  border-radius: 3px;
}

.tafsir-sources-scroll::-webkit-scrollbar-thumb {
  background: #9ca3af;
  border-radius: 3px;
}

.tafsir-source-btn {
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 0.4rem 0.9rem;
}


#tafsirModalResult {
  margin-top: 0.75rem;
  padding: 0.75rem 0.5rem 0.25rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

@media (max-width: 640px) {
  .tafsir-modal {
    padding: 0.75rem;
    align-items: flex-start;
  }

  .tafsir-modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
  }

  .tafsir-modal-header {
    padding: 0.75rem 1rem;
  }

  .tafsir-modal-body {
    padding: 0.75rem 1rem 1rem;
  }

  .tafsir-source-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.75rem;
  }
}


.loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid #e5e7eb;
  border-top: 2px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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




@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }

  .hero h2 {
    font-size: 1.5rem !important;
  }

  .hero p {
    font-size: 1rem !important;
  }

  .stats-card {
    padding: 0.875rem !important;
  }
}


@media (min-width: 481px) and (max-width: 640px) {
  .container {
    padding: 0 1rem;
  }
}


@media (min-width: 641px) and (max-width: 768px) {
  .container {
    padding: 0 1.25rem;
  }
}


@media (min-width: 769px) {
  .container {
    padding: 0 1.5rem;
  }
}


* {
  max-width: 100%;
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
  width: 100%;
}

.App {
  width: 100%;
  overflow-x: hidden;
}


.flex-wrap-mobile {
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .flex-wrap-mobile {
    flex-direction: column;
  }
}


@media (max-width: 480px) {
  html {
    font-size: 14px;
    
  }

  .calligraphy {
    font-size: 1.25rem !important;
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  html {
    font-size: 15px;
  }
}

@media (min-width: 769px) {
  html {
    font-size: 16px;
  }
}


.arabic-text {
  font-family: 'Cairo', sans-serif;
  line-height: 1.8;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fade-in {
  animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

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


.search-input:focus,
.btn:focus,
.nav-link:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}




@media print {

  .audio-player-container,
  .nav-header,
  .search-container {
    display: none;
  }

  .card {
    page-break-inside: avoid;
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }
}


.pagination-container {
  margin-top: 2rem;
  padding: 1.5rem 0;
  border-top: 1px solid #e5e7eb;
}

.pagination-info {
  text-align: center;
  margin-bottom: 1rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pagination-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary-color);
  background: white;
  color: var(--primary-color);
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 0.875rem;
  min-height: 44px;
  
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

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

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

.pagination-number {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid #e5e7eb;
  background: white;
  color: var(--text-primary);
  border-radius: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  min-height: 44px;
  
  min-width: 44px;
}

.pagination-number:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.pagination-number.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}


@media (max-width: 480px) {
  .pagination-container {
    margin-top: 1.5rem;
    padding: 1rem 0;
  }

  .pagination-controls {
    gap: 0.25rem;
    flex-direction: column;
  }

  .pagination-controls>div:first-child {
    order: 2;
    
  }

  .pagination-pages {
    order: 1;
    margin: 0 0 0.5rem 0;
  }

  .pagination-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    min-height: 40px;
  }

  .pagination-number {
    width: 2rem;
    height: 2rem;
    font-size: 0.75rem;
    min-height: 40px;
    min-width: 40px;
  }

  .pagination-info {
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
  }

  
  .pagination-pages .pagination-number:nth-child(n+6) {
    display: none;
  }
}

@media (min-width: 481px) and (max-width: 640px) {
  .pagination-controls {
    gap: 0.375rem;
  }

  .pagination-btn {
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
  }

  .pagination-pages {
    margin: 0 0.75rem;
  }

  .pagination-number {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 0.8125rem;
  }
}


.audio-queue-modal {
  position: fixed;
  bottom: var(--audio-player-height);
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
  max-height: 50vh;
  z-index: 10000;
  animation: slideUpQueue 0.3s ease;
}

@keyframes slideUpQueue {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.audio-queue-content {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 1200px;
  margin: 0 auto;
}

.audio-queue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.audio-queue-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.audio-queue-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.audio-queue-clear {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: background-color 0.2s ease;
  font-weight: 500;
}

.audio-queue-clear:hover {
  background: rgba(239, 68, 68, 0.1);
}

.audio-queue-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 0.25rem;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  min-width: 32px;
}

.audio-queue-close:hover {
  background: #f3f4f6;
  color: var(--text-primary);
}

.audio-queue-list {
  flex: 1 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.queue-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: transparent;
  border-radius: 0.5rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
  min-height: 64px;
}

.queue-item:hover {
  background: #f9fafb;
  border-color: #e5e7eb;
}

.queue-item.active {
  background: var(--accent-color);
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.queue-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.75rem;
  color: #6b7280;
  flex-shrink: 0;
}

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

.queue-item-content {
  flex: 1 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.queue-item-title {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.queue-item.active .queue-item-title {
  font-weight: 600;
  color: var(--primary-color);
}

.queue-item-type {
  font-size: 0.75rem;
  color: #6b7280;
  line-height: 1;
}

.queue-item-remove {
  background: none;
  border: none;
  color: #ef4444;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
  min-height: 32px;
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.queue-item-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: scale(1.1);
}


@media (max-width: 640px) {
  .audio-queue-modal {
    max-height: 60vh;
  }

  .audio-queue-header {
    padding: 0.75rem;
  }

  .audio-queue-title {
    font-size: 0.875rem;
  }

  .audio-queue-clear {
    font-size: 0.6875rem;
  }

  .audio-queue-list {
    padding: 0.25rem;
  }

  .queue-item {
    padding: 0.5rem;
    min-height: 56px;
  }

  .queue-item-icon {
    width: 28px;
    height: 28px;
    margin-left: 0.5rem;
  }

  .queue-item-title {
    font-size: 0.8125rem;
  }

  .queue-item-type {
    font-size: 0.6875rem;
  }

  .queue-item-remove {
    min-height: 28px;
    min-width: 28px;
    padding: 0.375rem;
  }
}

@media (max-width: 480px) {
  .audio-queue-modal {
    max-height: 70vh;
  }

  .audio-queue-header {
    padding: 0.5rem;
  }

  .queue-item {
    padding: 0.375rem;
    min-height: 48px;
  }

  .queue-item-icon {
    width: 24px;
    height: 24px;
    margin-left: 0.375rem;
  }

  .queue-item-title {
    font-size: 0.75rem;
  }

  .queue-item-remove {
    min-height: 24px;
    min-width: 24px;
    padding: 0.25rem;
  }

  .queue-item-remove svg {
    width: 14px;
    height: 14px;
  }
}



.audio-loader {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top: 2.5px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.audio-loader-dots {
  display: inline-block;
  position: relative;
  width: 24px;
  height: 24px;
}

.audio-loader-dots div {
  position: absolute;
  top: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ffffff;
  animation: audio-loader-dots 1.2s linear infinite;
  transform: translateY(-50%);
}

.audio-loader-dots div:nth-child(1) {
  left: 2px;
  animation-delay: 0s;
}

.audio-loader-dots div:nth-child(2) {
  left: 10px;
  animation-delay: -0.4s;
}

.audio-loader-dots div:nth-child(3) {
  left: 18px;
  animation-delay: -0.8s;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes audio-loader-dots {
  0%, 80%, 100% {
    transform: translateY(-50%) scale(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-50%) scale(1);
    opacity: 1;
  }
}


.audio-loader-pulse {
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}


.home-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.welcome-section {
  text-align: center;
  margin-bottom: 3rem;
  padding: 2rem;
  background: linear-gradient(135deg, rgba(5, 150, 105, 0.05) 0%, rgba(255, 255, 255, 0.8) 100%);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
}

.welcome-section h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-section p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.total-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  min-width: 120px;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}


.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.category-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-light);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

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

.category-card:hover::before {
  transform: scaleX(1);
}

.category-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.category-info {
  flex: 1;
}

.category-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.category-count {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.category-arrow {
  color: var(--text-secondary);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.category-card:hover .category-arrow {
  color: var(--primary-color);
  transform: translateX(-4px);
}


@media (max-width: 768px) {
  .welcome-section {
    padding: 1.5rem;
    margin-bottom: 2rem;
  }
  
  .welcome-section h2 {
    font-size: 2rem;
  }
  
  .welcome-section p {
    font-size: 1rem;
  }
  
  .categories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .category-card {
    padding: 1rem;
  }
  
  .category-icon {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
  
  .total-stats {
    gap: 1rem;
  }
  
  .stat-item {
    min-width: 100px;
    padding: 0.75rem;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
}

@media (max-width: 480px) {
  .home-content {
    padding: 1rem 0.5rem;
  }
  
  .welcome-section {
    padding: 1rem;
  }
  
  .welcome-section h2 {
    font-size: 1.75rem;
  }
  
  .category-card {
    padding: 0.75rem;
    gap: 0.75rem;
  }
  
  .category-info h3 {
    font-size: 1.1rem;
  }
}

.fatwa-content {
    padding-right: 1rem;
}


.fatwa-scroll-wrapper {
    max-height: 300px;
    padding-right: 0.25rem;
}

.fatwa-collapsed {
    max-height: 300px;
    overflow-y: hidden;
}

.fatwa-expanded {
    max-height: 300px;
    overflow-y: auto;
}

.question-text {
    color: #065f46;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.answer-text {
    color: #374151;
    line-height: 1.6;
}

.audio-link {
    background-color: #f0fdf4;
    border-color: #bbf7d0;
}

.fatwa-mufti {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    font-size: 0.75rem;
    color: #4b5563;
}

.read-more-btn {
    color: #065f46;
    font-size: 0.8rem;
    margin-top: 0.5rem;
    display: inline-block;
    cursor: pointer;
}

.read-more-btn:hover {
    text-decoration: underline;
}


.hadith-card {
    min-height: 260px;
    max-height: none;
}

.hadith-content {
    padding-right: 1rem;
}

.hadith-scroll-wrapper {
    max-height: 230px;
    padding-right: 0.25rem;
}

.hadith-collapsed {
    max-height: 230px;
    overflow-y: hidden;
}

.hadith-expanded {
    max-height: 230px;
    overflow-y: auto;
}

.hadith-text {
    color: #065f46;
    line-height: 1.8;
}

.hadith-sharh {
    color: #374151;
    line-height: 1.7;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.hadith-meta {
    border-top: 1px solid #e5e7eb;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    font-size: 0.8rem;
}

.hadith-meta-item {
    margin-bottom: 0.25rem;
}

.hadith-label {
    font-weight: 600;
    color: #374151;
    margin-left: 0.25rem;
}

.hadith-value {
    color: #111827;
}

.hadith-sharh-placeholder {
    margin-top: 0.25rem;
}