/**
 * Quran Tafsir Tool Styles
 * Scoped styles for the Quran reader with tafsir support
 *
 * Color Scheme:
 * - Green theme for all sections
 * - Dark Green (#1e8449): Tafsir description panel
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
.quran-tool-container {
    --qt-blue: #27ae60;
    --qt-blue-light: #e9f7ef;
    --qt-blue-dark: #1e8449;

    --qt-yellow: #27ae60;
    --qt-yellow-light: #e9f7ef;
    --qt-yellow-dark: #1e8449;

    --qt-purple: #27ae60;
    --qt-purple-light: #e9f7ef;
    --qt-purple-dark: #1e8449;

    --qt-green: #27ae60;
    --qt-green-light: #e9f7ef;
    --qt-green-dark: #1e8449;

    --qt-text: #2c3e50;
    --qt-text-light: #7f8c8d;
    --qt-background: #ffffff;
    --qt-border: #e0e0e0;

    --qt-font-arabic: 'Scheherazade New', 'Traditional Arabic', 'Arabic Typesetting', serif;
    --qt-font-french: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;

    --qt-radius: 8px;
    --qt-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --qt-transition: 0.3s ease;
}

/* ============================================
   BASE STYLES
   ============================================ */
.quran-tool-container {
    font-family: var(--qt-font-french);
    color: var(--qt-text);
    line-height: 1.6;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.quran-tool-container * {
    box-sizing: border-box;
}

/* ============================================
   LAYOUT
   ============================================ */
.qt-main-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.qt-main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.qt-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

/* ============================================
   SELECTION SECTION (Blue)
   ============================================ */
.qt-selection-section {
    background: var(--qt-blue-light);
    border: 2px solid var(--qt-blue);
    border-radius: var(--qt-radius);
    padding: 20px;
}

.qt-selection-section h2 {
    color: var(--qt-blue-dark);
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qt-selection-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--qt-blue);
    border-radius: 2px;
}

.qt-select-group {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.qt-select-wrapper {
    flex: 1;
    min-width: 200px;
}

.qt-select-wrapper label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: var(--qt-blue-dark);
    font-size: 0.9rem;
}

.qt-select {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--qt-blue);
    border-radius: var(--qt-radius);
    background: var(--qt-background);
    color: var(--qt-text);
    cursor: pointer;
    transition: var(--qt-transition);
    font-family: var(--qt-font-french);
}

.qt-select:hover:not(:disabled) {
    border-color: var(--qt-blue-dark);
    box-shadow: var(--qt-shadow);
}

.qt-select:focus {
    outline: none;
    border-color: var(--qt-blue-dark);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.qt-select:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
    opacity: 0.7;
}

/* ============================================
   QURAN DISPLAY SECTION (Yellow)
   ============================================ */
.qt-quran-section {
    background: var(--qt-yellow-light);
    border: 2px solid var(--qt-yellow);
    border-radius: var(--qt-radius);
    padding: 24px;
}

.qt-quran-section.hidden {
    display: none;
}

.qt-ayah-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--qt-yellow);
}

.qt-ayah-number {
    background: var(--qt-yellow);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
}

.qt-quran-arabic {
    font-family: var(--qt-font-arabic);
    font-size: 2rem;
    line-height: 2;
    text-align: right;
    direction: rtl;
    color: var(--qt-text);
    padding: 20px;
    background: var(--qt-background);
    border-radius: var(--qt-radius);
    margin-bottom: 16px;
    border: 1px solid var(--qt-yellow);
}

.qt-quran-french {
    font-family: var(--qt-font-french);
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--qt-text);
    padding: 16px 20px;
    background: var(--qt-background);
    border-radius: var(--qt-radius);
    border: 1px solid var(--qt-yellow);
    font-style: italic;
}

/* ============================================
   TAFSIR SELECTION (Purple)
   ============================================ */
