/*
 * ================================================================
 *  Pashto Poetry Platform — Main Stylesheet
 *  RTL / Pashto / Urdu Support
 * ================================================================
 */

/* ── Google Fonts (loaded in layout head) ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Nastaliq+Urdu:wght@400;500;600;700&family=Noto+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* ── CSS Variables ── */
:root {
  --primary:       #6366f1;
  --primary-dark:  #4f46e5;
  --primary-light: #e0e7ff;
  --secondary:     #f59e0b;
  --success:       #10b981;
  --danger:        #ef4444;
  --dark:          #0f172a;
  --dark-2:        #1e293b;
  --text:          #334155;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --surface:       #f8fafc;
  --white:         #ffffff;

  --font-pashto:   'Noto Nastaliq Urdu', 'Noto Sans Arabic', serif;
  --font-ui:       'Noto Sans Arabic', system-ui, sans-serif;

  --radius-sm:     8px;
  --radius:        14px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  --shadow-sm:     0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow:        0 4px 20px rgba(0,0,0,.08);
  --shadow-lg:     0 10px 40px rgba(0,0,0,.14);
  --shadow-xl:     0 25px 60px rgba(0,0,0,.2);

  --transition:    all .25s cubic-bezier(.4,0,.2,1);
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-pashto);
  color: var(--text);
  background: var(--surface);
  direction: rtl;
  text-align: right;
  line-height: 2;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-pashto);
  font-weight: 700;
  line-height: 1.6;
  color: var(--dark-2);
}

.pashto-text {
  font-family: var(--font-pashto);
  line-height: 2.8;
  font-size: 1.1rem;
}

.arabic-ui {
  font-family: var(--font-ui);
}

/* ── Navbar ── */
.main-navbar {
  background: var(--dark) !important;
  box-shadow: 0 2px 20px rgba(0,0,0,.35);
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 1030;
}

.main-navbar .navbar-brand {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff !important;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.main-navbar .brand-accent { color: var(--secondary); }

.main-navbar .nav-link {
  color: rgba(255,255,255,.82) !important;
  font-size: .88rem;
  padding: .45rem .85rem !important;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.main-navbar .nav-link:hover,
.main-navbar .nav-link.active {
  color: var(--secondary) !important;
  background: rgba(255,255,255,.07);
}

/* Navbar search */
.navbar-search .form-control {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  border-left: none;
  color: #fff;
  border-radius: var(--radius) 0 0 var(--radius);
  padding-right: 1rem;
  transition: var(--transition);
}

.navbar-search .form-control::placeholder { color: rgba(255,255,255,.45); }
.navbar-search .form-control:focus {
  background: rgba(255,255,255,.15);
  border-color: var(--primary);
  box-shadow: none;
  color: #fff;
}

.navbar-search .btn-search {
  background: var(--secondary);
  border: none;
  color: var(--dark);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: .45rem 1rem;
  font-size: .9rem;
}

/* ── Hero Section ── */
.hero-section {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 45%, #312e81 100%);
  padding: 5.5rem 0 4.5rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(99,102,241,.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(245,158,11,.08) 0%, transparent 40%);
}

.hero-pattern {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M50 50c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10s-10-4.477-10-10 4.477-10 10-10zM10 10c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10c0 5.523-4.477 10-10 10S0 25.523 0 20s4.477-10 10-10z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content { position: relative; z-index: 1; }

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  color: #ffffff;
  line-height: 1.4;
  text-shadow: 0 2px 20px rgba(0,0,0,.3);
}

.hero-subtitle {
  color: rgba(255,255,255,.75);
  font-size: clamp(.95rem, 2vw, 1.15rem);
  line-height: 2;
}

.hero-search {
  max-width: 520px;
  margin: 0 auto;
}

.hero-search .form-control {
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
  border: none;
  padding: .85rem 1.5rem;
  font-size: 1rem;
  font-family: var(--font-pashto);
}

.hero-search .btn {
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  padding: .85rem 1.8rem;
  background: var(--secondary);
  border: none;
  color: var(--dark);
  font-size: 1rem;
  font-weight: 600;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .6rem;
  margin-top: 1.5rem;
}

.hero-chip {
  border: 1px solid rgba(255,255,255,.2);
  color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.07);
  border-radius: 50px;
  padding: .3rem 1rem;
  font-size: .82rem;
  text-decoration: none;
  transition: var(--transition);
}

.hero-chip:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
  border-color: rgba(255,255,255,.4);
}

/* ── Section Headings ── */
.section-title {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 800;
  color: var(--dark-2);
  position: relative;
  padding-bottom: .65rem;
  margin-bottom: 0;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 45px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 2px;
}

.section-title.light { color: #fff; }
.section-title.light::after { background: var(--secondary); }

/* ── Poetry Cards ── */
.poetry-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: hidden;
  height: 100%;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.poetry-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99,102,241,.25);
}

.poetry-card .card-cover {
  height: 160px;
  object-fit: cover;
  width: 100%;
}

