/* ===================================================================
   maddahis.css
   فایل کامل و مستقل برای maddahis.html — شامل قوانین پایه،
   هدر کامل (نوار بالا، لوگو، منو، جستجو، تم، همبرگری)،
   استایل‌های اختصاصی همین صفحه، و فوتر کامل (شامل نوار پایین موبایل).
   =================================================================== */

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

html {
    scroll-behavior: smooth
}


:root {
    --ink: #0b0c10;
    --ink2: #111318;
    --card: #161820;
    --card2: #1c1f2a;
    --border: rgba(255, 255, 255, 0.06);
    --border2: rgba(255, 255, 255, 0.1);
    --ruby: #c0392b;
    --ruby2: #e74c3c;
    --ruby-glow: rgba(192, 57, 43, 0.25);
    --teal: #1a8c8c;
    --teal2: #22b8b8;
    --silver: #b0bec5;
    --silver2: #cfd8dc;
    --muted: #5a6070;
    --muted2: #7a8090;
    --white: #f0f2f5;
}


body {
    background: var(--ink);
    color: var(--white);
    font-family: 'Vazirmatn', sans-serif;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 0;
}

/* ─── LIGHT THEME ─── */
body.light-theme {
    --ink: #f0ede8;
    --ink2: #e6e2db;
    --card: #ffffff;
    --card2: #f5f2ed;
    --border: rgba(0, 0, 0, 0.10);
    --border2: rgba(0, 0, 0, 0.18);
    --silver: #374151;
    --silver2: #111827;
    --muted: #6b7280;
    --muted2: #4b5563;
    --white: #0f172a;
}

/* ─── GRAIN + GLOW ─── */
.grain-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
    opacity: 0.025;
    mix-blend-mode: overlay;
}

.radial-glow {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 900px;
    height: 500px;
    background: radial-gradient(ellipse, rgba(192, 57, 43, 0.12) 0%, transparent 65%);
    z-index: 1;
    pointer-events: none;
    animation: glowPulse 8s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% {
        opacity: 0.7;
        transform: translateX(-50%) scale(1)
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) scale(1.1)
    }
}

body.light-theme .radial-glow {
    background: radial-gradient(ellipse, rgba(192, 57, 43, 0.07) 0%, transparent 65%);
}

body.light-theme .grain-overlay {
    opacity: 0.015;
    mix-blend-mode: multiply;
}

body.light-theme .nav-tabs a:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.06);
}

/* پخش زنده */
.nav-live {
    display: flex !important;
    align-items: center;
    gap: 0.45rem;
    color: #ff4444 !important;
    font-weight: 700 !important;
}

.nav-live:hover {
    background: rgba(255, 68, 68, 0.12) !important;
    color: #ff6666 !important;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4444;
    flex-shrink: 0;
    box-shadow: 0 0 6px #ff4444;
    animation: livePulse 1.4s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
        box-shadow: 0 0 6px #ff4444;
    }
    50% {
        opacity: 0.6;
        transform: scale(0.8);
        box-shadow: 0 0 12px #ff4444;
    }
}

.btn-theme-toggle:hover .theme-icon {
    transform: rotate(20deg) scale(1.2);
}

body.light-theme .btn-theme-toggle:hover {
    border-color: var(--ruby);
    color: var(--ruby);
}

/* ─── PAGE WRAP ─── */
.page-wrap {
    position: relative;
    z-index: 2;

}

/* ─── PAGE HEADER ─── */
.page-header {
    padding: 3rem 2rem 2rem;
    text-align: center;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to bottom, rgba(192, 57, 43, 0.05), transparent);
}

.page-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ruby);
    font-weight: 600;
    display: block;
    margin-bottom: 0.6rem;
}