.qt-tafsir-selector {
    background: var(--qt-purple-light);
    border: 2px solid var(--qt-purple);
    border-radius: var(--qt-radius);
    padding: 20px;
}

.qt-tafsir-selector.hidden {
    display: none;
}

.qt-tafsir-selector h2 {
    color: var(--qt-purple-dark);
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qt-tafsir-selector h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--qt-purple);
    border-radius: 2px;
}

.qt-tafsir-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.tafsir-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--qt-background);
    border: 2px solid var(--qt-purple);
    border-radius: var(--qt-radius);
    cursor: pointer;
    transition: var(--qt-transition);
    flex: 1;
    min-width: 220px;
}

.tafsir-checkbox-label:hover {
    background: white;
    box-shadow: var(--qt-shadow);
}

.tafsir-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 4px;
    accent-color: var(--qt-purple);
    cursor: pointer;
}

.tafsir-checkbox-label input[type="checkbox"]:checked + span {
    color: var(--qt-purple-dark);
}

.tafsir-name-ar {
    font-family: var(--qt-font-arabic);
    font-size: 1.1rem;
    display: block;
    direction: rtl;
}

.tafsir-name-fr {
    font-size: 0.85rem;
    color: var(--qt-text-light);
}

/* ============================================
   TAFSIR CONTENT (Green)
   ============================================ */
.qt-tafsir-content-section {
    background: var(--qt-green-light);
    border: 2px solid var(--qt-green);
    border-radius: var(--qt-radius);
    padding: 20px;
}

.qt-tafsir-content-section h2 {
    color: var(--qt-green-dark);
    margin: 0 0 16px 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qt-tafsir-content-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--qt-green);
    border-radius: 2px;
}

.qt-tafsir-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.no-tafsir-message {
    text-align: center;
    color: var(--qt-text-light);
    padding: 40px;
    font-style: italic;
}

/* Tafsir Block */
.tafsir-block {
    background: var(--qt-background);
    border: 2px solid var(--qt-green);
    border-radius: var(--qt-radius);
    overflow: hidden;
}

.tafsir-block.tafsir-not-available {
    opacity: 0.7;
}

.tafsir-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 20px;
    background: var(--qt-green);
    color: white;
}

.tafsir-block-header h3 {
    margin: 0;
    font-size: 1rem;
}

.tafsir-title-ar {
    font-family: var(--qt-font-arabic);
    font-size: 1.2rem;
    display: block;
}

.tafsir-title-fr {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Language Toggle */
.language-toggle {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px;
    border-radius: var(--qt-radius);
}

.lang-toggle-btn {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: white;
    cursor: pointer;
    border-radius: calc(var(--qt-radius) - 2px);
    font-size: 0.85rem;
    transition: var(--qt-transition);
    font-family: var(--qt-font-french);
}

.lang-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-toggle-btn.active {
    background: white;
    color: var(--qt-green-dark);
    font-weight: 600;
}

/* Tafsir Title Container */
.tafsir-title-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tafsir-verse-range {
    font-size: 0.85rem;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 4px;
    width: fit-content;
}

/* Verses Preview (for multi-verse tafsir) */
.tafsir-verses-preview {
    background: #e8f5e9;
    padding: 16px;
    border-bottom: 1px solid var(--qt-green);
}

.verses-label {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--qt-green-dark);
}

.verses-label .ar {
    font-family: var(--qt-font-arabic);
    direction: rtl;
}

.verses-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.verse-item {
    font-family: var(--qt-font-arabic);
    font-size: 1.1rem;
    direction: rtl;
    text-align: right;
    padding: 8px 12px;
    background: white;
    border-radius: var(--qt-radius);
    border-left: 3px solid var(--qt-green);
}

.verse-num {
    display: inline-block;
    background: var(--qt-green);
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-size: 0.85rem;
    margin-left: 8px;
    font-family: var(--qt-font-french);
}

.verses-more {
    text-align: center;
    color: var(--qt-text-light);
    font-style: italic;
    padding: 8px;
    font-family: var(--qt-font-french);
}