.poetry-card .card-body {
  padding: 1.2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.poetry-card .card-title {
  font-size: .98rem;
  font-weight: 700;
  line-height: 1.75;
  margin-bottom: .6rem;
  color: var(--dark-2);
}

.poetry-card .card-excerpt {
  font-family: var(--font-pashto);
  font-size: .87rem;
  line-height: 2.2;
  color: var(--text-muted);
  flex: 1;
}

.poetry-card .card-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: .75rem;
  margin-top: .75rem;
  border-top: 1px solid var(--border);
}

/* ── Type Badges ── */
.type-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .7rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  font-family: var(--font-ui);
}

.type-ghazal       { background: #dbeafe; color: #1d4ed8; }
.type-poem         { background: #dcfce7; color: #166534; }
.type-quote        { background: #fef9c3; color: #854d0e; }
.type-short_poetry { background: #fce7f3; color: #9d174d; }

/* ── Poet Cards ── */
.poet-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-align: center;
  padding: 1.75rem 1.25rem;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: block;
  border: 1px solid var(--border);
}

.poet-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99,102,241,.3);
  color: inherit;
}

.poet-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-light);
  margin: 0 auto .9rem;
  display: block;
  transition: var(--transition);
}

.poet-card:hover .poet-avatar {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.15);
}

.poet-name {
  font-size: .97rem;
  font-weight: 700;
  color: var(--dark-2);
  margin-bottom: .2rem;
}

.poet-country {
  font-size: .77rem;
  color: var(--text-muted);
  font-family: var(--font-ui);
}

.poet-count {
  font-size: .78rem;
  color: var(--primary);
  font-family: var(--font-ui);
  margin-top: .4rem;
}

/* ── Category Badges ── */
.cat-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1.2rem;
  border-radius: 50px;
  color: #fff;
  font-size: .85rem;
  font-weight: 600;
  font-family: var(--font-ui);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}

.cat-badge:hover {
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

/* ── Poet Page Header ── */
.poet-page-header {
  min-height: 340px;
  background-size: cover;
  background-position: center;
  position: relative;
  display: flex;
  align-items: flex-end;
}

.poet-page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,.88) 0%,
    rgba(0,0,0,.45) 50%,
    rgba(0,0,0,.15) 100%
  );
}

.poet-page-header .content { position: relative; z-index: 1; }

.poet-large-avatar {
  width: 115px;
  height: 115px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}

/* ── Poetry Content Box ── */
.poetry-content-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem 3rem;
  box-shadow: var(--shadow);
  border-right: 4px solid var(--primary);
  font-family: var(--font-pashto);
  font-size: 1.15rem;
  line-height: 3;
  color: var(--dark-2);
  position: relative;
}

.poetry-content-box::before {
  content: '"';
  position: absolute;
  top: 1rem;
  left: 1.5rem;
  font-size: 5rem;
  color: var(--primary-light);
  line-height: 1;
  font-family: Georgia, serif;
  opacity: .7;
}

/* ── Tabs ── */
.poetry-tabs .nav-link {
  color: var(--text-muted);
  border: none;
  border-bottom: 3px solid transparent;
  padding: .65rem 1.25rem;
  font-family: var(--font-pashto);
  font-size: .95rem;
  transition: var(--transition);
  background: none;
  border-radius: 0;
}

.poetry-tabs .nav-link:hover { color: var(--primary); }

.poetry-tabs .nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
  background: none;
}

/* ── Quote Cards ── */
.quote-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius);
  padding: 1.75rem;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  display: block;
}

.quote-card:hover {
  background: rgba(255,255,255,.14);
  transform: translateY(-3px);
}

.quote-icon {
  font-size: 2.2rem;
  color: var(--secondary);
  display: block;
  margin-bottom: .75rem;
  line-height: 1;
}

.quote-text {
  font-family: var(--font-pashto);
  font-size: 1rem;
  line-height: 2.4;
  color: rgba(255,255,255,.9);
  margin-bottom: .9rem;
}

.quote-author {
  display: flex;
  align-items: center;
  gap: .6rem;
}

.quote-author img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.quote-author-name {
  font-size: .82rem;
  color: var(--secondary);
  font-family: var(--font-ui);
}

/* ── Popular Poet Strip ── */
.poet-strip-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .85rem 1rem;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.poet-strip-item:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  color: inherit;
  transform: translateX(-3px);
}

.poet-strip-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ── Search Results ── */
.search-highlight {
  background: rgba(245,158,11,.25);
  padding: .1em .25em;
  border-radius: 3px;
}

