/* =====================================================================
   CMS DARK THEME — app.css
   Primary: #0ea5e9 (blue)   Secondary: #10b981 (green)
   ===================================================================== */

/* ─── CSS Variables ─────────────────────────────────────────────────── */
:root {
  --blue:       #0ea5e9;
  --blue-dark:  #0284c7;
  --green:      #10b981;
  --gray-950:   #030712;
  --gray-900:   #111827;
  --gray-800:   #1f2937;
  --gray-700:   #374151;
  --gray-600:   #4b5563;
  --gray-400:   #9ca3af;
  --gray-200:   #e5e7eb;
  --text:       #f9fafb;
  --text-muted: #9ca3af;
  --border:     #1f2937;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 4px 24px rgba(0,0,0,.5);
  --transition: 0.2s ease;
}

/* ─── Reset & Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', 'Noto Sans Arabic', 'Noto Nastaliq Urdu', sans-serif;
  background: var(--gray-950);
  color: var(--text);
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ─── RTL Support ───────────────────────────────────────────────────── */
[dir="rtl"] { font-family: 'Noto Sans Arabic', 'Noto Nastaliq Urdu', sans-serif; }
[lang="ur"]  { font-family: 'Noto Nastaliq Urdu', sans-serif; font-size: 1.05em; line-height: 2; }
[dir="rtl"] .nav-links { flex-direction: row-reverse; }
[dir="rtl"] .post-meta, [dir="rtl"] .video-meta { flex-direction: row-reverse; }

/* ─── Container ─────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ─── Flash Messages ────────────────────────────────────────────────── */
.flash {
  display: flex; justify-content: space-between; align-items: center;
  padding: .75rem 1.25rem;
  font-size: .9rem;
  transition: opacity var(--transition);
}
.flash--success { background: #052e16; color: #34d399; border-bottom: 1px solid #064e3b; }
.flash--error   { background: #450a0a; color: #f87171; border-bottom: 1px solid #7f1d1d; }
.flash button   { background: none; border: none; cursor: pointer; color: inherit; font-size: 1rem; }

/* ─── Navigation ────────────────────────────────────────────────────── */
.nav-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(3,7,18,.9);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1280px; margin: 0 auto; padding: .75rem 1.25rem; gap: 1rem;
}
.nav-logo { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.2rem; }
.nav-logo:hover { color: var(--blue); }
.nav-links {
  display: none; list-style: none; gap: 10px; align-items: center;
}
@media (min-width: 768px) { .nav-links { display: flex; } }
.nav-links a {
  display: block; padding: .5rem .9rem; font-size: .9rem; border-radius: var(--radius-sm);
  color: var(--gray-400); transition: color var(--transition), background var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); background: var(--gray-800); }
.nav-links a.active { color: var(--blue); }

.nav-right { display: flex; align-items: center; gap: .5rem; }

/* Language switcher */
.lang-switcher { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: .35rem;
  background: var(--gray-800); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm); padding: .4rem .7rem;
  font-size: .8rem; cursor: pointer; transition: background var(--transition);
}
.lang-btn:hover { background: var(--gray-700); }
.lang-dropdown {
  display: none; position: absolute; top: calc(100% + 8px);
  right: 0; background: var(--gray-800); border: 1px solid var(--border);
  border-radius: var(--radius-sm); min-width: 140px; overflow: hidden;
  box-shadow: var(--shadow);
}
.lang-switcher:hover .lang-dropdown { display: block; }
[dir="rtl"] .lang-dropdown { right: auto; left: 0; }
.lang-dropdown a {
  display: flex; align-items: center; justify-content: space-between;
  padding: .55rem 1rem; font-size: .85rem; color: var(--gray-400);
  transition: background var(--transition), color var(--transition);
}
.lang-dropdown a:hover, .lang-dropdown a.active { background: var(--gray-700); color: var(--text); }
.lang-dropdown .check { color: var(--green); }

/* Icon button */
.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--gray-400);
  padding: .4rem; border-radius: var(--radius-sm); display: flex; align-items: center;
  transition: color var(--transition), background var(--transition);
}
.icon-btn:hover { color: var(--text); background: var(--gray-800); }

/* Search bar */
.nav-search { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; background: var(--gray-900); }
.nav-search--open { max-height: 80px; }
.search-form {
  display: flex; max-width: 600px; margin: 0 auto; padding: .75rem 1.25rem; gap: .5rem;
}
.search-form input {
  flex: 1; background: var(--gray-800); border: 1px solid var(--border);
  color: var(--text); padding: .6rem 1rem; border-radius: var(--radius-sm); font-size: .9rem;
}
.search-form input:focus { outline: none; border-color: var(--blue); }
.search-form button {
  background: var(--blue); border: none; color: #fff;
  padding: .6rem .9rem; border-radius: var(--radius-sm); cursor: pointer;
}