/* Tafsir Content */
.tafsir-content {
    padding: 20px;
}

.tafsir-arabic {
    font-family: var(--qt-font-arabic);
    font-size: 1.25rem;
    line-height: 2;
    text-align: right;
    direction: rtl;
    padding: 16px;
    background: #f8f9fa;
    border-radius: var(--qt-radius);
    margin-bottom: 12px;
}

.tafsir-french {
    font-family: var(--qt-font-french);
    font-size: 1rem;
    line-height: 1.8;
    padding: 16px;
    background: #f8f9fa;
    border-radius: var(--qt-radius);
}

/* Multiple Entries Styles */
.tafsir-entry-count {
    font-size: 0.85rem;
    color: var(--qt-green-dark);
    font-weight: 600;
    margin-left: 8px;
    background: var(--qt-green-light);
    padding: 2px 8px;
    border-radius: 12px;
}

.tafsir-entry {
    margin-bottom: 16px;
}

.tafsir-entry:last-child {
    margin-bottom: 0;
}

.tafsir-entry-header {
    background: linear-gradient(135deg, var(--qt-green) 0%, var(--qt-green-dark) 100%);
    color: white;
    padding: 8px 12px;
    border-radius: var(--qt-radius) var(--qt-radius) 0 0;
    margin-bottom: 0;
    font-size: 0.9rem;
}

.entry-number {
    font-weight: 600;
}

.entry-source {
    opacity: 0.8;
    font-size: 0.8rem;
}

.tafsir-entry-separator {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--qt-green), transparent);
    margin: 24px 0;
}

.tafsir-not-available-message {
    padding: 30px;
    text-align: center;
    color: var(--qt-text-light);
}

.tafsir-not-available-message .ar {
    font-family: var(--qt-font-arabic);
    font-size: 1.1rem;
    direction: rtl;
}

.tafsir-not-available-message .fr {
    font-size: 0.95rem;
    font-style: italic;
}

/* ============================================
   SIDEBAR - TAFSIR DESCRIPTION (Dark Green)
   ============================================ */
.qt-description-panel {
    background: linear-gradient(135deg, var(--qt-green-dark) 0%, #145a32 100%);
    color: white;
    border-radius: var(--qt-radius);
    padding: 20px;
}

.qt-description-panel h2 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    padding-bottom: 12px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.description-placeholder {
    text-align: center;
    opacity: 0.7;
    font-style: italic;
    padding: 20px 0;
}

.description-content {
    font-size: 0.9rem;
}

.description-title {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
}

.description-title .ar {
    font-family: var(--qt-font-arabic);
    display: block;
    font-size: 1.3rem;
    direction: rtl;
    text-align: right;
}

.description-title .fr {
    display: block;
    font-size: 1rem;
    opacity: 0.9;
}

.description-field {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.description-field:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.description-field strong {
    display: block;
    margin-bottom: 8px;
    opacity: 0.9;
}

.description-field p {
    margin: 4px 0;
}

.description-field .ar {
    font-family: var(--qt-font-arabic);
    direction: rtl;
    text-align: right;
}

.description-field .fr {
    opacity: 0.9;
}

/* Multiple Descriptions */
.description-multiple {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.description-mini {
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--qt-radius);
}

.description-mini h4 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.description-mini .ar {
    font-family: var(--qt-font-arabic);
    direction: rtl;
}

.description-mini .fr {
    margin: 0;
    font-size: 0.85rem;
    opacity: 0.9;
}

.description-mini .author {
    margin: 4px 0 0 0;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ============================================
   LOADING OVERLAY
   ============================================ */
.qt-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: var(--qt-transition);
}

.qt-loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.qt-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--qt-border);
    border-top-color: var(--qt-green);
    border-radius: 50%;
    animation: qt-spin 1s linear infinite;
}