.page-title {
    font-family: 'Scheherazade New', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    background: linear-gradient(135deg, #fff 30%, rgba(192, 57, 43, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.light-theme .page-title {
    background: linear-gradient(135deg, #0f172a 30%, var(--ruby));
    -webkit-background-clip: text;
    background-clip: text;
}

.page-count {
    font-size: 0.82rem;
    color: var(--muted2);
    margin-top: 0.5rem;
}

/* ─── FILTER BAR ─── */
.filter-section {
    padding: 1.5rem 2rem;
    background: var(--ink2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 68px;
    z-index: 100;
}

body.light-theme .filter-section {
    background: var(--card2);
}

.filter-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    max-width: 1200px;
    margin: 0 auto;
    flex-wrap: wrap;
}

/* ── دکمه دسته‌بندی کشویی ── */
.dropdown-wrapper {
    position: relative;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 1.1rem;
    background: var(--card);
    border: 1px solid var(--border2);
    border-radius: 10px;
    color: var(--silver2);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.22s;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--ruby);
    color: var(--white);
}

.filter-btn.active {
    border-color: var(--ruby);
    background: rgba(192, 57, 43, 0.12);
    color: var(--white);
}

.filter-btn .chevron {
    width: 14px;
    height: 14px;
    transition: transform 0.3s;
    flex-shrink: 0;
    color: var(--muted2);
}

.filter-btn.open .chevron {
    transform: rotate(180deg);
}

.filter-btn .badge {
    background: var(--ruby);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 20px;
    padding: 0.1rem 0.45rem;
    min-width: 18px;
    text-align: center;
}

body.light-theme .filter-btn {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.15);
    color: #374151;
}

body.light-theme .filter-btn:hover {
    border-color: var(--ruby);
    color: #0f172a;
}

body.light-theme .filter-btn.active {
    background: rgba(192, 57, 43, 0.08);
    color: #0f172a;
}

/* ── پنل کشویی ── */
.dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--card2);
    border: 1px solid var(--border2);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    z-index: 200;
    overflow: hidden;
    display: none;
    animation: dropIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dropdown-panel.open {
    display: block;
}

body.light-theme .dropdown-panel {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.dropdown-panel-header {
    padding: 1rem 1.2rem 0.75rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dropdown-panel-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted2);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dropdown-clear {
    font-size: 0.75rem;
    color: var(--ruby);
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Vazirmatn', sans-serif;
    font-weight: 600;
    padding: 0;
}

.dropdown-clear:hover {
    color: var(--ruby2);
}

.dropdown-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    padding: 0.9rem 1rem;
}

.cat-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.6rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.18s;
    font-size: 0.85rem;
    color: var(--silver);
    user-select: none;
}

.cat-item:hover {
    background: rgba(192, 57, 43, 0.08);
    border-color: rgba(192, 57, 43, 0.2);
    color: var(--white);
}

.cat-item.selected {
    background: rgba(192, 57, 43, 0.15);
    border-color: rgba(192, 57, 43, 0.4);
    color: #fff;
}

.cat-item .cat-emoji {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.cat-check {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--muted);
    margin-right: auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s;
    font-size: 0.65rem;
}

.cat-item.selected .cat-check {
    background: var(--ruby);
    border-color: var(--ruby);
    color: #fff;
}

.cat-item.selected .cat-check::after {
    content: '✓';
}

body.light-theme .cat-item {
    color: #374151;
}

body.light-theme .cat-item:hover {
    color: #0f172a;
}

body.light-theme .cat-item.selected {
    color: #0f172a;
}

.dropdown-panel-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.6rem;
}

