/* ============================================================
   IslamicMedia Aggregator — style.css
   Deep Night + Warm Gold
   ============================================================ */
:root {
    --bg:           #0d0f14;
    --bg-card:      #13161e;
    --bg-raised:    #1a1e28;
    --bg-hover:     #1f2435;
    --border:       #252a3a;
    --border-light: #2e3448;

    --gold:         #c8973a;
    --gold-light:   #e0b45a;
    --gold-dim:     #8a6426;
    --gold-glow:    rgba(200,151,58,.18);

    --text:         #e8e6df;
    --text-muted:   #8a8fa8;
    --text-dim:     #545870;

    --green:        #2ea84d;
    --red:          #e04444;
    --red-muted:    rgba(224,68,68,.7);

    --radius:       10px;
    --radius-lg:    16px;
    --radius-pill:  999px;
    --shadow:       0 4px 24px rgba(0,0,0,.45);
    --shadow-gold:  0 0 32px rgba(200,151,58,.14);
    --transition:   .2s ease;
    --header-h:     64px;

    --font-display: 'Amiri', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', monospace;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); background: var(--bg); color: var(--text);
       font-size: 15px; line-height: 1.6; min-height: 100vh; -webkit-font-smoothing: antialiased; }
a    { color: inherit; text-decoration: none; }
img  { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }

/* ── Header ────────────────────────────────────────────────── */
.site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(13,15,20,.93); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border); height: var(--header-h);
}
.header-inner { max-width: 1400px; margin: 0 auto; padding: 0 24px;
                height: 100%; display: flex; align-items: center; gap: 18px; }
.logo { display: flex; flex-direction: column; line-height: 1; flex-shrink: 0; }
.logo:hover { opacity: .8; }
.logo-arabic { font-family: var(--font-display); font-size: 18px; color: var(--gold); }
.logo-text   { font-size: 11px; font-weight: 500; letter-spacing: .12em;
               text-transform: uppercase; color: var(--text-muted); }

.header-search { flex: 1; max-width: 480px; display: flex; align-items: center;
                 background: var(--bg-raised); border: 1px solid var(--border);
                 border-radius: var(--radius-pill); overflow: hidden;
                 transition: border-color var(--transition), box-shadow var(--transition); }
.header-search:focus-within { border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-glow); }
.header-search input { flex: 1; background: none; border: none; outline: none;
                       color: var(--text); padding: 9px 16px; font-size: 14px; }
.header-search input::placeholder { color: var(--text-dim); }
.header-search button { background: none; border: none; padding: 8px 14px;
                        color: var(--text-muted); display: flex; align-items: center; cursor: pointer; }
.header-search button:hover { color: var(--gold); }
.header-search button svg { width: 16px; height: 16px; }

.header-nav { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.header-nav a { padding: 6px 12px; border-radius: var(--radius); font-size: 14px;
                font-weight: 500; color: var(--text-muted);
                transition: color var(--transition), background var(--transition); }
.header-nav a:hover { color: var(--text); background: var(--bg-hover); }
.btn-nav-login { color: var(--text) !important; }
.btn-nav-register { background: var(--gold) !important; color: #0d0f14 !important;
                    font-weight: 700 !important; }
.btn-nav-register:hover { background: var(--gold-light) !important; }
.nav-admin { color: var(--gold) !important; border: 1px solid var(--gold-dim) !important; }

.nav-user { display: flex; align-items: center; gap: 8px; padding: 4px 12px;
            border-radius: var(--radius-pill); background: var(--bg-raised);
            border: 1px solid var(--border); font-size: 13px; }
.nav-avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--gold);
              color: #0d0f14; display: flex; align-items: center; justify-content: center;
              font-weight: 700; font-size: 12px; flex-shrink: 0; }

.mobile-menu-toggle { display: none; flex-direction: column; gap: 5px;
                      background: none; border: none; padding: 8px; cursor: pointer; }