@keyframes qt-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
    .qt-main-layout {
        grid-template-columns: 1fr;
    }

    .qt-sidebar {
        position: static;
        order: -1;
    }

    .qt-description-panel {
        display: none;
    }
}

@media (max-width: 768px) {
    .quran-tool-container {
        padding: 12px;
    }

    .qt-select-group {
        flex-direction: column;
    }

    .qt-select-wrapper {
        min-width: 100%;
    }

    .qt-quran-arabic {
        font-size: 1.5rem;
    }

    .tafsir-checkbox-label {
        min-width: 100%;
    }

    .tafsir-block-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .language-toggle {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .qt-quran-arabic {
        font-size: 1.25rem;
        padding: 12px;
    }

    .qt-quran-french {
        font-size: 0.95rem;
        padding: 12px;
    }

    .tafsir-arabic {
        font-size: 1.1rem;
        padding: 12px;
    }

    .tafsir-french {
        font-size: 0.9rem;
        padding: 12px;
    }
}

/* ============================================
   RATING & DISCLAIMER
   ============================================ */
.qt-rating-section {
    background: #fffbf0;
    border: 2px solid #f0c040;
    border-radius: var(--qt-radius);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qt-rating-section.hidden {
    display: none;
}

.qt-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    color: #7a6000;
    line-height: 1.5;
}

.qt-disclaimer-icon {
    flex-shrink: 0;
    font-size: 1.1rem;
}

.qt-rating-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.qt-rating-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--qt-green-dark);
}

.qt-rate-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border: 2px solid var(--qt-border);
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 0.95rem;
    font-family: var(--qt-font-french);
    font-weight: 600;
    transition: var(--qt-transition);
    color: var(--qt-text);
}

.qt-rate-btn:hover:not(:disabled) {
    box-shadow: var(--qt-shadow);
}

.qt-rate-up:hover:not(:disabled) {
    border-color: #27ae60;
    color: #27ae60;
}

.qt-rate-down:hover:not(:disabled) {
    border-color: #e74c3c;
    color: #e74c3c;
}

.qt-rate-up.voted {
    background: #e9f7ef;
    border-color: #27ae60;
    color: #1e8449;
}

.qt-rate-down.voted {
    background: #fdedec;
    border-color: #e74c3c;
    color: #c0392b;
}

.qt-rate-btn:disabled {
    cursor: default;
    opacity: 0.85;
}

.qt-signal-btn {
    padding: 7px 14px;
    border: 2px solid var(--qt-border);
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: var(--qt-font-french);
    color: var(--qt-text-light);
    transition: var(--qt-transition);
    margin-left: auto;
}

.qt-signal-btn:hover {
    border-color: #e67e22;
    color: #e67e22;
}

.qt-signal-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.qt-signal-form.hidden {
    display: none;
}

.qt-signal-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--qt-border);
    border-radius: var(--qt-radius);
    font-family: var(--qt-font-french);
    font-size: 0.9rem;
    color: var(--qt-text);
    resize: vertical;
    transition: var(--qt-transition);
}

.qt-signal-textarea:focus {
    outline: none;
    border-color: var(--qt-green);
}

.qt-signal-actions {
    display: flex;
    gap: 8px;
}

