/* ==========================================================================
   SUBJECT-WISE QURAN PRO (SWQ Pro) — Master CSS
   hadith masterCSS_hadith.css + masterCSS_subjectwise.css এর প্যাটার্নে তৈরি
   ========================================================================== */

/* ==========================================================================
   1. SWQ PRO MENU STYLES (v2-hadith-menu pattern)
   ========================================================================== */
#v2-swq-pro-menu { list-style: none; padding: 0; margin: 0; font-family: var(--font-bn); }
#v2-swq-pro-menu ul { list-style: none; padding-left: 15px; border-left: 1px solid #e0e0e0; }
#v2-swq-pro-menu li { margin: 4px 2px; }
#v2-swq-pro-menu input[type="checkbox"] { display: none; }

#v2-swq-pro-menu label {
    display: block; padding: 8px 12px; cursor: pointer; border-radius: 30px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
#v2-swq-pro-menu label:hover {
    background-color: #f0f0f0; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

#v2-swq-pro-menu input:checked+label+ul { display: block; }
#v2-swq-pro-menu input:not(:checked)+label+ul { display: none; }

#v2-swq-pro-menu label.has-children::before { content: '📂'; margin-right: 8px; font-size: 14px; }
#v2-swq-pro-menu label.has-content::before { content: '📄'; color: #512da8; margin-right: 0; }
#v2-swq-pro-menu li.expanded > label.has-children::before { content: '📖' !important; }
#v2-swq-pro-menu .sticky-header { position: sticky; top: 0; background-color: #fff; z-index: 2; }

/* ==========================================================================
   2. SWQ PRO MENU LEVELS (1-4)
   ========================================================================== */
/* LEVEL 1: Books/Categories (Q_subject_list level) */
#v2-swq-pro-menu .level-1>label {
    color: #070707 !important; font-weight: bold !important; border-left: 5px solid #2e7d32 !important;
    background: linear-gradient(90deg, #c8e6c9, #ffffff) !important; padding: 6px 3px !important;
    font-size: 16px !important; box-shadow: 0 2px 8px rgba(46, 125, 50, 0.3) !important;
}
#v2-swq-pro-menu .level-1>label.has-children::before { content: '📚 '; color: #2e7d32; font-size: 19px; }

/* LEVEL 2: Subject (Q_subject_list → menu items) */
#v2-swq-pro-menu .level-2>label {
    color: #070707 !important; font-weight: 600 !important; border-left: 5px solid #1565c0 !important;
    background: linear-gradient(90deg, #bbdefb, #ffffff) !important; padding: 6px 4px 6px 5px !important;
    font-size: 15px !important; box-shadow: 0 2px 6px rgba(21, 101, 192, 0.3) !important; margin-left: 1px !important;
}
#v2-swq-pro-menu .level-2>label.has-children::before { content: '📗'; color: #1565c0; }

/* LEVEL 3: Sub-subject (Q_sub_subject_list → menu items, has_content=1) */
#v2-swq-pro-menu .level-3>label {
    color: #000 !important; font-weight: 500 !important; border-left: 4px solid #ef6c00 !important;
    background: linear-gradient(90deg, #ffe5c2, #ffffff) !important; padding: 9px 5px 9px 5px !important;
    font-size: 14px !important; box-shadow: 0 2px 5px rgba(255, 152, 0, 0.3) !important; margin-left: 2px !important;
}
#v2-swq-pro-menu .level-3>label.has-children::before { content: '📙'; color: #f57c00; }

/* LEVEL 4: Additional depth if needed */
#v2-swq-pro-menu .level-4>label {
    color: #000 !important; font-weight: 500 !important; border-left: 4px solid #c62828 !important;
    background: linear-gradient(90deg, #ffcdd2, #ffffff) !important; padding: 8px 5px 8px 5px !important;
    font-size: 13px !important; box-shadow: 0 2px 4px rgba(244, 67, 54, 0.3) !important; margin-left: 3px !important;
}
#v2-swq-pro-menu .level-4>label.has-children::before { content: '📕'; color: #d32f2f; }

/* HOVER STATES */
#v2-swq-pro-menu .level-1>label:hover, #v2-swq-pro-menu .level-2>label:hover, #v2-swq-pro-menu .level-3>label:hover {
    background: linear-gradient(135deg, #89ffe0, #64adff) !important;
}
#v2-swq-pro-menu .level-1>label:hover { transform: translateX(3px) !important; box-shadow: 0 4px 12px rgba(46, 125, 50, 0.4) !important; }
#v2-swq-pro-menu .level-2>label:hover { transform: translateX(2px) !important; box-shadow: 0 3px 10px rgba(21, 101, 192, 0.4) !important; }
#v2-swq-pro-menu .level-3>label:hover { transform: translateX(2px) !important; box-shadow: 0 3px 8px rgba(255, 152, 0, 0.4) !important; }
#v2-swq-pro-menu .level-4>label:hover { background: linear-gradient(135deg, #d32f2f, #c62828) !important; transform: translateX(1px) !important; }

