/* =====================================================
   Harian Aceh Al-Quran 30 Juz v1.1
   Luxurious + Dark Mode + Audio + Search + Favorites
   ===================================================== */

:root {
    --haq-primary: #0d4f3c;
    --haq-primary-dark: #083528;
    --haq-gold: #c9a227;
    --haq-gold-light: #e8d48b;
    --haq-cream: #faf8f2;
    --haq-cream-dark: #f0ebe0;
    --haq-text: #1a1a1a;
    --haq-text-muted: #5a5a5a;
    --haq-border: #e0d9c8;
    --haq-bg: #ffffff;
    --haq-card-bg: #faf8f2;
    --haq-shadow: 0 8px 30px rgba(13, 79, 60, 0.12);
    --haq-radius: 16px;
    --haq-font-arabic: 'Amiri', 'Scheherazade New', 'Traditional Arabic', serif;
    --haq-font-heading: 'Playfair Display', Georgia, serif;
}

/* Dark Mode */
[data-haq-theme="dark"] {
    --haq-primary: #1a7a5c;
    --haq-primary-dark: #0f5c44;
    --haq-gold: #d4af37;
    --haq-gold-light: #f0d77b;
    --haq-cream: #1e2a26;
    --haq-cream-dark: #16201c;
    --haq-text: #e8e6e0;
    --haq-text-muted: #a8a59c;
    --haq-border: #2d3d36;
    --haq-bg: #121a17;
    --haq-card-bg: #1a2420;
    --haq-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.haq-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--haq-text);
    background: var(--haq-bg);
    border-radius: var(--haq-radius);
    transition: background 0.3s, color 0.3s;
}

.haq-header {
    text-align: center;
    margin-bottom: 24px;
    padding: 28px 20px 20px;
    background: linear-gradient(135deg, var(--haq-primary) 0%, var(--haq-primary-dark) 100%);
    border-radius: var(--haq-radius);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.haq-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(201, 162, 39, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.haq-bismillah {
    font-family: var(--haq-font-arabic);
    font-size: 1.8rem;
    line-height: 1.8;
    margin-bottom: 10px;
    color: var(--haq-gold-light);
    direction: rtl;
}

.haq-main-title {
    font-family: var(--haq-font-heading);
    font-size: 1.9rem;
    font-weight: 700;
    margin: 0 0 6px;
}

.haq-subtitle {
    font-size: 0.9rem;
    opacity: 0.85;
    margin: 0 0 16px;
}

.haq-header-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.haq-theme-toggle,
.haq-fav-list-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.haq-theme-toggle:hover,
.haq-fav-list-btn:hover {
    background: rgba(255,255,255,0.28);
}

.haq-search-bar {
    margin-bottom: 28px;
    position: relative;
}

.haq-search-inner {
    display: flex;
    gap: 0;
    background: var(--haq-card-bg);
    border: 2px solid var(--haq-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.haq-search-inner:focus-within {
    border-color: var(--haq-primary);
}

.haq-search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 14px 18px;
    font-size: 1rem;
    color: var(--haq-text);
    outline: none;
}

.haq-search-input::placeholder {
    color: var(--haq-text-muted);
}

.haq-search-btn {
    background: var(--haq-primary);
    color: #fff;
    border: none;
    padding: 0 22px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.haq-search-btn:hover {
    background: var(--haq-primary-dark);
}

.haq-search-results {
    margin-top: 12px;
    background: var(--haq-card-bg);
    border: 1px solid var(--haq-border);
    border-radius: 12px;
    max-height: 420px;
    overflow-y: auto;
    box-shadow: var(--haq-shadow);
}

.haq-search-item {
    padding: 16px 18px;
    border-bottom: 1px solid var(--haq-border);
    cursor: pointer;
    transition: background 0.15s;
}

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

.haq-search-item:hover {
    background: var(--haq-cream);
}

.haq-search-item .haq-ayah-arabic {
    font-size: 1.35rem;
    margin-bottom: 6px;
}

.haq-search-empty {
    padding: 30px;
    text-align: center;
    color: var(--haq-text-muted);
}

.haq-juz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.haq-juz-card {
    background: var(--haq-card-bg);
    border: 2px solid var(--haq-border);
    border-radius: 14px;
    padding: 22px 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.haq-juz-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--haq-gold), var(--haq-primary));
    opacity: 0;
    transition: opacity 0.25s ease;
}

.haq-juz-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--haq-shadow);
    border-color: var(--haq-gold);
}

.haq-juz-card:hover::before {
    opacity: 1;
}

.haq-juz-number {
    font-family: var(--haq-font-heading);
    font-size: 2rem;
    font-weight: 700;
    color: var(--haq-primary);
    line-height: 1.1;
}

