/* ── Al Quran Hadith Plugin ───────────────────────────── */
:root {
    --aqh-primary:    #1a6b4a;
    --aqh-primary-lt: #2e9e72;
    --aqh-gold:       #c9a84c;
    --aqh-gold-lt:    #e8c96a;
    --aqh-bg:         #f8f6f1;
    --aqh-card:       #ffffff;
    --aqh-text:       #1c1c1e;
    --aqh-muted:      #6b7280;
    --aqh-border:     #e5e0d5;
    --aqh-arabic-bg:  #f0f7f4;
    --aqh-radius:     14px;
    --aqh-shadow:     0 4px 24px rgba(0,0,0,.08);
    --aqh-transition: .3s cubic-bezier(.4,0,.2,1);
}

/* Wrapper */
.aqh-wrapper {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--aqh-bg);
    border-radius: var(--aqh-radius);
    padding: 28px 24px 32px;
    max-width: 820px;
    margin: 0 auto;
    box-shadow: var(--aqh-shadow);
    animation: aqhFadeIn .5s ease;
}

@keyframes aqhFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Tabs ───────────────────────────────────────────── */
.aqh-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 28px;
    background: var(--aqh-border);
    border-radius: 50px;
    padding: 5px;
}

.aqh-tab {
    flex: 1;
    border: none;
    background: transparent;
    border-radius: 50px;
    padding: 11px 20px;
    font-size: 15px;
    font-weight: 600;
    color: var(--aqh-muted);
    cursor: pointer;
    transition: var(--aqh-transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.aqh-tab.active {
    background: var(--aqh-primary);
    color: #fff;
    box-shadow: 0 2px 12px rgba(26,107,74,.3);
}

.aqh-tab:hover:not(.active) {
    color: var(--aqh-primary);
    background: rgba(26,107,74,.08);
}

.aqh-tab-icon { font-size: 16px; }
.aqh-tab-icon-img { width: 20px; height: 20px; object-fit: contain; vertical-align: middle; display: inline-block; }

/* ── Panels ─────────────────────────────────────────── */
.aqh-panel {
    display: none;
    animation: aqhSlideIn .35s ease;
}
.aqh-panel.active { display: block; }

@keyframes aqhSlideIn {
    from { opacity: 0; transform: translateX(10px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ── Controls ───────────────────────────────────────── */
.aqh-controls {
    background: var(--aqh-card);
    border-radius: var(--aqh-radius);
    padding: 24px;
    border: 1px solid var(--aqh-border);
    margin-bottom: 20px;
}

.aqh-control-row {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.aqh-control-group {
    flex: 1;
    min-width: 200px;
}

.aqh-control-group.aqh-full { flex: 0 0 100%; }

.aqh-control-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--aqh-primary);
    margin-bottom: 7px;
}

.aqh-note {
    font-size: 11px;
    color: var(--aqh-muted);
    margin: 5px 0 0;
    font-style: italic;
}

/* Select */
.aqh-select-wrap { position: relative; }

.aqh-select-wrap::after {
    content: '▾';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--aqh-primary);
    font-size: 13px;
}

.aqh-select,
.aqh-input {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background: var(--aqh-bg);
    border: 1.5px solid var(--aqh-border);
    border-radius: 10px;
    padding: 11px 40px 11px 14px;
    font-size: 14px;
    color: var(--aqh-text);
    cursor: pointer;
    transition: border-color var(--aqh-transition), box-shadow var(--aqh-transition);
    outline: none;
    box-sizing: border-box;
}

.aqh-input { padding-right: 14px; cursor: text; }

.aqh-select:focus,
.aqh-input:focus {
    border-color: var(--aqh-primary-lt);
    box-shadow: 0 0 0 3px rgba(46,158,114,.15);
}

/* Button */
.aqh-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--aqh-primary), var(--aqh-primary-lt));
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 13px 32px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--aqh-transition);
    position: relative;
    overflow: hidden;
    margin-top: 6px;
}

.aqh-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--aqh-gold), var(--aqh-gold-lt));
    opacity: 0;
    transition: opacity var(--aqh-transition);
}

.aqh-btn:hover::before { opacity: 1; }
.aqh-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26,107,74,.35); }
.aqh-btn:active { transform: translateY(0); }

.aqh-btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: aqhSpin .7s linear infinite;
    position: relative;
    z-index: 1;
}

.aqh-btn-text { position: relative; z-index: 1; }

.aqh-btn.loading .aqh-btn-loader { display: block; }
.aqh-btn.loading .aqh-btn-text   { opacity: .6; }
.aqh-btn.loading { pointer-events: none; }

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

/* ── Display Area ───────────────────────────────────── */
.aqh-display {
    animation: aqhFadeIn .4s ease;
}