/* ── Social Share ── */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem 1rem;
  border-radius: 50px;
  font-size: .82rem;
  font-family: var(--font-ui);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.share-btn-fb  { background: #1877f2; color: #fff; }
.share-btn-tw  { background: #000; color: #fff; }
.share-btn-wa  { background: #25d366; color: #fff; }
.share-btn-copy{ background: var(--border); color: var(--text); }
.share-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ── Like Button ── */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem 1.2rem;
  border-radius: 50px;
  border: 2px solid #fecdd3;
  background: transparent;
  color: var(--danger);
  font-size: .88rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-ui);
}

.like-btn:hover, .like-btn.liked {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

.like-btn .heart-icon { transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.like-btn.liked .heart-icon { transform: scale(1.25); }

/* ── Image Gallery ── */
.gallery-item {
  aspect-ratio: 4/3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.gallery-item:hover img { transform: scale(1.06); }

.gallery-item::after {
  content: '\F52A';
  font-family: 'bootstrap-icons';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.4);
  color: #fff;
  font-size: 1.5rem;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item:hover::after { opacity: 1; }

/* ── Breadcrumb ── */
.breadcrumb-dark .breadcrumb-item,
.breadcrumb-dark .breadcrumb-item a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .82rem;
  font-family: var(--font-ui);
}

.breadcrumb-dark .breadcrumb-item.active { color: rgba(255,255,255,.9); }
.breadcrumb-dark .breadcrumb-item + .breadcrumb-item::before { color: rgba(255,255,255,.3); }

/* ── Footer ── */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,.65);
  padding: 3.5rem 0 1.5rem;
  font-family: var(--font-ui);
}

.footer-brand { font-family: var(--font-pashto); font-size: 1.2rem; color: #fff; }
.footer-brand span { color: var(--secondary); }

.footer-tagline {
  color: rgba(255,255,255,.5);
  font-size: .88rem;
  margin-top: .4rem;
}

.footer-heading {
  color: #fff;
  font-size: .92rem;
  font-weight: 600;
  font-family: var(--font-ui);
  margin-bottom: 1rem;
}

.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .45rem; }
.footer-links a { color: rgba(255,255,255,.55); text-decoration: none; font-size: .87rem; transition: color .2s; }
.footer-links a:hover { color: var(--secondary); }

.social-links { display: flex; gap: .6rem; }

.social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 1rem;
  transition: var(--transition);
}

.social-link:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.footer-divider { border-color: rgba(255,255,255,.1); }

.footer-bottom {
  color: rgba(255,255,255,.4);
  font-size: .82rem;
  padding-top: 1.25rem;
  margin-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
}

/* ── Pagination ── */
.pagination .page-link {
  color: var(--primary);
  border-radius: var(--radius-sm) !important;
  margin: 0 2px;
  border: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: .88rem;
  padding: .45rem .85rem;
  transition: var(--transition);
}

.pagination .page-link:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .page-item.active .page-link {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.pagination .page-item.disabled .page-link { opacity: .45; }

/* ── Trending Badge ── */
.trending-badge {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-size: .7rem;
  padding: .2rem .55rem;
  border-radius: 50px;
  font-family: var(--font-ui);
  font-weight: 700;
}

/* ── Page Headers ── */
.page-hero {
  background: linear-gradient(135deg, #1e1b4b, #312e81);
  padding: 2.75rem 0;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-hero .content { position: relative; z-index: 1; }

/* ── Sidebar ── */
.sidebar-widget {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.sidebar-widget-header {
  padding: .85rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-ui);
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}

.sidebar-widget-body { padding: 1rem; }

/* ── Back to Top ── */
#back-to-top {
  position: fixed;
  bottom: 1.75rem;
  left: 1.75rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 15px rgba(99,102,241,.4);
  opacity: 0;
  transform: translateY(12px);
  transition: var(--transition);
  z-index: 999;
}

#back-to-top.visible { opacity: 1; transform: translateY(0); }
#back-to-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ── Toast notification ── */
.toast-notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--dark-2);
  color: #fff;
  padding: .85rem 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-family: var(--font-ui);
  font-size: .9rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: .6rem;
}

.toast-notification.show { opacity: 1; transform: translateY(0); }

/* ── Lightbox ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.lightbox-overlay.open { opacity: 1; pointer-events: all; }
.lightbox-img { max-width: 92vw; max-height: 88vh; border-radius: var(--radius); }

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  color: #fff;
  font-size: 1.75rem;
  cursor: pointer;
  opacity: .7;
  transition: opacity .2s;
  background: none;
  border: none;
}

.lightbox-close:hover { opacity: 1; }

/* ── Error pages ── */
.error-page {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem;
}

.error-code {
  font-size: clamp(5rem, 15vw, 9rem);
  font-weight: 800;
  color: var(--primary-light);
  line-height: 1;
  font-family: system-ui, sans-serif;
}

/* ── Animations ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-fade-up { animation: fadeInUp .5s ease forwards; }

.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }

/* ── Responsive ── */
@media (max-width: 991px) {
  .poetry-content-box { padding: 1.75rem; }
}

@media (max-width: 767px) {
  .hero-section { padding: 3.5rem 0 3rem; }
  .poetry-content-box { padding: 1.25rem; font-size: 1rem; }
  .poet-page-header { min-height: 260px; }
  .poet-large-avatar { width: 85px; height: 85px; }
  #back-to-top { left: 1rem; bottom: 1rem; }
}

@media (max-width: 575px) {
  .hero-chips { display: none; }
  .poetry-card .card-body { padding: 1rem; }
}