.haq-juz-label {
    font-size: 0.85rem;
    color: var(--haq-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 4px 0;
}

.haq-juz-arabic {
    font-family: var(--haq-font-arabic);
    font-size: 1.15rem;
    color: var(--haq-gold);
    direction: rtl;
    margin-top: 6px;
}

.haq-content-panel {
    background: var(--haq-bg);
    border: 1px solid var(--haq-border);
    border-radius: var(--haq-radius);
    box-shadow: var(--haq-shadow);
    overflow: hidden;
    animation: haqFadeIn 0.35s ease;
}

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

.haq-panel-header {
    background: linear-gradient(135deg, var(--haq-primary) 0%, var(--haq-primary-dark) 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.haq-back-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.haq-back-btn:hover {
    background: rgba(255,255,255,0.25);
}

.haq-panel-title {
    margin: 0;
    font-family: var(--haq-font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    flex: 1;
}

.haq-play-all-btn {
    background: var(--haq-gold);
    color: #1a1a1a;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.haq-play-all-btn:hover {
    opacity: 0.9;
}

.haq-play-all-btn.playing {
    background: #c0392b;
    color: #fff;
}

.haq-ayahs {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
    background: var(--haq-bg);
}

.haq-ayah-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--haq-border);
    position: relative;
}

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

.haq-ayah-item.playing-now {
    background: rgba(13, 79, 60, 0.08);
    border-radius: 10px;
    padding-left: 12px;
    padding-right: 12px;
    margin: 0 -12px;
}

[data-haq-theme="dark"] .haq-ayah-item.playing-now {
    background: rgba(26, 122, 92, 0.15);
}

.haq-ayah-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.haq-ayah-badge {
    background: var(--haq-primary);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 20px;
    font-weight: 600;
}

.haq-ayah-surah {
    font-size: 0.85rem;
    color: var(--haq-text-muted);
    flex: 1;
}

.haq-ayah-actions {
    display: flex;
    gap: 8px;
}

.haq-play-btn,
.haq-fav-btn {
    background: transparent;
    border: 1px solid var(--haq-border);
    color: var(--haq-text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.haq-play-btn:hover {
    background: var(--haq-primary);
    color: #fff;
    border-color: var(--haq-primary);
}

.haq-play-btn.playing {
    background: var(--haq-primary);
    color: #fff;
    border-color: var(--haq-primary);
}

.haq-fav-btn:hover,
.haq-fav-btn.is-fav {
    background: var(--haq-gold);
    color: #1a1a1a;
    border-color: var(--haq-gold);
}

.haq-ayah-arabic {
    font-family: var(--haq-font-arabic);
    font-size: 1.6rem;
    line-height: 2.1;
    direction: rtl;
    text-align: right;
    color: var(--haq-text);
    margin-bottom: 10px;
    padding: 6px 0;
}

.haq-ayah-indo {
    font-size: 0.96rem;
    line-height: 1.7;
    color: var(--haq-text-muted);
    border-left: 3px solid var(--haq-gold);
    padding-left: 14px;
    margin-top: 4px;
}

.haq-surah-separator {
    text-align: center;
    padding: 18px 0 8px;
    margin-top: 8px;
}

.haq-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--haq-text-muted);
}

.haq-spinner {
    width: 42px;
    height: 42px;
    border: 3px solid var(--haq-border);
    border-top-color: var(--haq-primary);
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: haqSpin 0.8s linear infinite;
}

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

.haq-empty-fav {
    text-align: center;
    padding: 50px 20px;
    color: var(--haq-text-muted);
    font-size: 1rem;
}

.haq-ayat-hari-ini {
    background: linear-gradient(160deg, var(--haq-cream) 0%, var(--haq-cream-dark) 100%);
    border: 1px solid var(--haq-border);
    border-radius: var(--haq-radius);
    padding: 24px 20px;
    box-shadow: var(--haq-shadow);
    position: relative;
    overflow: hidden;
}

.haq-ayat-hari-ini::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--haq-gold), var(--haq-primary), var(--haq-gold));
}

.haq-ahi-header {
    text-align: center;
    margin-bottom: 16px;
}

.haq-ahi-badge {
    display: inline-block;
    background: var(--haq-primary);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.haq-ahi-title {
    font-family: var(--haq-font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--haq-primary);
    margin: 0;
}

.haq-ahi-ref {
    font-weight: 400;
    color: var(--haq-gold);
    font-size: 0.95rem;
}

.haq-ahi-arabic {
    font-family: var(--haq-font-arabic);
    font-size: 1.65rem;
    line-height: 2.15;
    text-align: center;
    color: var(--haq-text);
    margin: 14px 0;
    padding: 10px 8px;
    direction: rtl;
}

.haq-ahi-translation {
    font-size: 0.95rem;
    line-height: 1.75;
    color: var(--haq-text-muted);
    text-align: center;
    border-top: 1px solid var(--haq-border);
    padding-top: 14px;
    margin-top: 6px;
}

.haq-ahi-actions {
    text-align: center;
    margin-top: 14px;
}

.haq-ahi-play {
    background: var(--haq-primary);
    color: #fff;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.haq-ahi-play:hover {
    background: var(--haq-primary-dark);
}

.haq-ahi-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.8rem;
    color: var(--haq-gold);
    font-weight: 500;
}

.haq-widget .haq-ahi-arabic {
    font-size: 1.35rem;
    line-height: 2;
}