.btn-apply {
    flex: 1;
    padding: 0.6rem;
    background: var(--ruby);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-apply:hover {
    background: var(--ruby2);
}

.btn-cancel {
    padding: 0.6rem 1rem;
    background: none;
    border: 1px solid var(--border2);
    color: var(--muted2);
    border-radius: 9px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    border-color: var(--muted);
    color: var(--white);
}

/* ── انتخاب سال ── */
.year-scroll {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
    flex: 1;
}

.year-scroll::-webkit-scrollbar {
    display: none;
}

.year-chip {
    padding: 0.45rem 1rem;
    border-radius: 50px;
    border: 1px solid var(--border2);
    background: var(--card);
    color: var(--muted2);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.year-chip:hover {
    border-color: var(--ruby);
    color: var(--white);
}

.year-chip.active {
    background: var(--ruby);
    border-color: var(--ruby);
    color: #fff;
    box-shadow: 0 2px 12px var(--ruby-glow);
}

body.light-theme .year-chip {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.15);
    color: #4b5563;
}

body.light-theme .year-chip:hover {
    border-color: var(--ruby);
    color: #0f172a;
}

/* تگ‌های فعال */
.active-filters {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
}

.active-filters:empty {
    display: none;
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    background: rgba(192, 57, 43, 0.15);
    border: 1px solid rgba(192, 57, 43, 0.35);
    border-radius: 50px;
    font-size: 0.75rem;
    color: #ff8a80;
    font-weight: 600;
    animation: tagIn 0.2s ease;
}

@keyframes tagIn {
    from {
        opacity: 0;
        transform: scale(0.85)
    }
    to {
        opacity: 1;
        transform: scale(1)
    }
}

.filter-tag button {
    background: none;
    border: none;
    color: #ff8a80;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    padding: 0;
    transition: color 0.15s;
}

.filter-tag button:hover {
    color: #fff;
}

/* فرم مخفی */
.hidden-form {
    display: none;
}

/* ─── LIST ─── */
.list-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* دسکتاپ: گرید */
.madahi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 0.85rem;
}

.madahi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1.1rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.madahi-card::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--ruby);
    transform: scaleY(0);
    border-radius: 0 14px 14px 0;
    transition: transform 0.25s;
}

.madahi-card:hover {
    background: var(--card2);
    border-color: var(--border2);
    transform: translateX(3px);
}

.madahi-card:hover::after {
    transform: scaleY(1);
}

body.light-theme .madahi-card {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.08);
}

body.light-theme .madahi-card:hover {
    background: var(--card2);
}

/* تامبنیل */
.madahi-thumb {
    aspect-ratio: 1/1;
    width: 58px;
    height: 58px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.3), rgba(11, 12, 16, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border2);
}

.madahi-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

/* دکمه پخش */
.play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(192, 57, 43, 0.85);
    opacity: 0;
    border-radius: 9px;
    transition: opacity 0.2s;
}

.madahi-card:hover .play-btn {
    opacity: 1;
}

.play-btn svg {
    width: 20px;
    height: 20px;
    fill: #fff;
}

/* متن */
.madahi-body {
    flex: 1;
    min-width: 0;
}

.madahi-title {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
    color: var(--white);
}

body.light-theme .madahi-title {
    color: #0f172a;
}

.madahi-meta {
    font-size: 0.76rem;
    color: var(--muted2);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.madahi-reciter {
    color: var(--silver);
    font-weight: 500;
    font-size: 0.82rem;
}

body.light-theme .madahi-reciter {
    color: #374151;
}

.madahi-tags {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.35rem;
    flex-wrap: wrap;
}

.madahi-tag {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    background: rgba(192, 57, 43, 0.15);
    border: 1px solid rgba(192, 57, 43, 0.3);
    border-radius: 20px;
    color: #ff8a80;
    font-weight: 600;
}

body.light-theme .madahi-tag {
    background: rgba(192, 57, 43, 0.08);
}

/* سمت چپ */
.madahi-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    flex-shrink: 0;
}

.madahi-duration {
    font-size: 0.75rem;
    color: var(--muted2);
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

.btn-dl {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border2);
    background: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--muted2);
}

.btn-dl:hover {
    border-color: var(--teal);
    color: var(--teal2);
    background: rgba(26, 140, 140, 0.1);
}

.btn-dl svg {
    width: 14px;
    height: 14px;
}

/* موبایل: لیست کامل‌تر */
@media (max-width: 900px) {
    .madahi-grid {
        grid-template-columns:1fr;
    }

    .filter-section {
        top: 68px;
    }

    .filter-row {
        gap: 0.6rem;
    }


    .page-header {
        padding: 2rem 1.2rem 1.5rem;
    }

    .list-section {
        padding: 1.2rem;
    }

    .madahi-card {
        padding: 0.85rem;
    }

    .dropdown-panel {
        right: auto;
        left: 0;
    }
}