.mobile-menu-toggle span { display: block; width: 22px; height: 2px;
                           background: var(--text-muted); border-radius: 2px; }
.mobile-nav { display: none; flex-direction: column; background: var(--bg-card);
              border-top: 1px solid var(--border); }
.mobile-nav a { padding: 12px 24px; font-size: 15px; color: var(--text-muted);
                border-bottom: 1px solid var(--border); }
.mobile-nav.open { display: flex; }

/* ── Flash ─────────────────────────────────────────────────── */
.flash { padding: 12px 24px; display: flex; align-items: center;
         justify-content: space-between; font-size: 14px; font-weight: 500; }
.flash--success { background: rgba(46,168,77,.15); color: #5ecc7d; border-bottom: 1px solid rgba(46,168,77,.25); }
.flash--error   { background: rgba(224,68,68,.15); color: #f07070; border-bottom: 1px solid rgba(224,68,68,.25); }
.flash--info    { background: rgba(200,151,58,.12); color: var(--gold); border-bottom: 1px solid var(--gold-dim); }
.flash-close { background: none; border: none; font-size: 20px; color: currentColor; opacity: .6; cursor: pointer; }

/* ── Layout ─────────────────────────────────────────────────── */
.page-wrap { max-width: 1400px; margin: 0 auto; padding: 32px 24px 64px; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; }
.section-title { font-family: var(--font-display); font-size: 22px; color: var(--text);
                 display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ''; display: inline-block; width: 4px; height: 22px;
                          background: var(--gold); border-radius: 2px; }
.section-link { font-size: 13px; color: var(--gold); font-weight: 500; }
.section-link:hover { color: var(--gold-light); }

/* ── Hero Banner ────────────────────────────────────────────── */
.hero-banner { position: relative; border-radius: var(--radius-lg); overflow: hidden;
               margin-bottom: 48px; min-height: 360px; display: flex; align-items: flex-end;
               background: var(--bg-raised); }
.hero-banner__bg { position: absolute; inset: 0; object-fit: cover;
                   width: 100%; height: 100%; opacity: .45; }
.hero-banner__overlay { position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(13,15,20,.98) 0%, rgba(13,15,20,.2) 60%, transparent 100%); }
.hero-banner__content { position: relative; padding: 48px; max-width: 640px; }
.hero-badge { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .1em;
              text-transform: uppercase; color: var(--gold); border: 1px solid var(--gold-dim);
              padding: 3px 10px; border-radius: var(--radius-pill); margin-bottom: 12px; }
.hero-title  { font-family: var(--font-display); font-size: 30px; line-height: 1.25;
               margin-bottom: 10px; color: #fff; }
.hero-meta   { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; display: flex; gap: 12px; flex-wrap: wrap; }
.hero-btn { display: inline-flex; align-items: center; gap: 8px; background: var(--gold);
            color: #0d0f14; font-weight: 700; font-size: 14px; padding: 11px 24px;
            border-radius: var(--radius-pill); transition: background var(--transition); }
.hero-btn:hover { background: var(--gold-light); }
.hero-btn svg { width: 14px; height: 14px; }

/* ── Video Grid & Cards ─────────────────────────────────────── */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 20px; }

.video-card { background: var(--bg-card); border: 1px solid var(--border);
              border-radius: var(--radius-lg); overflow: hidden;
              transition: transform .22s, border-color .22s, box-shadow .22s; }
.video-card:hover { transform: translateY(-3px); border-color: var(--border-light);
                    box-shadow: var(--shadow); }
.video-card__thumb { position: relative; display: block; aspect-ratio: 16/9;
                     overflow: hidden; background: var(--bg-raised); }
.video-card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.video-card:hover .video-card__thumb img { transform: scale(1.04); }
.video-card__duration { position: absolute; bottom: 8px; right: 8px;
    background: rgba(0,0,0,.8); color: #fff; font-size: 11px; font-family: var(--font-mono);
    padding: 2px 6px; border-radius: 4px; }
.video-card__badges { position: absolute; top: 8px; left: 8px; display: flex; gap: 4px; }
.video-card__play { position: absolute; inset: 0; display: flex; align-items: center;
                    justify-content: center; background: rgba(0,0,0,0); transition: background .2s; }
.video-card__play svg { width: 44px; height: 44px; color: #fff; opacity: 0;
                        transform: scale(.8); transition: opacity .2s, transform .2s;
                        filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.video-card:hover .video-card__play { background: rgba(0,0,0,.25); }
.video-card:hover .video-card__play svg { opacity: 1; transform: scale(1); }
.audio-badge { position: absolute; top: 8px; right: 8px;
    background: rgba(200,151,58,.85); color: #0d0f14; font-size: 10px; font-weight: 700;
    padding: 2px 7px; border-radius: 4px; }

.video-card__info  { padding: 14px 16px 16px; }
.video-card__title { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 4px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-card__title a:hover { color: var(--gold-light); }
.video-card__speaker { font-size: 13px; color: var(--gold); margin-bottom: 6px; font-weight: 500; }
.video-card__meta { font-size: 12px; color: var(--text-dim); display: flex;
                    flex-wrap: wrap; gap: 4px; align-items: center; }
.dot { color: var(--border-light); }
.video-card__cat { background: var(--bg-raised); padding: 1px 7px;
                   border-radius: var(--radius-pill); color: var(--text-muted); }

/* ── Filter Pills ───────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 28px; }
.filter-pill { padding: 6px 14px; border-radius: var(--radius-pill); border: 1px solid var(--border);
               background: var(--bg-card); color: var(--text-muted); font-size: 13px;
               font-weight: 500; transition: all var(--transition); display: inline-block; cursor: pointer; }
.filter-pill:hover, .filter-pill.active { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); }
.filter-right { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.filter-label { font-size: 12px; color: var(--text-dim); }

/* ── Platform pills ─────────────────────────────────────────── */
.platform-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.platform-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
                 border-radius: var(--radius-pill); border: 1px solid var(--border);
                 background: var(--bg-card); color: var(--text-muted); font-size: 12px;
                 font-weight: 600; cursor: pointer; transition: all var(--transition); }
.platform-pill:hover, .platform-pill.active { border-color: var(--gold); color: var(--gold); background: var(--gold-glow); }

/* ── Watch Page ─────────────────────────────────────────────── */
.watch-layout { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }

.watch-player-wrap { width: 100%; }
.aspect-box { position: relative; width: 100%; aspect-ratio: 16/9;
              background: #000; border-radius: var(--radius-lg); overflow: hidden; }

/* Audio player styles */
.audio-player-wrap { background: var(--bg-raised); border: 1px solid var(--border);
                     border-radius: var(--radius-lg); padding: 24px; text-align: center; }
.audio-thumb { width: 200px; height: 200px; object-fit: cover; border-radius: var(--radius-lg);
               margin: 0 auto 20px; border: 3px solid var(--border-light); }
.audio-el { width: 100%; margin-top: 8px; accent-color: var(--gold); }
audio::-webkit-media-controls-panel { background: var(--bg-raised); }

.watch-title  { font-family: var(--font-display); font-size: 22px; font-weight: 700;
                line-height: 1.3; margin: 16px 0 10px; }
.watch-meta   { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
                font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.watch-speaker { font-size: 14px; font-weight: 600; color: var(--gold); margin-bottom: 14px; }
.source-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
                color: var(--text-dim); background: var(--bg-raised); border: 1px solid var(--border);
                padding: 3px 10px; border-radius: var(--radius-pill); }
.watch-cat-badge { display: inline-block; background: var(--bg-raised);
                   border: 1px solid var(--border-light); color: var(--text-muted);
                   font-size: 12px; padding: 3px 10px; border-radius: var(--radius-pill); }
.watch-desc { background: var(--bg-raised); border: 1px solid var(--border);
              border-radius: var(--radius); padding: 16px; font-size: 14px;
              line-height: 1.7; color: var(--text-muted); white-space: pre-line; }
.watch-desc-toggle { background: none; border: none; color: var(--gold); font-size: 13px;
                     cursor: pointer; margin-top: 8px; padding: 0; }

/* Reaction bar */
.reaction-bar { display: flex; align-items: center; gap: 8px; padding: 14px 0;
                border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
                margin: 16px 0; }
.reaction-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 18px;
    border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--bg-raised);
    color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer;
    transition: all var(--transition); }
.reaction-btn svg { width: 16px; height: 16px; }
.reaction-btn:hover { border-color: var(--border-light); color: var(--text); }
.reaction-btn.active-like { background: rgba(46,168,77,.15); border-color: rgba(46,168,77,.4); color: #5ecc7d; }
.reaction-btn.active-dislike { background: rgba(224,68,68,.12); border-color: rgba(224,68,68,.3); color: #f07070; }
.reaction-ratio { font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); margin-left: 6px; }

/* Sidebar */
.sidebar-title { font-size: 13px; font-weight: 600; letter-spacing: .06em;
                 text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px; }
.sidebar-list  { display: flex; flex-direction: column; gap: 10px; }
.sidebar-card  { display: flex; gap: 10px; padding: 10px; border-radius: var(--radius);
                 background: var(--bg-card); border: 1px solid var(--border);
                 transition: border-color var(--transition), background var(--transition); }
.sidebar-card:hover { border-color: var(--border-light); background: var(--bg-hover); }
.sidebar-card__thumb { position: relative; width: 108px; flex-shrink: 0;
    border-radius: 6px; overflow: hidden; background: var(--bg-raised); aspect-ratio: 16/9; }
.sidebar-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-card__dur { position: absolute; bottom: 4px; right: 4px; font-size: 10px;
    font-family: var(--font-mono); background: rgba(0,0,0,.8); color: #fff; padding: 1px 4px; border-radius: 3px; }
.sidebar-card__title { font-size: 13px; font-weight: 600; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sidebar-card:hover .sidebar-card__title { color: var(--gold-light); }
.sidebar-card__meta { font-size: 11px; color: var(--text-dim); margin-top: 4px; }

/* ── Pagination ─────────────────────────────────────────────── */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 40px; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: var(--radius); border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text-muted); font-size: 14px; transition: all var(--transition); }
.pagination a:hover { border-color: var(--gold-dim); color: var(--gold); }
.pagination .current { background: var(--gold); border-color: var(--gold); color: #0d0f14; font-weight: 700; }

/* ── Auth ───────────────────────────────────────────────────── */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: flex; align-items: center;
             justify-content: center; padding: 40px 24px;
             background: radial-gradient(ellipse at 50% 0%, rgba(200,151,58,.06) 0%, transparent 60%); }
.auth-box { width: 100%; max-width: 420px; background: var(--bg-card); border: 1px solid var(--border);
            border-radius: var(--radius-lg); padding: 40px; box-shadow: var(--shadow), var(--shadow-gold); }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-arabic { font-size: 32px; display: block; margin-bottom: 4px; }
.auth-title { font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
              color: var(--text-dim); text-align: center; margin-bottom: 28px; }
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em;
              text-transform: uppercase; color: var(--text-dim); margin-bottom: 7px; }
.form-control { width: 100%; background: var(--bg-raised); border: 1px solid var(--border);
                border-radius: var(--radius); padding: 11px 14px; color: var(--text);
                font-size: 14px; outline: none; transition: border-color var(--transition), box-shadow var(--transition); }
.form-control:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-glow); }
.form-control::placeholder { color: var(--text-dim); }
select.form-control { appearance: none; }
.btn-primary { display: block; width: 100%; padding: 12px; background: var(--gold);
               color: #0d0f14; font-weight: 700; font-size: 15px; border: none;
               border-radius: var(--radius); cursor: pointer; transition: background var(--transition); text-align: center; }
