﻿    :root {
      --primary: #ae2152;
      --primary-dark: #173469;
      --primary-light: #99b4d6;
      --bg-cream: #faf3eb;
      --bg-light: #f2f2f2;
      --border-color: #e6e6e6;
      --text-dark: #333;
      --text-medium: #666;
      --text-light: #818181;
      --gray-medium: #b3b3b3;
      --gray-dark: gray;
      --white: #fff;
      --shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
      --radius: 18px;
      --radius-lg: 28px;
    }

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


    /* ===== HEADER ===== */
    .header {
      background: #ffffff;
      text-align: center;
      position: relative;
      overflow: hidden;
    }

    .header::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: radial-gradient(circle at 50% 120%, rgba(255, 255, 255, 0.08) 0%, transparent 60%);
    }

    .header-icon {
      width: 80px;
      height: 80px;
      margin: 0 auto 16px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .header-icon svg {
      width: 70px;
      height: 70px;
    }

    .header h1 {
      font-family: 'Amiri', serif;
      font-size: 34px;
      font-weight: 700;
      color: var(--white);
      letter-spacing: 2px;
      position: relative;
    }

    /* ===== CONTAINER ===== */
    .container {
      max-width: 1100px;
      margin: 0 auto;
      padding: 0 20px;
    }

    /* ===== SECTION CARD ===== */
    .section-card {
      background: var(--white);
      border-radius: var(--radius-lg);
      border: 1px solid var(--border-color);
      margin: 30px auto;
      padding: 30px;
      box-shadow: var(--shadow);
      max-width: 1100px;
      position: relative;
      overflow: hidden;
    }

    .section-title {
      font-family: 'Tajawal', sans-serif;
      font-size: 26px;
      font-weight: 700;
      color: var(--text-dark);
      margin-bottom: 24px;
      text-align: right;
    }

    .section-title-header {
      font-family: 'Tajawal', sans-serif;
      font-size: 26px;
      font-weight: 700;
      color: #000000;
      background: #ffffff;
      margin: 0;
      padding: 20px 30px;
      text-align: right;
      direction: rtl;
    }

    /* ===== SECTION 1: الاستماع لمصاحف الروايات ===== */
    .listeners-table {
      width: 100%;
      border-collapse: separate;
      border-spacing: 0 6px;
    }

    .listener-row {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 0;
      border-bottom: 1px solid var(--border-color);
    }

    .listener-row:last-child {
      border-bottom: none;
    }

    .listener-row .listen-btn {
      display: flex;
      align-items: center;
      gap: 6px;
      color: var(--text-light);
      font-size: 15px;
      cursor: pointer;
      white-space: nowrap;
      transition: color 0.2s;
      text-decoration: none;
      border: none;
      background: none;
      font-family: inherit;
    }

    .listener-row .listen-btn:hover {
      color: var(--primary);
    }

    .listener-row .listen-btn .arrow {
      font-size: 14px;
    }

    .listener-row .reader-name {
      flex: 1;
      font-size: 18px;
      color: var(--text-dark);
      text-align: center;
    }

    .listener-row .reader-name span {
      border-bottom: 1px solid var(--border-color);
      padding-bottom: 2px;
      display: inline-block;
      min-width: 200px;
      text-align: center;
    }

    .pill-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 8px 28px;
      border-radius: 30px;
      font-size: 17px;
      font-weight: 500;
      cursor: pointer;
      text-decoration: none;
      border: none;
      font-family: inherit;
      transition: all 0.2s;
      min-width: 130px;
    }

    .pill-btn.gray {
      background: var(--gray-medium);
      color: var(--white);
    }

    .pill-btn.gray:hover {
      background: #999;
    }

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

    .pill-btn.active:hover {
      background: #c42a63;
    }

    .listener-row .pills-area {
      display: flex;
      gap: 8px;
    }

    /* Highlighted row */
    .listener-row.highlighted .pill-btn.reading {
      background: var(--primary);
    }

    /* ===== PAGINATION ===== */
    .pagination {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 16px;
      margin-top: 24px;
      padding-top: 16px;
    }

    .pagination a {
      color: var(--text-medium);
      text-decoration: none;
      font-size: 20px;
      font-weight: 500;
      transition: color 0.2s;
    }

    .pagination a:hover {
      color: var(--primary);
    }

    .pagination .page-num {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      font-size: 18px;
      color: var(--text-medium);
    }

    .pagination .page-num.current {
      font-size: 24px;
      font-weight: 700;
      color: var(--text-dark);
    }

    .pagination .nav-arrow {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      font-size: 18px;
      color: var(--text-medium);
      cursor: pointer;
    }

    .pagination .nav-arrow svg {
      width: 14px;
      height: 14px;
    }

    /* ===== SECTION 2: تصفح مصاحف الروايات ===== */
    .browse-selectors {
      display: flex;
      gap: 12px;
      margin-bottom: 20px;
      justify-content: center;
    }

    .selector-pill {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      padding: 10px 32px;
      border-radius: 30px;
      font-size: 18px;
      font-weight: 500;
      cursor: pointer;
      font-family: inherit;
      border: none;
      transition: all 0.2s;
    }

    .selector-pill.red {
      background: var(--primary);
      color: var(--white);
    }

    .selector-pill.dark {
      background: var(--primary);
      color: var(--white);
    }

    .selector-pill .chevron {
      font-size: 12px;
      opacity: 0.8;
    }

    .quran-pages-viewer {
      background: var(--gray-medium);
      border-radius: 12px;
      overflow: hidden;
      display: flex;
      min-height: 500px;
      position: relative;
    }

    .quran-page {
      flex: 1;
      background: var(--bg-cream);
      padding: 30px 24px;
      position: relative;
      display: flex;
      flex-direction: column;
    }

    .quran-page:first-child {
      border-left: 3px solid var(--gray-medium);
    }

    .quran-page .page-border {
      border: 2px solid #c9a96e;
      border-radius: 4px;
      padding: 20px 16px;
      flex: 1;
      display: flex;
      flex-direction: column;
      position: relative;
    }

    .quran-page .page-border::before {
      content: '';
      position: absolute;
      top: 4px;
      left: 4px;
      right: 4px;
      bottom: 4px;
      border: 1px solid #d4b98a;
      border-radius: 2px;
      pointer-events: none;
    }

    .quran-text-line {
      font-family: 'Noto Naskh Arabic', 'Amiri', serif;
      font-size: 16px;
      line-height: 2.2;
      text-align: justify;
      color: #2c1810;
      padding: 0 8px;
    }

    .surah-header {
      background: linear-gradient(135deg, #c9a96e 0%, #a8884e 100%);
      color: var(--white);
      text-align: center;
      padding: 6px 16px;
      border-radius: 6px;
      font-family: 'Amiri', serif;
      font-size: 18px;
      font-weight: 700;
      margin-bottom: 12px;
    }

    .page-number {
      text-align: center;
      font-family: 'Amiri', serif;
      font-size: 16px;
      color: #8b7355;
      margin-top: 12px;
    }

    /* ===== SECTION 3: مكتبة القرآن ===== */
    .library-grid {
      display: grid;
      grid-template-columns: repeat(9, 1fr);
      gap: 12px;
      padding: 10px 0;
    }

    .library-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      cursor: pointer;
      transition: transform 0.2s;
      padding: 10px;
    }

    .library-item:hover {
      transform: translateY(-4px);
    }

    .library-icon {
      width: 72px;
      height: 72px;
      margin-bottom: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .library-icon svg {
      width: 60px;
      height: 60px;
    }

    .library-icon .icon-circle {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 28px;
    }

    .library-item .lib-label {
      font-size: 18px;
      font-weight: 600;
      color: var(--text-dark);
    }

    /* ===== SECTIONS 4 & 5: فتاوى / مقالات ===== */
    .fatwa-section {
      display: flex;
      gap: 0;
      align-items: stretch;
      padding: 20px;
    }

    .fatwa-sidebar {
      width: 280px;
      background: var(--primary-dark);
      border-radius: 0 var(--radius) var(--radius) 0;
      padding: 24px 16px;
      flex-shrink: 0;
      max-height: 600px;
      overflow-y: auto;
    }

    .fatwa-sidebar::-webkit-scrollbar {
      width: 5px;
    }

    .fatwa-sidebar::-webkit-scrollbar-track {
      background: transparent;
    }

    .fatwa-sidebar::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.25);
      border-radius: 10px;
    }

    .fatwa-sidebar .sidebar-title {
      font-size: 24px;
      font-weight: 700;
      color: var(--white);
      margin-bottom: 20px;
      padding-bottom: 10px;
      border-bottom: 1px solid rgba(99, 140, 198, 0.3);
    }

    .fatwa-sidebar .sidebar-item {
      display: block;
      padding: 8px 12px;
      color: var(--primary-light);
      font-size: 16px;
      text-decoration: none;
      border-bottom: 1px solid rgba(99, 140, 198, 0.2);
      transition: all 0.2s;
      cursor: pointer;
    }

    .fatwa-sidebar .sidebar-item:hover,
    .fatwa-sidebar .sidebar-item.active {
      color: var(--white);
      background: rgba(255, 255, 255, 0.08);
    }

    .fatwa-sidebar .sidebar-item .arrow-icon {
      float: left;
      color: var(--white);
      opacity: 0.7;
    }

    .fatwa-content {
      flex: 1;
      padding: 16px 24px 0;
      max-height: 600px;
      overflow-y: auto;
    }

    .fatwa-content::-webkit-scrollbar {
      width: 5px;
    }

    .fatwa-content::-webkit-scrollbar-track {
      background: transparent;
    }

    .fatwa-content::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
    }

    .fatwa-item {
      padding: 18px 0;
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 16px;
    }

    .fatwa-item:last-child {
      border-bottom: none;
    }

    .fatwa-item .fatwa-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--text-dark);
      margin-bottom: 6px;
      text-decoration: none;
    }

    .fatwa-item .fatwa-title:hover {
      text-decoration: underline;
    }

    .fatwa-item .fatwa-excerpt {
      font-size: 17px;
      color: var(--text-dark);
      margin-bottom: 8px;
      line-height: 1.6;
    }

    .fatwa-item .more-link {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      color: var(--text-light);
      font-size: 15px;
      text-decoration: none;
      transition: color 0.2s;
      flex-shrink: 0;
      white-space: nowrap;
    }

    .fatwa-item .more-link:hover {
      color: var(--primary);
    }

    /* ===== ICONS (inline SVGs) ===== */
    .icon-color-1 {
      color: #ae2152;
    }

    .icon-color-2 {
      color: #173469;
    }

    .icon-color-3 {
      color: #3a7bd5;
    }

    .icon-color-4 {
      color: #e74c3c;
    }

    .icon-color-5 {
      color: #2ecc71;
    }

    /* ===== RESPONSIVE ===== */
    @media (max-width: 900px) {
      .library-grid {
        grid-template-columns: repeat(5, 1fr);
      }

      .fatwa-section {
        flex-direction: column;
      }

      .fatwa-sidebar {
        width: 100%;
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: 200px;
        overflow-y: auto;
        padding: 12px 16px;
      }

      .fatwa-sidebar .sidebar-title {
        width: 100%;
        font-size: 18px;
        margin-bottom: 10px;
        padding-bottom: 8px;
      }

      .fatwa-sidebar .sidebar-item {
        font-size: 14px;
        padding: 6px 12px;
      }

      .quran-pages-viewer {
        flex-direction: column;
      }

      .quran-page:first-child {
        border-left: none;
        border-bottom: 3px solid var(--gray-medium);
      }

      .browse-selectors {
        flex-direction: column;
        align-items: center;
      }
    }

    @media (max-width: 600px) {
      .library-grid {
        grid-template-columns: repeat(3, 1fr);
      }

      .section-card {
        padding: 20px 14px;
        margin: 20px 10px;
      }

      .header h1 {
        font-size: 26px;
      }

      .listener-row {
        flex-wrap: wrap;
        gap: 6px;
      }

      .listener-row .pills-area {
        width: 100%;
        justify-content: center;
      }

      .section-title {
        font-size: 20px;
      }

      .fatwa-item .fatwa-title {
        font-size: 14px;
        margin-bottom: 2px;
      }

      .fatwa-item .more-link {
        font-size: 13px;
      }

      .fatwa-content {
        padding: 0 14px;
        max-height: 400px;
      }

      .fatwa-item {
        padding: 12px 0;
      }
    }

    /* ===== ANIMATIONS ===== */
    .section-card {
      animation: fadeInUp 0.5s ease both;
    }

    .section-card:nth-child(1) {
      animation-delay: 0.05s;
    }

    .section-card:nth-child(2) {
      animation-delay: 0.1s;
    }

    .section-card:nth-child(3) {
      animation-delay: 0.15s;
    }

    .section-card:nth-child(4) {
      animation-delay: 0.2s;
    }

    .section-card:nth-child(5) {
      animation-delay: 0.25s;
    }

    @keyframes fadeInUp {
      from {
        opacity: 0;
        transform: translateY(24px);
      }

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

    .lib-icon {
      width: 100%;
      transition: transform 0.2s;
    }

    .library-item:hover .lib-icon {
      transform: scale(1.08);
    }

    /* ===== 3-COLUMN QURAN EXPLORER ===== */
    .quran-explorer {
      display: flex;
      gap: 0;
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid var(--border-color);
      min-height: 500px;
      max-height: 600px;
    }

    .explorer-col {
      display: flex;
      flex-direction: column;
      min-width: 0;
    }

    .col-rewayat {
      flex: 1;
      background: var(--primary-dark);
    }

    .col-readers {
      flex: 1.2;
      background: #f8f6f4;
      border-right: 1px solid var(--border-color);
      border-left: 1px solid var(--border-color);
    }

    .col-suras {
      flex: 1.5;
      background: var(--white);
    }

    .col-header {
      padding: 14px 18px;
      font-size: 18px;
      font-weight: 700;
      text-align: center;
      flex-shrink: 0;
    }

    .col-rewayat .col-header {
      background: rgba(0, 0, 0, 0.15);
      color: var(--white);
    }

    .col-readers .col-header {
      background: #ece8e3;
      color: var(--text-dark);
      border-bottom: 1px solid var(--border-color);
    }

    .col-suras .col-header {
      background: var(--primary);
      color: var(--white);
    }

    .col-scroll {
      flex: 1;
      overflow-y: auto;
      padding: 6px 0;
    }

    .col-scroll::-webkit-scrollbar {
      width: 5px;
    }

    .col-scroll::-webkit-scrollbar-track {
      background: transparent;
    }

    .col-scroll::-webkit-scrollbar-thumb {
      background: rgba(0, 0, 0, 0.2);
      border-radius: 10px;
    }

    .col-placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 100%;
      color: var(--text-light);
      font-size: 18px;
      opacity: 0.6;
    }

    .explorer-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 18px;
      cursor: pointer;
      transition: all 0.15s;
      border-bottom: 1px solid rgba(0, 0, 0, 0.06);
      gap: 8px;
    }

    /* الروايات */
    .col-rewayat .explorer-item {
      color: rgba(255, 255, 255, 0.85);
      border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .col-rewayat .explorer-item:hover {
      background: rgba(255, 255, 255, 0.1);
      color: var(--white);
    }

    .col-rewayat .explorer-item.selected {
      background: rgba(255, 255, 255, 0.18);
      color: var(--white);
      font-weight: 600;
      border-right: 4px solid var(--white);
    }

    /* القراء */
    .col-readers .explorer-item {
      color: var(--text-dark);
    }

    .col-readers .explorer-item:hover {
      background: rgba(174, 33, 82, 0.06);
    }

    .col-readers .explorer-item.selected {
      background: rgba(174, 33, 82, 0.1);
      color: var(--primary);
      font-weight: 600;
      border-right: 4px solid var(--primary);
    }

    .item-name {
      font-size: 16px;
      line-height: 1.4;
    }

    .item-badge {
      font-size: 13px;
      padding: 2px 10px;
      border-radius: 20px;
      white-space: nowrap;
      flex-shrink: 0;
    }

    .col-rewayat .item-badge {
      background: rgba(255, 255, 255, 0.15);
      color: rgba(255, 255, 255, 0.8);
    }

    .col-readers .item-badge {
      background: var(--gray-medium);
      color: var(--white);
      font-size: 12px;
    }

    /* رأس القارئ في عمود السور */
    .sura-reader-header {
      padding: 16px 18px;
      background: linear-gradient(135deg, #f8f6f4, #ece8e3);
      border-bottom: 2px solid var(--primary);
      text-align: center;
    }

    .sura-reader-name {
      font-size: 20px;
      font-weight: 700;
      color: var(--text-dark);
      margin-bottom: 4px;
    }

    .sura-reader-rwaya {
      font-size: 14px;
      color: var(--text-light);
      margin-bottom: 8px;
    }

    .sura-reader-link {
      display: inline-block;
      font-size: 13px;
      color: var(--primary);
      text-decoration: none;
      padding: 4px 14px;
      border: 1px solid var(--primary);
      border-radius: 20px;
      transition: all 0.2s;
    }

    .sura-reader-link:hover {
      background: var(--primary);
      color: var(--white);
    }

    /* عناصر السور */
    .sura-item {
      display: flex;
      align-items: center;
      padding: 10px 18px;
      border-bottom: 1px solid rgba(0, 0, 0, 0.05);
      gap: 12px;
      transition: background 0.15s;
    }

    .sura-item:hover {
      background: rgba(174, 33, 82, 0.04);
    }

    .sura-num {
      width: 28px;
      height: 28px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      background: var(--gray-medium);
      color: var(--white);
      border-radius: 50%;
      font-size: 12px;
      font-weight: 600;
      flex-shrink: 0;
    }

    .sura-name {
      flex: 1;
      font-size: 16px;
      color: var(--text-dark);
    }

    .sura-actions {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-shrink: 0;
    }

    .sura-play-btn {
      width: 34px;
      height: 34px;
      border-radius: 50%;
      border: none;
      background: var(--primary);
      color: var(--white);
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      transition: all 0.2s;
      padding: 0;
    }

    .sura-play-btn:hover {
      background: #c42a63;
      transform: scale(1.1);
    }

    .sura-play-btn.playing {
      background: #e74c3c;
    }

    .sura-play-btn.playing:hover {
      background: #c0392b;
    }

    /* Inline audio player bar */
    .sura-player-bar {
      display: flex;
      align-items: center;
      gap: 10px;
      padding: 8px 18px 10px;
      background: linear-gradient(135deg, #faf8f6, #f0ece8);
      border-bottom: 1px solid rgba(0, 0, 0, 0.06);
      animation: slideDown 0.2s ease;
      direction: ltr;
    }

    @keyframes slideDown {
      from {
        opacity: 0;
        max-height: 0;
        padding: 0 18px;
      }

      to {
        opacity: 1;
        max-height: 60px;
        padding: 8px 18px 10px;
      }
    }

    .player-time {
      font-size: 12px;
      color: var(--text-light);
      font-family: 'Courier New', monospace;
      min-width: 42px;
      text-align: center;
      user-select: none;
    }

    .player-progress-wrap {
      flex: 1;
      height: 6px;
      background: var(--border-color);
      border-radius: 3px;
      cursor: pointer;
      position: relative;
      overflow: hidden;
    }

    .player-progress-wrap:hover {
      height: 8px;
    }

    .player-progress-fill {
      height: 100%;
      background: var(--primary);
      border-radius: 3px;
      width: 0%;
      transition: width 0.1s linear;
    }

    .sura-dl-btn {
      width: 30px;
      height: 30px;
      border-radius: 50%;
      border: 1px solid var(--border-color);
      background: var(--white);
      color: var(--text-medium);
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-decoration: none;
      transition: all 0.2s;
    }

    .sura-dl-btn:hover {
      background: var(--gray-light);
      color: var(--primary);
    }

    /* Responsive */
    @media (max-width: 900px) {
      .quran-explorer {
        flex-direction: column;
        max-height: none;
      }

      .explorer-col {
        max-height: 300px;
      }

      .col-rewayat .explorer-item.selected {
        border-right: none;
        border-bottom: 3px solid var(--white);
      }

      .col-readers .explorer-item.selected {
        border-right: none;
        border-bottom: 3px solid var(--primary);
      }
    }

    /* Loading overlay */
    .explorer-loading {
      position: absolute;
      inset: 0;
      background: rgba(255, 255, 255, 0.92);
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 14px;
      z-index: 10;
      transition: opacity 0.3s;
    }

    .explorer-loading.hidden {
      opacity: 0;
      pointer-events: none;
    }

    .spinner {
      width: 40px;
      height: 40px;
      border: 4px solid var(--border-color);
      border-top-color: var(--primary);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }

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

    .explorer-loading span {
      font-size: 16px;
      color: var(--text-light);
    }


    /* === Qiraat Browser Styles === */
    .qiraat-browser {
      display: flex;
      gap: 0;
      border-radius: 12px;
      overflow: hidden;
      border: 1px solid var(--border-color);
      min-height: 500px;
      max-height: 650px;
      direction: rtl;
    }

    /* Full-width mode when viewing a book */
    .qiraat-browser.book-active {
      max-height: none;
    }

    .qiraat-browser.book-active .qiraat-sidebar {
      display: none;
    }

    .qiraat-sidebar {
      width: 240px;
      min-width: 200px;
      background: var(--primary-dark);
      display: flex;
      flex-direction: column;
      flex-shrink: 0;
    }

    .qiraat-sidebar .col-header {
      padding: 14px 18px;
      font-size: 18px;
      font-weight: 700;
      text-align: center;
      color: var(--white);
      background: rgba(0, 0, 0, 0.15);
      flex-shrink: 0;
    }

    .qiraat-sidebar .col-scroll {
      flex: 1;
      overflow-y: auto;
    }

    .qiraat-rwaya-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 16px;
      cursor: pointer;
      color: rgba(255, 255, 255, 0.85);
      font-size: 15px;
      font-weight: 600;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      transition: all 0.15s;
    }

    .qiraat-rwaya-item:hover {
      background: rgba(255, 255, 255, 0.08);
    }

    .qiraat-rwaya-item.selected {
      background: rgba(255, 255, 255, 0.15);
      color: #fff;
      border-right: 4px solid #fff;
    }

    .qiraat-rwaya-item .badge {
      background: rgba(255, 255, 255, 0.15);
      color: #fff;
      font-size: 12px;
      padding: 2px 8px;
      border-radius: 10px;
    }

    /* Main content area */
    .qiraat-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      background: var(--white);
      min-width: 0;
    }

    .qiraat-content-header {
      padding: 16px 24px;
      background: linear-gradient(135deg, #f8f6f4, #f0ece8);
      border-bottom: 1px solid var(--border-color);
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 12px;
      flex-shrink: 0;
    }

    .qiraat-content-header .rwaya-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--text-dark);
    }

    .qiraat-dl-all {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--primary);
      color: #fff;
      border: none;
      padding: 8px 16px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      text-decoration: none;
      transition: background 0.2s;
      flex-shrink: 0;
    }

    .qiraat-dl-all:hover {
      background: #c42a63;
    }

    .qiraat-dl-all svg {
      width: 16px;
      height: 16px;
    }

    /* Sura grid */
    .qiraat-sura-grid {
      flex: 1;
      overflow-y: auto;
      padding: 16px;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 10px;
      align-content: start;
    }

    .qiraat-sura-card {
      background: #faf8f6;
      border: 1px solid var(--border-color);
      border-radius: 10px;
      padding: 14px 12px;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 6px;
    }

    .qiraat-sura-card:hover {
      background: #fff;
      border-color: var(--primary);
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }

    .qiraat-sura-card .sura-idx {
      width: 28px;
      height: 28px;
      background: var(--primary);
      color: #fff;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 13px;
      font-weight: 700;
    }

    .qiraat-sura-card .sura-label {
      font-size: 14px;
      font-weight: 600;
      color: var(--text-dark);
      line-height: 1.3;
    }

    .qiraat-sura-card .pdf-icon {
      color: #e74c3c;
      font-size: 12px;
      font-weight: 700;
      background: rgba(231, 76, 60, 0.1);
      padding: 2px 8px;
      border-radius: 4px;
    }

    .qiraat-placeholder {
      display: flex;
      align-items: center;
      justify-content: center;
      flex: 1;
      color: var(--text-light);
      font-size: 18px;
    }

    /* PDF modal */
    .pdf-modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.7);
      z-index: 9999;
      display: flex;
      align-items: center;
      justify-content: center;
      animation: fadeIn 0.2s ease;
    }

    @keyframes fadeIn {
      from {
        opacity: 0;
      }

      to {
        opacity: 1;
      }
    }

    .pdf-modal {
      background: #fff;
      border-radius: 16px;
      width: 92vw;
      height: 90vh;
      max-width: 1100px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }

    .pdf-modal-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 14px 20px;
      background: var(--primary-dark);
      color: #fff;
      flex-shrink: 0;
      direction: rtl;
    }

    .pdf-modal-title {
      font-size: 17px;
      font-weight: 700;
    }

    .pdf-modal-actions {
      display: flex;
      gap: 8px;
    }

    .pdf-modal-btn {
      background: rgba(255, 255, 255, 0.15);
      color: #fff;
      border: none;
      padding: 8px 14px;
      border-radius: 8px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 600;
      transition: background 0.2s;
      display: inline-flex;
      align-items: center;
      gap: 5px;
      text-decoration: none;
    }

    .pdf-modal-btn:hover {
      background: rgba(255, 255, 255, 0.25);
    }

    .pdf-modal-btn.close-btn {
      background: rgba(255, 255, 255, 0.1);
    }

    .pdf-modal-body {
      flex: 1;
      background: #eee;
    }

    .pdf-modal-body iframe {
      width: 100%;
      height: 100%;
      border: none;
    }

    @media (max-width: 768px) {
      .qiraat-browser {
        flex-direction: column;
        max-height: none;
      }

      .qiraat-sidebar {
        width: 100%;
        max-height: 200px;
      }

      .qiraat-content-header {
        flex-direction: column;
        text-align: center;
        padding: 12px 16px;
        gap: 10px;
      }

      .qiraat-content-header .rwaya-title {
        font-size: 16px;
      }

      .qiraat-dl-all {
        width: 100%;
        justify-content: center;
        padding: 10px;
      }

      .qiraat-sura-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        max-height: 400px;
        overflow-y: auto;
      }

      .pdf-modal {
        width: 98vw;
        height: 95vh;
        border-radius: 8px;
      }

      .book-toolbar {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
        padding: 10px;
      }
    }


    /* Book viewer inline styles */
    .book-toolbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 20px;
      background: linear-gradient(135deg, #f8f6f4, #f0ece8);
      border-bottom: 1px solid var(--border-color);
      gap: 12px;
    }

    .book-back-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: var(--primary-dark);
      color: #fff;
      border: none;
      padding: 8px 16px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: background 0.2s;
    }

    .book-back-btn:hover {
      background: #3a2a3a;
    }

    .book-sura-title {
      font-size: 18px;
      font-weight: 700;
      color: var(--text-dark);
      flex: 1;
      text-align: center;
    }

    .book-dl-btn {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      background: var(--primary);
      color: #fff;
      border: none;
      padding: 8px 14px;
      border-radius: 8px;
      font-size: 13px;
      font-weight: 600;
      cursor: pointer;
      text-decoration: none;
      transition: background 0.2s;
    }

    .book-dl-btn:hover {
      background: #c42a63;
    }

    /* Book frame (iframe viewer) */
    .book-frame {
      background: #e8e4e0;
      min-height: 700px;
    }

    .book-frame iframe {
      width: 100%;
      height: 700px;
      border: none;
      display: block;
    }

    @media (max-width: 768px) {
      .book-toolbar {
        flex-wrap: wrap;
      }

      .book-sura-title {
        order: -1;
        width: 100%;
        text-align: center;
      }

      .book-frame,
      .book-frame iframe {
        min-height: 500px;
        height: 500px;
      }
    }