@media (max-width: 600px) {
    .theme-label {
        display: none !important;
    }

    nav.top-nav {
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .btn-theme-toggle {
        padding: 0.4rem 0.65rem;
    }

    .filter-row {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .filter-row::-webkit-scrollbar {
        display: none;
    }

    .filter-btn {
        font-size: 0.82rem;
        padding: 0.48rem 0.9rem;
    }

    .dropdown-panel {
        min-width: calc(100vw - 2rem);
        right: auto;
        left: 0;
    }

    .dropdown-grid {
        grid-template-columns:1fr 1fr;
    }

    .year-scroll {
        flex: none;
        width: 100%;
        order: 10;
        margin-top: 0.1rem;
    }

    .filter-row {
        flex-wrap: wrap;
    }
}

/* ─── PAGINATION ─── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 2rem 0 1rem;
    flex-wrap: wrap;
}

.page-btn {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: 1px solid var(--border2);
    background: var(--card);
    color: var(--muted2);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn:hover {
    border-color: var(--ruby);
    color: var(--white);
}

.page-btn.active {
    background: var(--ruby);
    border-color: var(--ruby);
    color: #fff;
    box-shadow: 0 2px 12px var(--ruby-glow);
}

.page-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

body.light-theme .page-btn {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.12);
    color: #4b5563;
}

body.light-theme .page-btn:hover {
    color: #0f172a;
}

/* ─── EMPTY STATE ─── */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state .empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    color: var(--muted2);
    font-size: 0.9rem;
}

/* reveal */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal.vis {
    opacity: 1;
    transform: translateY(0);
}

/* ═══ PLAYER BAR ═══ */
.player-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 600;
    height: 82px;
    background: rgba(14, 15, 20, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border2);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.player-bar.visible {
    transform: translateY(0);
}

body.light-theme .player-bar {
    background: rgba(228, 224, 217, 0.98);
}

.player-info {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    min-width: 190px;
    flex: 0 0 auto;
}

.player-thumb {
    width: 50px;
    height: 50px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    border: 1px solid var(--border2);
    background: rgba(192, 57, 43, 0.1);
}

.player-track-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

body.light-theme .player-track-name {
    color: #0f172a;
}

.player-track-reciter {
    font-size: 0.72rem;
    color: var(--muted2);
    margin-top: 0.12rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.player-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.player-btns {
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.ctrl-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: none;
    color: var(--muted2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    color: var(--white);
}

.ctrl-btn svg {
    width: 17px;
    height: 17px;
}

.ctrl-btn.active {
    color: var(--ruby);
}

body.light-theme .ctrl-btn {
    color: #6b7280;
}

body.light-theme .ctrl-btn:hover {
    color: #0f172a;
}

.play-main-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--ruby);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 18px var(--ruby-glow);
    color: #fff;
}

.play-main-btn:hover {
    background: var(--ruby2);
    transform: scale(1.07);
}

.play-main-btn svg {
    width: 20px;
    height: 20px;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    width: 100%;
    max-width: 520px;
}

.p-time {
    font-size: 0.68rem;
    color: var(--muted2);
    direction: ltr;
    white-space: nowrap;
    min-width: 34px;
    font-variant-numeric: tabular-nums;
}

.progress-track {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

body.light-theme .progress-track {
    background: rgba(0, 0, 0, 0.12);
}

.progress-fill {
    height: 100%;
    background: var(--ruby);
    border-radius: 4px;
    width: 0%;
    transition: width 0.25s linear;
    pointer-events: none;
}

.p-thumb {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translate(50%, -50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.progress-track:hover .p-thumb {
    opacity: 1;
}

.player-vol {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 0 0 auto;
}

.vol-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    color: var(--muted2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vol-btn svg {
    width: 16px;
    height: 16px;
}

body.light-theme .vol-btn {
    color: #6b7280;
}

.vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

body.light-theme .vol-slider {
    background: rgba(0, 0, 0, 0.12);
}

/* کارت در حال پخش */
.madahi-card.playing {
    border-color: rgba(192, 57, 43, 0.45) !important;
    background: rgba(192, 57, 43, 0.07) !important;
}

body.light-theme .madahi-card.playing {
    background: rgba(192, 57, 43, 0.05) !important;
}

/* موج روی کارت */
.card-wave {
    display: none;
    align-items: center;
    gap: 2px;
    height: 18px;
}

.madahi-card.playing .card-wave {
    display: flex;
}

.madahi-card.playing .btn-dl {
    display: none;
}

.w-bar {
    width: 3px;
    border-radius: 2px;
    background: var(--ruby);
    animation: wv 1s ease-in-out infinite;
}

.w-bar:nth-child(1) {
    height: 5px;
    animation-delay: 0s
}

.w-bar:nth-child(2) {
    height: 12px;
    animation-delay: .15s
}

.w-bar:nth-child(3) {
    height: 7px;
    animation-delay: .3s
}

.w-bar:nth-child(4) {
    height: 14px;
    animation-delay: .1s
}

.w-bar:nth-child(5) {
    height: 5px;
    animation-delay: .25s
}

@keyframes wv {
    0%, 100% {
        transform: scaleY(0.35)
    }
    50% {
        transform: scaleY(1)
    }
}

@media (max-width: 900px) {
    .player-vol {
        display: none;
    }

    .player-info {
        min-width: 130px;
    }

    .player-track-name, .player-track-reciter {
        max-width: 110px;
    }
}

@media (max-width: 600px) {
    .player-bar {
        padding: 0 1rem;
        gap: 0.8rem;
    }

    .progress-row {
        display: none;
    }

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

    .player-controls {
        flex: 0 0 auto;
    }
}

/* ─── NEW DROPDOWN ─── */
.dd-wrap {
    position: relative;
}

.dd-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 190px;
    background: var(--card);
    border: 1px solid var(--border2);
    border-radius: 14px;
    padding: 0.5rem;
    z-index: 500;
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(.97);
    transition: all .22s cubic-bezier(.34, 1.2, .64, 1);
    transform-origin: top right;
}

.dd-wrap.open .dd-panel {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0) scale(1);
}

.dd-wrap.open .chevron {
    transform: rotate(180deg);
}

.dd-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .52rem .85rem;
    border-radius: 9px;
    text-decoration: none;
    color: var(--muted2);
    font-size: .88rem;
    font-weight: 500;
    transition: all .15s;
}

.dd-item:hover {
    background: rgba(192, 57, 43, .1);
    color: var(--white);
}

.dd-item.active {
    background: rgba(192, 57, 43, .18);
    color: var(--ruby2);
    font-weight: 700;
}

.dd-emoji {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.dd-divider {
    height: 1px;
    background: var(--border);
    margin: .4rem 0;
}

#activeTag a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: rgba(192, 57, 43, .12);
    border: 1px solid rgba(192, 57, 43, .3);
    border-radius: 50px;
    padding: .28rem .85rem;
    color: var(--ruby2);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all .2s;
}

#activeTag a:hover {
    background: rgba(192, 57, 43, .22);
}

body.light-theme .dd-panel {
    background: #fff;
    border-color: rgba(0, 0, 0, .12);
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
}

body.light-theme .dd-item {
    color: #374151;
}

body.light-theme .dd-item:hover {
    background: rgba(192, 57, 43, .07);
    color: #0f172a;
}

/* ─── NAV ─── */
nav.top-nav {
    position: sticky;
    top: 0;
    z-index: 200;
    height: 68px;
    background: rgba(11, 12, 16, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border2);
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    gap: 1rem;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ruby), #7b1a10);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Scheherazade New', serif;
    font-size: 1.1rem;
    color: #fff;
    box-shadow: 0 0 16px var(--ruby-glow);
    flex-shrink: 0;
}

.logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--muted2);
    font-weight: 400;
    display: block;
}

.nav-tabs {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 5px;
}

.nav-tabs a {
    display: block;
    padding: 0.38rem 1.1rem;
    border-radius: 40px;
    color: var(--muted2);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.25s;
    white-space: nowrap;
}

.nav-tabs a:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.07);
}

.nav-tabs a.active {
    background: var(--ruby);
    color: #fff;
    box-shadow: 0 2px 12px var(--ruby-glow);
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    position: relative;
}

.btn-theme-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.42rem 1.1rem;
    border: 1px solid var(--border2);
    background: rgba(255, 255, 255, 0.06);
    color: var(--silver2);
    border-radius: 50px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    white-space: nowrap;
    backdrop-filter: blur(8px);
    position: relative;
    overflow: hidden;
}

.btn-theme-toggle::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(192, 57, 43, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-theme-toggle:hover {
    border-color: var(--ruby);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px var(--ruby-glow);
}

.btn-theme-toggle:hover::before {
    opacity: 1;
}

.btn-theme-toggle:active {
    transform: scale(0.97);
}

.theme-icon {
    font-size: 1rem;
    transition: transform 0.5s ease;
    display: inline-block;
}

.btn-theme-toggle:hover .theme-icon {
    transform: rotate(20deg) scale(1.2);
}

.theme-label {
    font-size: 0.82rem;
}

.btn-search-mobile {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border2);
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.btn-search-mobile svg {
    width: 17px;
    height: 17px;
    color: var(--silver2);
    transition: color 0.2s;
}

.btn-search-mobile:hover {
    border-color: var(--ruby);
    background: rgba(192, 57, 43, 0.1);
}

.btn-search-mobile:hover svg {
    color: var(--ruby);
}

.btn-search-mobile.active {
    border-color: var(--ruby);
    background: rgba(192, 57, 43, 0.12);
}

.btn-search-mobile.active svg {
    color: var(--ruby);
}

.nav-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border2);
    border-radius: 50px;
    padding: 0.35rem 0.9rem;
    transition: all 0.3s ease;
    width: 240px;
    position: relative;
}