.btn-primary:hover { background: var(--gold-light); }
.auth-switch { text-align: center; font-size: 13px; color: var(--text-dim); margin-top: 20px; }
.auth-switch a { color: var(--gold); font-weight: 500; }

/* ── Admin ──────────────────────────────────────────────────── */
.admin-wrap { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - var(--header-h)); }
.admin-sidebar { background: var(--bg-card); border-right: 1px solid var(--border); padding: 24px 0; }
.admin-sidebar h2 { font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
                    color: var(--text-dim); padding: 0 20px; margin-bottom: 8px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px;
               font-size: 14px; color: var(--text-muted); border-left: 3px solid transparent;
               transition: all var(--transition); }
.admin-nav a:hover, .admin-nav a.active { color: var(--gold); background: var(--gold-glow); border-left-color: var(--gold); }
.admin-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.admin-main { padding: 32px; }
.admin-page-title { font-family: var(--font-display); font-size: 26px; margin-bottom: 28px;
                    color: var(--text); display: flex; align-items: center; gap: 12px; }
.admin-page-title::before { content: ''; width: 5px; height: 28px; background: var(--gold); border-radius: 3px; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.stat-card__label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 8px; }
.stat-card__value { font-size: 32px; font-weight: 700; color: var(--gold); font-family: var(--font-mono); line-height: 1; }