/* CONTENT & ACTIVE ITEMS */
#v2-swq-pro-menu label.has-content {
    color: #050505 !important; font-weight: normal !important; border-left: 4px solid #4527a0 !important;
    background: linear-gradient(90deg, #d3d7ff, #ffffff) !important; border-radius: 6px !important; transition: all 0.3s ease !important;
}
#v2-swq-pro-menu label.has-content:hover { background: linear-gradient(135deg, #e1f7c3, #7aebff) !important; transform: scale(1.02) !important; box-shadow: 0 4px 15px rgba(103, 58, 183, 0.5) !important; }
#v2-swq-pro-menu li.act_item>label {
    background: linear-gradient(135deg, #ffa6a6, #77fff9) !important; color: #070707 !important;
    border-left-color: #bf360c !important; font-weight: bold !important;
    box-shadow: 0 4px 20px rgba(255, 87, 34, 0.6) !important; transform: scale(1.05) !important; border-radius: 8px !important;
}

/* FOLDER CONTAINERS (ul) */
#v2-swq-pro-menu .level-1+ul { border-left: 3px solid #4caf50 !important; margin-left: 15px !important; padding-left: 10px !important; background: rgba(76, 175, 80, 0.05) !important; }
#v2-swq-pro-menu .level-2+ul { border-left: 3px solid #2196f3 !important; margin-left: 20px !important; padding-left: 8px !important; background: rgba(33, 150, 243, 0.05) !important; }
#v2-swq-pro-menu .level-3+ul { border-left: 2px solid #ff9800 !important; margin-left: 25px !important; padding-left: 6px !important; background: rgba(255, 152, 0, 0.05) !important; }
#v2-swq-pro-menu .level-4+ul { border-left: 2px solid #f44336 !important; margin-left: 30px !important; padding-left: 4px !important; background: rgba(244, 67, 54, 0.05) !important; }

/* LOADING STATE */
#v2-swq-pro-menu .v2-loader-wrapper { text-align: center !important; padding: 30px !important; background: linear-gradient(135deg, #f5f5f5, #eeeeee) !important; border-radius: 8px !important; margin: 10px !important; }
#v2-swq-pro-menu .v2-loader { border: 4px solid #f3f3f3 !important; border-top-color: #4caf50 !important; border-radius: 50% !important; width: 40px !important; height: 40px !important; animation: v2-spin 1s linear infinite !important; }



/* ==========================================================================
   4. SWQ PRO CONTENT STYLES (ayat display — original subjectwisequran pattern clone)
   ========================================================================== */
/* ═══════ Quran Ayat Layout (copied from masterCSS_quran.css) ═══════
   SWQ Pro doesn't load masterCSS_quran.css, so all ayat display CSS is here.
   Old subjectwisequran uses <section id="surah">, quran CSS targets #surah.
   We replicate that layout on .swq-chapter-container .app-content. */

/* App Content container (replaces #surah flex layout) */
.swq-chapter-container .app-content {
    margin-top: 1px; display: flex; flex-direction: column; align-items: center; justify-content: center;
}

#content { overflow-y: auto; }

/* Ayah Card */
.swq-chapter-container .ayah {
    display: block; justify-content: center; outline: 0; width: 97%;
    margin-top: 10px; border-radius: 20px; box-shadow: 0 8px 38px rgba(0,0,0,.05);
}
.swq-chapter-container .grassCard {
    background: rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-left-color: rgba(255, 255, 255, 0.3);
    border-top-color: rgba(255, 255, 255, 0.3);
}

/* Ayah Wrapper — quran original: display: block (NOT flex) */
.swq-chapter-container .ayah-wrapper { width: 100%; padding: 17px; }
.swq-chapter-container .ayah-upperpart { display: flex; justify-content: space-between; width: 98.6%; margin-bottom: 15px; }
.swq-chapter-container .ayah-upperpart-mobile { display: none; justify-content: space-between; align-items: center; }
.swq-chapter-container .ayah-lowerpart { display: flex; justify-content: space-between; width: 100%; }
.swq-chapter-container .ayah-p { font-family: 'PDMS Islam', serif; direction: rtl; text-align: right; color: var(--surah-text); }
.swq-chapter-container .main-surahbox { width: 100%; }