.nav-search:focus-within {
    border-color: var(--ruby);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px var(--ruby-glow);
    width: 290px;
}

.search-icon-inline {
    width: 16px;
    height: 16px;
    color: var(--muted2);
    flex-shrink: 0;
    transition: color 0.2s;
}

.nav-search:focus-within .search-icon-inline {
    color: var(--ruby);
}

.search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--white);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.83rem;
    width: 100%;
    min-width: 0;
}

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

.search-clear {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    display: none;
    transition: color 0.2s;
    flex-shrink: 0;
}

.search-clear:hover {
    color: var(--ruby);
}

.search-input:not(:placeholder-shown) ~ .search-clear {
    display: block;
}

.mobile-search-panel {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    background: rgba(11, 12, 16, 0.97);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border2);
    z-index: 199;
    animation: slideDown 0.22s ease;
}

.mobile-search-panel.open {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px)
    }
    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.mobile-search-inner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border2);
    border-radius: 50px;
    padding: 0.5rem 1rem;
}

.mobile-search-inner:focus-within {
    border-color: var(--ruby);
    box-shadow: 0 0 0 3px var(--ruby-glow);
}

.mobile-search-inner svg {
    width: 16px;
    height: 16px;
    color: var(--muted2);
    flex-shrink: 0;
}

.mobile-search-input {
    background: none;
    border: none;
    outline: none;
    color: var(--white);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 0.9rem;
    width: 100%;
}

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

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 4px;
    border: none;
    background: none;
}

.hamburger span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--silver2);
    border-radius: 2px;
    transition: 0.3s;
}

@keyframes liveDot {
    0%, 100% {
        opacity: 1;
        transform: scale(1)
    }
    50% {
        opacity: 0.5;
        transform: scale(0.7)
    }
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97)
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

.srp-popular-tag {
    padding: 0.25rem 0.7rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border2);
    color: var(--muted2);
    font-size: 0.74rem;
    cursor: pointer;
    transition: all 0.18s;
    font-family: 'Vazirmatn', sans-serif;
}

.srp-popular-tag:hover {
    border-color: var(--ruby);
    color: var(--white);
    background: rgba(192, 57, 43, 0.1);
}

/* تم روشن */
body.light-theme nav.top-nav {
    background: rgba(240, 237, 232, 0.95);
}

body.light-theme .logo-text {
    color: #0f172a;
}

body.light-theme .logo-sub {
    color: #4b5563;
}

body.light-theme .nav-tabs a {
    color: #374151;
}

body.light-theme .nav-tabs a:hover {
    color: #0f172a;
    background: rgba(0, 0, 0, 0.06);
}