@media (max-width: 600px) {
    .haq-juz-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }
    .haq-juz-card { padding: 16px 8px; }
    .haq-juz-number { font-size: 1.5rem; }
    .haq-main-title { font-size: 1.45rem; }
    .haq-bismillah { font-size: 1.35rem; }
    .haq-ayah-arabic { font-size: 1.35rem; }
    .haq-ahi-arabic { font-size: 1.3rem; }
    .haq-panel-header { padding: 12px 14px; }
}

.haq-ayahs::-webkit-scrollbar,
.haq-search-results::-webkit-scrollbar {
    width: 7px;
}
.haq-ayahs::-webkit-scrollbar-track,
.haq-search-results::-webkit-scrollbar-track {
    background: var(--haq-cream);
}
.haq-ayahs::-webkit-scrollbar-thumb,
.haq-search-results::-webkit-scrollbar-thumb {
    background: var(--haq-primary);
    border-radius: 4px;
}

/* ========== Tabs ========== */
.haq-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.haq-tab {
    background: var(--haq-card-bg);
    border: 2px solid var(--haq-border);
    color: var(--haq-text-muted);
    padding: 10px 28px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.haq-tab:hover {
    border-color: var(--haq-primary);
    color: var(--haq-primary);
}

.haq-tab.active {
    background: var(--haq-primary);
    border-color: var(--haq-primary);
    color: #fff;
}

/* ========== Surah Grid ========== */
.haq-surah-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 30px;
}

.haq-surah-card {
    background: var(--haq-card-bg);
    border: 1px solid var(--haq-border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: all 0.22s ease;
}

.haq-surah-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--haq-shadow);
    border-color: var(--haq-gold);
}

.haq-surah-num {
    width: 40px;
    height: 40px;
    background: var(--haq-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.haq-surah-info {
    flex: 1;
    min-width: 0;
}

.haq-surah-name {
    font-weight: 600;
    font-size: 0.98rem;
    color: var(--haq-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.haq-surah-meta {
    font-size: 0.8rem;
    color: var(--haq-text-muted);
    margin-top: 2px;
}

.haq-surah-arabic {
    font-family: var(--haq-font-arabic);
    font-size: 1.25rem;
    color: var(--haq-gold);
    direction: rtl;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .haq-surah-grid {
        grid-template-columns: 1fr;
    }
    .haq-tab {
        padding: 8px 18px;
        font-size: 0.9rem;
    }
}

/* ========== Surah Filter ========== */
.haq-surah-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.haq-surah-filter-input {
    flex: 1;
    background: var(--haq-card-bg);
    border: 2px solid var(--haq-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    color: var(--haq-text);
    outline: none;
    transition: border-color 0.2s;
}

.haq-surah-filter-input:focus {
    border-color: var(--haq-primary);
}

.haq-surah-filter-input::placeholder {
    color: var(--haq-text-muted);
}

.haq-surah-count {
    font-size: 0.85rem;
    color: var(--haq-text-muted);
    white-space: nowrap;
    font-weight: 500;
}

.haq-surah-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--haq-text-muted);
    font-size: 1rem;
}

/* PDF Button */
.haq-pdf-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    margin-right: 6px;
}
.haq-pdf-btn:hover {
    background: rgba(255,255,255,0.35);
}
.haq-audio-global {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ========== Qari Selector ========== */
.haq-qari-selector {
    position: relative;
    margin-top: 16px;
    display: inline-block;
    z-index: 20;
}

.haq-qari-current {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 50px;
    padding: 6px 16px 6px 6px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(6px);
}

.haq-qari-current:hover {
    background: rgba(255,255,255,0.22);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.haq-qari-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--haq-gold-light);
    flex-shrink: 0;
}

.haq-qari-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    min-width: 0;
}

.haq-qari-label {
    font-size: 0.7rem;
    opacity: 0.75;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.2;
}

.haq-qari-name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.haq-qari-arrow {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-left: 4px;
}

.haq-qari-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--haq-bg);
    border: 1px solid var(--haq-border);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    min-width: 280px;
    max-height: 340px;
    overflow-y: auto;
    z-index: 50;
    padding: 8px;
}

.haq-qari-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.15s;
    color: var(--haq-text);
}

.haq-qari-option:hover {
    background: var(--haq-cream);
}

.haq-qari-option.active {
    background: rgba(13, 79, 60, 0.1);
}

[data-haq-theme="dark"] .haq-qari-option.active {
    background: rgba(26, 122, 92, 0.2);
}

.haq-qari-option-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--haq-border);
    flex-shrink: 0;
}

.haq-qari-option.active .haq-qari-option-avatar {
    border-color: var(--haq-gold);
}

.haq-qari-option-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.haq-qari-option-name {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--haq-text);
}

.haq-qari-option-ar {
    font-family: var(--haq-font-arabic);
    font-size: 0.85rem;
    color: var(--haq-text-muted);
    margin-top: 1px;
}

.haq-qari-check {
    color: var(--haq-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

@media (max-width: 600px) {
    .haq-qari-name {
        max-width: 120px;
        font-size: 0.85rem;
    }
    .haq-qari-dropdown {
        min-width: 260px;
    }
}