.aqh-verse-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.aqh-badge {
    background: linear-gradient(135deg, var(--aqh-primary), var(--aqh-primary-lt));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 50px;
    letter-spacing: .04em;
}

/* ── Progress Bar ───────────────────────────────────── */
.aqh-loader-wrap {
    animation: aqhFadeIn .3s ease;
    margin-bottom: 8px;
}

.aqh-progress-bar-wrap {
    margin-bottom: 20px;
}

.aqh-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--aqh-primary);
    margin-bottom: 8px;
}

#aqh-quran-pct,
#aqh-hadith-pct {
    font-size: 14px;
    font-weight: 800;
    color: var(--aqh-gold);
    min-width: 38px;
    text-align: right;
}

.aqh-progress-track {
    width: 100%;
    height: 6px;
    background: var(--aqh-border);
    border-radius: 50px;
    overflow: hidden;
}

.aqh-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--aqh-primary), var(--aqh-gold));
    border-radius: 50px;
    transition: width .4s cubic-bezier(.4,0,.2,1);
    position: relative;
}

.aqh-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.5));
    animation: aqhShimmerBar 1s linear infinite;
}

@keyframes aqhShimmerBar {
    from { opacity: 0; }
    50%  { opacity: 1; }
    to   { opacity: 0; }
}

/* ── Skeleton / Glass Preview ───────────────────────── */
.aqh-skeleton-wrap {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.aqh-skeleton-block {
    background: rgba(255,255,255,.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.8);
    border-radius: var(--aqh-radius);
    padding: 20px 22px;
    box-shadow: 0 4px 20px rgba(0,0,0,.06);
}

.aqh-skeleton-block.aqh-skeleton-arabic {
    background: rgba(240,247,244,.7);
    border-color: rgba(46,158,114,.15);
}

.aqh-skeleton {
    background: linear-gradient(
        90deg,
        rgba(0,0,0,.06) 25%,
        rgba(0,0,0,.12) 50%,
        rgba(0,0,0,.06) 75%
    );
    background-size: 200% 100%;
    border-radius: 6px;
    animation: aqhShimmer 1.4s ease infinite;
}

@keyframes aqhShimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

.aqh-skeleton-badge {
    width: 160px;
    height: 28px;
    border-radius: 50px;
    margin-bottom: 14px;
}

.aqh-skeleton-label {
    width: 100px;
    height: 11px;
    margin-bottom: 12px;
    border-radius: 4px;
}

.aqh-skeleton-line { height: 14px; border-radius: 4px; }
.aqh-skeleton-line-full { width: 100%; }
.aqh-skeleton-line-lg   { width: 82%; }
.aqh-skeleton-line-md   { width: 60%; }
.aqh-skeleton-line-sm   { width: 38%; }

/* Text blocks */
.aqh-text-block {
    background: var(--aqh-card);
    border: 1px solid var(--aqh-border);
    border-radius: var(--aqh-radius);
    padding: 20px 22px;
    margin-bottom: 14px;
    transition: box-shadow var(--aqh-transition);
    animation: aqhFadeIn .4s ease backwards;
}

.aqh-text-block:nth-child(2) { animation-delay: .05s; }
.aqh-text-block:nth-child(3) { animation-delay: .10s; }
.aqh-text-block:nth-child(4) { animation-delay: .15s; }

.aqh-text-block:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.07);
}

.aqh-text-block.aqh-arabic {
    background: var(--aqh-arabic-bg);
    border-color: rgba(26,107,74,.15);
}

.aqh-block-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .07em;
    color: var(--aqh-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.aqh-block-label::before {
    content: '';
    display: inline-block;
    width: 3px;
    height: 13px;
    background: var(--aqh-gold);
    border-radius: 2px;
}

/* Arabic text */
.aqh-arabic-text {
    font-size: 26px;
    line-height: 1.9;
    font-family: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    color: var(--aqh-text);
    text-align: right;
}

/* Transliteration + Translation */
#aqh-translit-text,
#aqh-translation-text,
#aqh-hadith-translation {
    font-size: 16px;
    line-height: 1.75;
    color: var(--aqh-text);
}

#aqh-translit-text { font-style: italic; color: #444; }

/* Audio */
.aqh-audio-wrap {
    background: var(--aqh-card);
    border: 1px solid var(--aqh-border);
    border-radius: var(--aqh-radius);
    padding: 18px 22px;
    margin-bottom: 14px;
    animation: aqhFadeIn .4s ease .2s backwards;
}

#aqh-audio-player {
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
    accent-color: var(--aqh-primary);
}

/* Error */
.aqh-error-msg {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: var(--aqh-radius);
    padding: 16px 20px;
    color: #b91c1c;
    font-size: 14px;
    margin-top: 16px;
    animation: aqhFadeIn .3s ease;
}