.qt-signal-submit {
    padding: 8px 20px;
    background: var(--qt-green);
    color: white;
    border: none;
    border-radius: var(--qt-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: var(--qt-font-french);
    font-weight: 600;
    transition: var(--qt-transition);
}

.qt-signal-submit:hover {
    background: var(--qt-green-dark);
}

.qt-signal-cancel {
    padding: 8px 16px;
    background: transparent;
    border: 2px solid var(--qt-border);
    border-radius: var(--qt-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: var(--qt-font-french);
    color: var(--qt-text-light);
    transition: var(--qt-transition);
}

.qt-signal-cancel:hover {
    border-color: var(--qt-text-light);
}

.qt-rating-feedback {
    font-size: 0.88rem;
    color: var(--qt-green-dark);
    font-weight: 600;
    padding: 6px 0 0;
}

.qt-rating-feedback.hidden {
    display: none;
}

/* ============================================
   LIVRES - SELECTION SECTION
   ============================================ */
.qt-livres-selection-section {
    background: var(--qt-blue-light);
    border: 2px solid var(--qt-blue);
    border-radius: var(--qt-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qt-livres-selection-section h2 {
    color: var(--qt-blue-dark);
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qt-books-note {
    margin: 0;
    padding: 10px 14px;
    background: rgba(139, 107, 60, 0.08);
    border-left: 3px solid var(--qt-blue);
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--qt-blue-dark);
    line-height: 1.5;
    font-style: italic;
}

.qt-livres-selection-section h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--qt-blue);
    border-radius: 2px;
}

/* Book Cards */
.qt-livres-books {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.qt-book-card {
    flex: 1;
    min-width: 200px;
    padding: 16px;
    background: var(--qt-background);
    border: 2px solid var(--qt-green);
    border-radius: var(--qt-radius);
    cursor: pointer;
    transition: var(--qt-transition);
    text-align: center;
}

.qt-book-card:hover {
    box-shadow: var(--qt-shadow);
    border-color: var(--qt-green-dark);
}

.qt-book-card.active {
    background: var(--qt-green);
    border-color: var(--qt-green-dark);
    color: white;
}

.qt-book-name-ar {
    font-family: var(--qt-font-arabic);
    font-size: 1.3rem;
    direction: rtl;
    margin-bottom: 4px;
}

.qt-book-name-fr {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.qt-book-card.active .qt-book-name-fr {
    color: rgba(255, 255, 255, 0.95);
}

.qt-book-author {
    font-size: 0.8rem;
    color: var(--qt-text-light);
    font-style: italic;
}

.qt-book-card.active .qt-book-author {
    color: rgba(255, 255, 255, 0.8);
}

/* Livres Surah & Verse Wrappers */
.qt-livres-surah-wrapper,
.qt-livres-verse-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.qt-livres-surah-wrapper.hidden,
.qt-livres-verse-wrapper.hidden {
    display: none;
}

.qt-livres-surah-wrapper label,
.qt-livres-verse-wrapper label {
    font-weight: 600;
    color: var(--qt-blue-dark);
    font-size: 0.9rem;
}

/* ============================================
   LIVRES - CONTENT SECTION
   ============================================ */
.qt-livres-content-section {
    background: var(--qt-green-light);
    border: 2px solid var(--qt-green);
    border-radius: var(--qt-radius);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.qt-livres-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--qt-green);
}

.qt-livres-content-header.hidden {
    display: none;
}

.qt-livres-content-header h2 {
    color: var(--qt-green-dark);
    margin: 0;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qt-livres-content-header h2::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 24px;
    background: var(--qt-green);
    border-radius: 2px;
}

/* The lang toggle inside livres uses the same .language-toggle styles
   but needs a dark background to match */
.qt-livres-content-header .language-toggle {
    background: var(--qt-green);
    padding: 4px;
    border-radius: var(--qt-radius);
}

/* Livres Entry */
.qt-livres-entry {
    background: var(--qt-background);
    border: 2px solid var(--qt-green);
    border-radius: var(--qt-radius);
    overflow: hidden;
    margin-bottom: 12px;
}

.qt-livres-entry:last-child {
    margin-bottom: 0;
}

/* Burhan entries: more prominent spacing between hadiths */
.qt-livres-entry-burhan {
    margin-bottom: 24px;
    border-color: var(--qt-green-dark);
}

.qt-livres-entry-burhan:last-child {
    margin-bottom: 0;
}

.qt-livres-entry-burhan .qt-livres-entry-header {
    background: linear-gradient(135deg, var(--qt-green-dark) 0%, #145a32 100%);
    letter-spacing: 0.03em;
}

.qt-livres-entry-header {
    background: linear-gradient(135deg, var(--qt-green) 0%, var(--qt-green-dark) 100%);
    color: white;
    padding: 8px 16px;
    font-size: 0.85rem;
    font-weight: 600;
}

.qt-livres-entry .tafsir-arabic,
.qt-livres-entry .tafsir-french {
    margin: 0;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--qt-border);
}

.qt-livres-entry .tafsir-arabic:last-child,
.qt-livres-entry .tafsir-french:last-child {
    border-bottom: none;
}

/* ============================================
   LIVRES - PAGINATION
   ============================================ */
.qt-livres-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 0 4px;
}

.qt-livres-pagination.hidden {
    display: none;
}

.qt-pagination-btn {
    padding: 8px 20px;
    background: var(--qt-green);
    color: white;
    border: none;
    border-radius: var(--qt-radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: var(--qt-font-french);
    transition: var(--qt-transition);
}

.qt-pagination-btn:hover:not(:disabled) {
    background: var(--qt-green-dark);
}

.qt-pagination-btn:disabled {
    background: var(--qt-border);
    color: var(--qt-text-light);
    cursor: not-allowed;
}

.qt-page-info {
    font-size: 0.9rem;
    color: var(--qt-green-dark);
    font-weight: 600;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .qt-selection-section,
    .qt-tafsir-selector,
    .qt-sidebar,
    .qt-loading-overlay,
    .language-toggle {
        display: none !important;
    }

    .quran-tool-container {
        max-width: 100%;
        padding: 0;
    }

    .qt-main-layout {
        display: block;
    }

    .qt-quran-section,
    .qt-tafsir-content-section,
    .tafsir-block {
        break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .quran-tool-container * {
        transition: none !important;
        animation: none !important;
    }
}

/* Focus styles for keyboard navigation */
.qt-select:focus,
.tafsir-checkbox-label:focus-within,
.lang-toggle-btn:focus {
    outline: 3px solid var(--qt-blue);
    outline-offset: 2px;
}

/* ============================================
   SEARCH MODULE
   ============================================ */
.qt-search-section {
    background: var(--qt-green-light);
    border: 1px solid var(--qt-green);
    border-radius: 10px;
    padding: 20px 24px 16px;
    margin-bottom: 20px;
}

.qt-search-section h2 {
    color: var(--qt-green-dark);
    font-size: 1.1rem;
    margin: 0 0 12px;
}

.qt-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.qt-search-input {
    width: 100%;
    padding: 12px 44px 12px 16px;
    font-size: 1.1rem;
    font-family: 'Scheherazade New', serif;
    border: 2px solid var(--qt-green);
    border-radius: 8px;
    background: #fff;
    color: var(--qt-text);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.qt-search-input:focus {
    outline: none;
    border-color: var(--qt-green-dark);
    box-shadow: 0 0 0 3px rgba(39, 174, 96, 0.15);
}

.qt-search-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    pointer-events: none;
}

.qt-search-note {
    margin: 8px 0 0;
    font-size: 0.8rem;
    color: var(--qt-text-light);
}

.qt-search-note span {
    font-family: 'Scheherazade New', serif;
    font-size: 1rem;
    color: var(--qt-green-dark);
}

.qt-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--qt-green);
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    z-index: 1000;
    max-height: 340px;
    overflow-y: auto;
}

.qt-search-result-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.qt-search-result-item:last-child { border-bottom: none; }

.qt-search-result-item:hover {
    background: var(--qt-green-light);
}

.qt-result-ref {
    font-size: 0.78rem;
    color: var(--qt-green-dark);
    font-weight: 600;
}

.qt-result-text {
    font-family: 'Scheherazade New', serif;
    font-size: 1rem;
    color: var(--qt-text);
    line-height: 1.5;
}

.qt-search-no-result {
    padding: 14px;
    text-align: center;
    color: var(--qt-text-light);
    font-size: 0.9rem;
}