/* Mobile nav */
.mobile-menu-btn { display: flex; }
@media (min-width: 768px) { .mobile-menu-btn { display: none; } }
.mobile-nav {
  display: none; flex-direction: column;
  background: var(--gray-900); border-top: 1px solid var(--border);
  padding: .75rem 1.25rem;
}
.mobile-nav--open { display: flex; }
.mobile-nav a {
  padding: .6rem 0; font-size: .95rem; color: var(--gray-400);
  border-bottom: 1px solid var(--border); transition: color var(--transition);
}
.mobile-nav a:hover { color: var(--text); }
.mobile-nav .divider { border-color: var(--border); margin: .5rem 0; }

/* ─── Sections ──────────────────────────────────────────────────────── */
.hero-section, .content-section { padding: 3rem 0; }
.content-section--alt { background: var(--gray-900); }

.section-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem;
}
.section-title {
  font-size: 1.35rem; font-weight: 700; display: flex; align-items: center; gap: .5rem;
}
.title-accent { color: var(--blue); }
.see-all {
  font-size: .85rem; color: var(--blue); padding: .3rem .7rem;
  border: 1px solid var(--blue); border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.see-all:hover { background: rgba(14,165,233,.1); }

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

.video-card { border-radius: var(--radius); overflow: hidden; background: var(--gray-900); transition: transform var(--transition), box-shadow var(--transition); }
.video-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.video-thumb { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--gray-800); }
.video-thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.video-card:hover .video-thumb-img { transform: scale(1.04); }

.play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.3); opacity: 0; transition: opacity var(--transition);
}
.video-card:hover .play-overlay { opacity: 1; }
.play-btn {
  width: 52px; height: 52px; background: rgba(14,165,233,.9); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  transform: scale(.9); transition: transform var(--transition);
}
.video-card:hover .play-btn { transform: scale(1); }

.duration-badge {
  position: absolute; bottom: .5rem; right: .5rem; background: rgba(0,0,0,.8);
  color: #fff; font-size: .72rem; padding: .15rem .4rem; border-radius: 4px;
}
[dir="rtl"] .duration-badge { right: auto; left: .5rem; }

.video-info { padding: .85rem 1rem; }
.video-category { font-size: .72rem; color: var(--blue); text-transform: uppercase; letter-spacing: .05em; }
.video-title { font-size: .95rem; font-weight: 600; margin: .25rem 0 .4rem; line-height: 1.4; }
.video-title a:hover { color: var(--blue); }
.video-meta { font-size: .75rem; color: var(--text-muted); display: flex; gap: .4rem; flex-wrap: wrap; }

/* ─── Posts Grid ────────────────────────────────────────────────────── */
.posts-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }

.post-card { background: var(--gray-900); border-radius: var(--radius); overflow: hidden; transition: transform var(--transition), box-shadow var(--transition); }
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.post-thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--gray-800); }
.post-thumb-img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.post-card:hover .post-thumb-img { transform: scale(1.04); }
.post-info { padding: 1rem; }
.post-category { font-size: .72rem; color: var(--green); text-transform: uppercase; letter-spacing: .05em; }
.post-title { font-size: 1rem; font-weight: 600; margin: .3rem 0 .4rem; line-height: 1.4; }
.post-title a:hover { color: var(--blue); }
.post-desc { font-size: .85rem; color: var(--text-muted); margin-bottom: .7rem; line-height: 1.5; }
.post-meta { display: flex; align-items: center; gap: .4rem; font-size: .75rem; color: var(--text-muted); }
.author-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }

/* ─── Shorts ────────────────────────────────────────────────────────── */
.categories-section { padding: 1.5rem 0; }
.categories-scroll { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: none; }
.categories-scroll::-webkit-scrollbar { display: none; }
.category-pill {
  display: flex; align-items: center; gap: .4rem; white-space: nowrap;
  background: var(--gray-800); border: 1px solid var(--border);
  padding: .4rem .9rem; border-radius: 999px; font-size: .82rem;
  transition: background var(--transition), border-color var(--transition);
}
.category-pill:hover { background: var(--gray-700); border-color: var(--cat-color, var(--blue)); color: var(--cat-color, var(--blue)); }
.cat-count { background: var(--gray-700); padding: .05rem .4rem; border-radius: 999px; font-size: .7rem; }