/* ── Islamic Knowledge ──────────────────────────────── */
.aqh-knowledge-search-wrap { flex: 2; }

.aqh-search-input-wrap { position: relative; }

.aqh-search-input-wrap .aqh-input { padding-right: 36px; }

.aqh-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.aqh-knowledge-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

.aqh-btn-gold {
    background: linear-gradient(135deg, #b45309, var(--aqh-gold));
}

.aqh-btn-gold::before { display: none; }

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

.aqh-btn-outline:hover { background: var(--aqh-primary); color: #fff; }
.aqh-btn-outline::before { display: none; }

.aqh-btn-sm { padding: 8px 16px; font-size: 13px; }

/* Knowledge Total */
.aqh-knowledge-total {
    font-size: 13px;
    font-weight: 600;
    color: var(--aqh-muted);
    margin-top: 16px;
    padding: 8px 14px;
    background: var(--aqh-card);
    border: 1px solid var(--aqh-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Knowledge Grid */
.aqh-knowledge-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 20px;
}

.aqh-knowledge-card {
    background: var(--aqh-card);
    border: 1px solid var(--aqh-border);
    border-radius: var(--aqh-radius);
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: box-shadow var(--aqh-transition), transform var(--aqh-transition);
    animation: aqhFadeIn .4s ease backwards;
}

.aqh-knowledge-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
    transform: translateY(-3px);
}

.aqh-knowledge-card-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    object-position: center;
    display: block;
    flex-shrink: 0;
    background: #f8f8f6;
    padding: 8px;
    box-sizing: border-box;
}

.aqh-knowledge-card-img-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--aqh-arabic-bg), #e8f4ef);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    flex-shrink: 0;
}

.aqh-knowledge-card-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }

.aqh-knowledge-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.aqh-cat-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    background: var(--aqh-arabic-bg);
    color: var(--aqh-primary);
    border-radius: 4px;
    padding: 2px 8px;
}

.aqh-lang-badge {
    font-size: 10px;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    border-radius: 4px;
    padding: 2px 8px;
}

.aqh-knowledge-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--aqh-text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.aqh-knowledge-card-excerpt {
    font-size: 12px;
    color: var(--aqh-muted);
    line-height: 1.6;
    margin-bottom: 10px;
    flex: 1;
}

.aqh-knowledge-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--aqh-muted);
    border-top: 1px solid var(--aqh-border);
    padding-top: 8px;
    margin-top: auto;
}

.aqh-read-more {
    font-size: 12px;
    font-weight: 700;
    color: var(--aqh-primary);
}

/* Empty + pagination */
.aqh-knowledge-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--aqh-muted);
    font-size: 14px;
    background: var(--aqh-card);
    border-radius: var(--aqh-radius);
    border: 1px solid var(--aqh-border);
    margin-top: 20px;
}

.aqh-knowledge-skeleton { padding: 0 0 14px; }

.aqh-knowledge-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.aqh-page-btn {
    background: var(--aqh-card);
    border: 1.5px solid var(--aqh-border);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    color: var(--aqh-text);
    transition: var(--aqh-transition);
}

.aqh-page-btn:hover,
.aqh-page-btn.active {
    background: var(--aqh-primary);
    color: #fff;
    border-color: var(--aqh-primary);
}

/* Modal */
.aqh-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: aqhFadeIn .25s ease;
}

.aqh-modal {
    background: var(--aqh-card);
    border-radius: var(--aqh-radius);
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
    animation: aqhSlideIn .3s ease;
}

.aqh-modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    color: var(--aqh-muted);
    line-height: 1;
}

.aqh-modal-close:hover { color: #b91c1c; }

.aqh-modal-title {
    font-size: 20px;
    font-weight: 800;
    color: var(--aqh-text);
    margin-bottom: 12px;
    padding-right: 30px;
}

.aqh-modal-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.aqh-modal-img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 16px;
    max-height: 300px;
    object-fit: contain;
    background: #f8f8f6;
    display: block;
}

.aqh-modal-body {
    font-size: 15px;
    line-height: 1.8;
    color: var(--aqh-text);
    white-space: pre-wrap;
}

.aqh-modal-footer {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--aqh-border);
    font-size: 12px;
    color: var(--aqh-muted);
}

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 700px) {
    .aqh-knowledge-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .aqh-wrapper  { padding: 18px 14px 24px; }
    .aqh-control-row { flex-direction: column; gap: 12px; }
    .aqh-control-group { min-width: 100%; }
    .aqh-arabic-text { font-size: 22px; }
    .aqh-tabs { gap: 6px; }
    .aqh-tab  { font-size: 13px; padding: 10px 14px; }
}