.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; padding: 12px 16px; font-size: 11px; letter-spacing: .08em;
                 text-transform: uppercase; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border);
                 color: var(--text-muted); vertical-align: middle; }
.data-table tr:hover td { background: var(--bg-hover); }
.td-title { color: var(--text) !important; font-weight: 500; }
.td-title a:hover { color: var(--gold); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); }
.badge-published { background: rgba(46,168,77,.15); color: #5ecc7d; }
.badge-draft     { background: rgba(58,130,200,.15); color: #7ab2e4; }
.badge-rejected  { background: rgba(224,68,68,.15); color: #f07070; }
.btn-sm { padding: 5px 12px; border-radius: var(--radius); font-size: 12px; font-weight: 600;
          border: none; cursor: pointer; transition: opacity var(--transition); display: inline-block; }
.btn-sm:hover { opacity: .8; }
.btn-edit    { background: var(--bg-raised); color: var(--text-muted); border: 1px solid var(--border); }
.btn-delete  { background: rgba(224,68,68,.15); color: #f07070; border: 1px solid rgba(224,68,68,.2); }
.btn-publish { background: rgba(46,168,77,.15); color: #5ecc7d; border: 1px solid rgba(46,168,77,.2); }
.btn-gold    { background: var(--gold); color: #0d0f14; font-weight: 700; }

.empty-state { text-align: center; padding: 80px 24px; color: var(--text-dim); }
.empty-state svg { width: 56px; height: 56px; margin: 0 auto 16px; opacity: .35; }
.empty-state p { font-size: 16px; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-card); }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: 32px 24px;
                display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-tagline { font-size: 13px; color: var(--text-dim); }
.footer-links { display: flex; gap: 20px; }
.footer-links a { font-size: 13px; color: var(--text-dim); }
.footer-links a:hover { color: var(--gold); }
.footer-copy { font-size: 12px; color: var(--text-dim); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) { .watch-layout { grid-template-columns: 1fr; } .admin-wrap { grid-template-columns: 1fr; } .admin-sidebar { display: none; } }
@media (max-width: 768px) { .header-nav { display: none; } .header-search { max-width: none; flex: 1; } .mobile-menu-toggle { display: flex; margin-left: auto; } .hero-banner__content { padding: 28px; } .hero-title { font-size: 22px; } .video-grid { grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); } }
@media (max-width: 480px) { .page-wrap { padding: 20px 16px 48px; } .video-grid { grid-template-columns: 1fr 1fr; gap: 10px; } }