.shorts-row { display: flex; gap: 1rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: thin; scrollbar-color: var(--gray-700) transparent; }
.short-card { flex: 0 0 160px; border-radius: var(--radius); overflow: hidden; background: var(--gray-900); transition: transform var(--transition); }
.short-card:hover { transform: translateY(-3px); }
.short-thumb { position: relative; aspect-ratio: 9/16; background: var(--gray-800); overflow: hidden; }
.short-thumb img { width: 100%; height: 100%; object-fit: cover; }
.short-thumb-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--gray-600); }
.short-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity var(--transition); }
.short-card:hover .short-overlay { opacity: 1; }
.short-play-btn { font-size: 1.75rem; color: #fff; }
.short-source-badge { position: absolute; top: .4rem; left: .4rem; background: rgba(0,0,0,.7); color: #fff; font-size: .65rem; padding: .1rem .35rem; border-radius: 4px; }
.short-info { padding: .6rem .75rem; }
.short-title { font-size: .8rem; font-weight: 600; line-height: 1.35; margin-bottom: .2rem; }
.short-title a:hover { color: var(--blue); }
.short-views { font-size: .7rem; color: var(--text-muted); }

/* ─── Video Show Page ───────────────────────────────────────────────── */
.video-show-layout {
  display: grid; gap: 2rem; padding: 2rem 1.25rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) { .video-show-layout { grid-template-columns: 1fr 360px; } }

.video-player-wrap { position: relative; aspect-ratio: 16/9; border-radius: var(--radius); overflow: hidden; background: #000; }
.video-player-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-detail-info { margin-top: 1.25rem; }
.video-detail-title { font-size: 1.3rem; font-weight: 700; margin: .5rem 0; }
.video-detail-meta { display: flex; gap: .5rem; font-size: .82rem; color: var(--text-muted); flex-wrap: wrap; }
.video-category-badge { display: inline-block; font-size: .72rem; color: var(--blue); text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--blue); padding: .15rem .5rem; border-radius: 4px; margin-bottom: .5rem; }

/* Share buttons */
.share-buttons { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.share-label { font-size: .82rem; color: var(--text-muted); }
.share-btn { font-size: .8rem; padding: .35rem .75rem; border-radius: 999px; transition: opacity var(--transition); }
.share-btn:hover { opacity: .8; }
.share-btn--twitter  { background: #000; color: #fff; }
.share-btn--facebook { background: #1877f2; color: #fff; }
.share-btn--whatsapp { background: #25d366; color: #fff; }

/* Description toggle */
.toggle-desc { background: none; border: none; color: var(--blue); cursor: pointer; font-size: .85rem; padding: .5rem 0; }
.desc-body { font-size: .9rem; color: var(--gray-400); white-space: pre-wrap; margin-top: .5rem; }
.hidden { display: none; }

/* Related sidebar */
.video-sidebar, .post-sidebar { }
.sidebar-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.related-list { display: flex; flex-direction: column; gap: .85rem; }
.related-item { display: flex; gap: .75rem; }
.related-thumb { flex: 0 0 100px; aspect-ratio: 16/9; border-radius: var(--radius-sm); overflow: hidden; position: relative; background: var(--gray-800); }
.related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.play-overlay-sm { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.3); opacity: 0; transition: opacity var(--transition); font-size: 1rem; color: #fff; }
.related-thumb:hover .play-overlay-sm { opacity: 1; }
.related-info { flex: 1; }
.related-title { font-size: .82rem; font-weight: 500; line-height: 1.4; display: block; }
.related-title:hover { color: var(--blue); }
.related-meta { font-size: .72rem; color: var(--text-muted); }

/* ─── Post Article ──────────────────────────────────────────────────── */
.post-show-layout { display: grid; gap: 2rem; padding: 2rem 1.25rem; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .post-show-layout { grid-template-columns: 1fr 300px; } }

.breadcrumb { display: flex; gap: .4rem; font-size: .8rem; color: var(--text-muted); margin-bottom: 1rem; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--blue); }
.article-labels { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .75rem; }
.article-category { font-size: .72rem; color: var(--blue); text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--blue); padding: .15rem .5rem; border-radius: 4px; }
.tag-pill { font-size: .72rem; background: var(--gray-800); padding: .15rem .5rem; border-radius: 999px; color: var(--text-muted); }
.tag-pill:hover { background: var(--gray-700); color: var(--text); }

.article-title { font-size: clamp(1.5rem, 4vw, 2.25rem); font-weight: 800; line-height: 1.25; margin-bottom: 1rem; }
.article-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.5rem; }
.author-avatar-md { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.author-name { font-weight: 600; font-size: .9rem; display: block; }
.article-dates { font-size: .78rem; color: var(--text-muted); display: flex; gap: .4rem; }
.article-hero-img { width: 100%; border-radius: var(--radius); margin-bottom: 1.5rem; max-height: 480px; object-fit: cover; }
.article-lead { font-size: 1.1rem; color: var(--gray-400); margin-bottom: 1.5rem; line-height: 1.7; border-left: 3px solid var(--blue); padding-left: 1rem; }
[dir="rtl"] .article-lead { border-left: none; border-right: 3px solid var(--blue); padding-left: 0; padding-right: 1rem; }

/* Prose content styles */
.article-body.prose { color: var(--gray-400); line-height: 1.8; }
.article-body.prose h2 { font-size: 1.4rem; font-weight: 700; color: var(--text); margin: 2rem 0 .75rem; }
.article-body.prose h3 { font-size: 1.15rem; font-weight: 600; color: var(--text); margin: 1.5rem 0 .5rem; }
.article-body.prose p  { margin-bottom: 1.25rem; }
.article-body.prose a  { color: var(--blue); text-decoration: underline; }
.article-body.prose ul, .article-body.prose ol { padding-left: 1.5rem; margin-bottom: 1rem; }
.article-body.prose li { margin-bottom: .35rem; }
.article-body.prose img { border-radius: var(--radius-sm); margin: 1rem 0; }
.article-body.prose blockquote { border-left: 3px solid var(--blue); padding-left: 1rem; color: var(--text-muted); font-style: italic; margin: 1.5rem 0; }
.article-body.prose pre { background: var(--gray-800); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; }
.article-body.prose code { font-family: monospace; background: var(--gray-800); padding: .15rem .35rem; border-radius: 4px; font-size: .85em; }
.share-buttons--large { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }

/* ─── Search Page ───────────────────────────────────────────────────── */
.search-results { padding: 2rem 1.25rem; }
.search-query-display { font-size: 1.5rem; font-weight: 700; margin-bottom: .5rem; }
.search-count { font-size: .9rem; color: var(--text-muted); margin-bottom: 2rem; }
.search-section-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.no-results { text-align: center; padding: 4rem 0; color: var(--text-muted); }
.no-results svg { margin: 0 auto 1rem; opacity: .3; }

/* ─── Footer ────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--gray-900); border-top: 1px solid var(--border); padding: 3rem 0 1.5rem; margin-top: 3rem;
}
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 640px)  { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-logo { font-size: 1.2rem; font-weight: 700; margin-bottom: .4rem; }
.footer-tagline { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }
.social-links { display: flex; gap: .5rem; flex-wrap: wrap; }
.social-btn {
  width: 36px; height: 36px; background: var(--gray-800); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: .9rem;
  transition: background var(--transition);
}
.social-btn:hover { background: var(--blue); }
.footer-col h4 { font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-bottom: .75rem; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.footer-col a { font-size: .88rem; color: var(--text-muted); transition: color var(--transition); }
.footer-col a:hover { color: var(--blue); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: .8rem; color: var(--text-muted); }
.sitemap-link { color: var(--text-muted); transition: color var(--transition); }
.sitemap-link:hover { color: var(--blue); }

/* ─── Pagination ────────────────────────────────────────────────────── */
.pagination-wrap { display: flex; justify-content: center; margin-top: 2rem; gap: .35rem; flex-wrap: wrap; }
.pagination-wrap a, .pagination-wrap span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 .75rem;
  background: var(--gray-800); border-radius: var(--radius-sm);
  font-size: .85rem; color: var(--gray-400); border: 1px solid var(--border);
  transition: all var(--transition);
}
.pagination-wrap a:hover { background: var(--gray-700); color: var(--text); }
.pagination-wrap .active, .pagination-wrap [aria-current="page"] span { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ─── Responsive helpers ────────────────────────────────────────────── */
@media (max-width: 767px) {
  .section-title { font-size: 1.1rem; }
  .video-grid   { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .posts-grid   { grid-template-columns: 1fr; }
}

/* ─── Pagination custom view ─────────────────────────────────────────── */
.pagination-current { background: var(--blue) !important; color: #fff !important; border-color: var(--blue) !important; }
.pagination-disabled { opacity: .4; cursor: not-allowed; }
.pagination-ellipsis { background: none; border: none; color: var(--gray-600); padding: 0 .35rem; }
.category-pill--active { border-color: var(--blue); color: var(--blue); background: rgba(14,165,233,.08); }

/* ─── Back-to-top button ─────────────────────────────────────────────── */
#back-to-top {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 50;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--blue); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; opacity: 0; pointer-events: none;
  transition: opacity .3s, transform .3s;
  box-shadow: 0 4px 16px rgba(14,165,233,.4);
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { transform: translateY(-3px); }
[dir="rtl"] #back-to-top { right: auto; left: 1.5rem; }