body.light-theme .nav-tabs {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .btn-theme-toggle {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
    color: #2d3748;
}

body.light-theme .btn-theme-toggle:hover {
    border-color: var(--ruby);
    color: var(--ruby);
    background: rgba(192, 57, 43, 0.07);
}

body.light-theme .nav-search {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .nav-search:focus-within {
    background: #fff;
}

body.light-theme .search-input {
    color: #0f172a;
}

body.light-theme .mobile-search-panel {
    background: rgba(240, 237, 232, 0.98);
    border-color: rgba(0, 0, 0, 0.12);
}

body.light-theme .mobile-search-inner {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
}

body.light-theme .mobile-search-input {
    color: #0f172a;
}

body.light-theme .srp-popular-tag {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: #4b5563;
}

body.light-theme .srp-popular-tag:hover {
    color: #0f172a;
    border-color: var(--ruby);
}

body.light-theme #searchPanel {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

/* ریسپانسیو */
@media (max-width: 900px) {
    .nav-tabs {
        display: none !important;
    }

    .nav-search {
        display: none !important;
    }

    .btn-search-mobile {
        display: flex !important;
    }

    .theme-label {
        display: inline !important;
        font-size: 0.82rem;
    }
}

@media (max-width: 600px) {
    nav.top-nav {
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .logo-text {
        font-size: 0.9rem;
    }

    .logo-sub {
        font-size: 0.6rem;
    }

    .theme-label {
        display: none !important;
    }

    .btn-theme-toggle {
        padding: 0.4rem 0.65rem;
    }

    .theme-icon {
        font-size: 1.1rem;
    }
}

/* ─── FOOTER ─── */
footer {
    background: #070809;
    border-top: 1px solid var(--border);
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 1;
    margin-top: auto;
}

@media (max-width: 900px) {
    footer {
        margin-bottom: 64px;
    }
}

.footer-logo {
    font-family: 'Scheherazade New', serif;
    font-size: 1.3rem;
    color: var(--ruby);
    margin-bottom: 0.4rem;
}

.footer-copy {
    font-size: 0.78rem;
    color: var(--muted);
}

body.light-theme footer {
    background: #e6e2db;
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .footer-logo {
    color: var(--ruby);
}

body.light-theme .footer-copy {
    color: #4b5563;
}

.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 300;
    height: 64px;
    background: rgba(11, 12, 16, 0.96);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border2);
    padding: 0 0.5rem;
}

.bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 100%;
}

.bnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--muted2);
    padding: 6px 10px;
    border-radius: 12px;
    transition: all 0.2s;
    min-width: 52px;
    flex: 1;
}

.bnav-item:hover,
.bnav-item.active {
    color: var(--ruby2);
    background: rgba(192, 57, 43, 0.1);
}

.bnav-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.bnav-label {
    font-size: 0.62rem;
    font-weight: 600;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .bottom-nav {
        display: block;
    }


}
/* ============================================================
   صفحه‌بندی - فقط ۳ دایره (راست به چپ)
   ============================================================ */

.pagination {
    margin-top: 2rem;
    padding: 1.5rem 0;
    text-align: center;
}

.pagination-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    direction: ltr;  /* ← چپ به راست برای چیدمان عناصر */
}

/* دایره‌های شماره */
.page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--muted2);
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    background: rgba(255,255,255,0.04);
    flex-shrink: 0;
}

.page-num:hover {
    border-color: var(--ruby);
    color: var(--white);
    background: rgba(192,57,43,0.15);
    transform: scale(1.05);
}

.page-num.active {
    background: var(--ruby);
    color: #fff;
    box-shadow: 0 2px 18px var(--ruby-glow);
    border-color: var(--ruby);
    transform: scale(1.15);
    width: 50px;
    height: 50px;
    font-size: 1.1rem;
    font-weight: 700;
}

/* ============================================================
   تم روشن (Light Theme)
   ============================================================ */

body.light-theme .page-num {
    background: rgba(0,0,0,0.04);
    color: #4b5563;
}

body.light-theme .page-num:hover {
    border-color: var(--ruby);
    color: #0f172a;
    background: rgba(192,57,43,0.08);
}

body.light-theme .page-num.active {
    background: var(--ruby);
    color: #fff;
}