/* Arabic Text */
.swq-chapter-container .arabicText {
    margin-bottom: 8px; direction: rtl; font-size: var(--quran-ar-font-sz, 16px);
    font-family: "PDMS Islam"; text-align: right;
}
.swq-chapter-container .normalArabicText { margin-inline-end: auto; }

/* Translation Text */
.swq-chapter-container .translationText {
    font-size: var(--quran-bn-font-sz, 23px); margin: 3px 0 10px 0 !important;
    direction: ltr; color: var(--surah-text); text-align: left;
}
.swq-chapter-container .trans-verse { margin: 0 0 3px; font-size: var(--quran-bn-font-sz, 15px); }
.swq-chapter-container .transLationTitle { font-size: 10px; color: #8a2be2; font-style: italic; }

/* Sura:Ayat Reference */
.swq-chapter-container .suraAyatNumber {
    font-weight: 400; font-size: 15px; color: #8a2be2; margin-right: 20px;
    font-family: "Kalpurush", arial, sans-serif; border: 1px solid rgba(190, 187, 187, 0.27);
    border-radius: 50px; height: 21px;
}
.swq-chapter-container .suraAyatNumberMobile {
    font-family: "Kalpurush", arial, sans-serif; color: #8a2be2;
    border: 1px solid rgba(190, 187, 187, 0.27); border-radius: 50px; height: 14px; font-size: 13px;
}

/* Ayah Bullets / Dropdown */
.swq-chapter-container .ayah-bullet, .swq-chapter-container .ayah-bullet2 { --size: 30px; width: var(--size); height: var(--size); }
.swq-chapter-container .quranBulet {
    content: " "; background-repeat: no-repeat; background-size: cover;
    width: 20px; height: 20px; position: absolute; left: -31px; top: 8px;
}

/* Chapter Header (sticky bar) */
.swq-chapter-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #fafafa;
    border-bottom: 2px solid #dee2e6;
    padding: 4px 15px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 1.3rem;
    font-weight: 500;
    color: #495057;
    transition: all 0.3s ease;
    border-radius: 20px;
    font-style: italic;
}

/* topTextSubject (from masterCSS_subjectwise.css - not loaded for SWQ Pro) */
.swq-chapter-header .topTextSubject {
    padding: 7px 0;
    text-align: left;
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}
@media (max-width: 768px) {
    .swq-chapter-header .topTextSubject {
        padding: 0px 0 !important;
        font-size: 14px !important;
    }
}

/* Sub-sub-subject Title (ssSubTitle original pattern) */
.swq-sub-title {
    font-size: 17px;
    border: 1px solid rgba(128, 128, 128, 0.46);
    padding: 3px;
    border-radius: 18px;
    margin: 10px auto;
    left: 10%;
    float: none;
    text-align: center;
    background-color: rgba(156, 214, 255, 0.39);
    font-weight: 500;
    width: 90%;
}

/* Chapter Content Container */
.swq-chapter-content { padding: 0px 20px; }

/* ═══════ Responsive Media Queries (from masterCSS_quran.css) ═══════ */
@media (max-width: 1170px) {
    .swq-chapter-container .ayah-upperpart { justify-content: flex-end; }
    .swq-chapter-container .ayah-upperpart-mobile { display: flex; width: 100%; justify-content: flex-start; }
    .swq-chapter-container .ayah-bullet { --size: 20px; width: var(--size); height: var(--size); }
}
@media (max-width: 768px) {
    .swq-chapter-container .ayah-wrapper { padding: 10px; }
    .swq-chapter-content { padding: 0px 8px; }
    .swq-chapter-container .suraAyatNumber { display: none; }
    .swq-chapter-container .ayah { width: 95% !important; }
}
@media (min-width: 769px) {
    .swq-chapter-container .suraAyatNumberMobile { display: none; }
}

/* Context Note */
.swq-context-note {
    font-size: 0.9rem;
    color: #555;
    padding: 8px 10px;
    background: #fffce8;
    border-left: 3px solid #ffc107;
    margin: 5px 0;
    border-radius: 0 4px 4px 0;
}

/* Floating Back Button */
#swq-floating-back-btn {
    position: fixed;
    bottom: 75px;
    right: 15px;
    width: 48px;
    height: 48px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.2s, background 0.2s;
}
@media (max-width: 767px) { #swq-floating-back-btn { display: flex !important; } }
#swq-floating-back-btn:active { transform: scale(0.95); background: #388E3C; }

/* Responsive */
@media (max-width: 768px) {
    .swq-chapter-content { padding: 0px 8px; }
    .swq-chapter-header { font-size: 1rem; padding: 4px 10px; }
}
