/* ═══════════════════════════════════════════════════════════
   QuoteVault — app.css  (Mobile-first, responsive)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Playfair+Display:ital,wght@0,700;1,600&display=swap');

/* ── Variables ───────────────────────────────────────────── */
:root {
  --primary:     #6366f1;
  --primary-d:   #4f46e5;
  --accent:      #f59e0b;
  --bg:          #0f0f13;
  --bg-card:     #1a1a24;
  --bg-card2:    #22222f;
  --border:      rgba(255,255,255,.08);
  --text:        #e8e8f0;
  --text-muted:  #9090a8;
  --radius:      14px;
  --shadow:      0 8px 32px rgba(0,0,0,.45);
  --transition:  .22s cubic-bezier(.4,0,.2,1);
  --max-w:       1200px;
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent); }

/* ── Layout ──────────────────────────────────────────────── */
.container { width: 100%; max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; }
@media(max-width:1024px){ .grid-4{ grid-template-columns: repeat(2,1fr); } }
@media(max-width:768px){
  .grid-2,.grid-3,.grid-4{ grid-template-columns:1fr; }
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(15,15,19,.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.header-top {
  display: flex; align-items: center; gap: 1rem;
  padding: .85rem 0;
  flex-wrap: wrap;
}
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem; font-weight: 700;
  background: linear-gradient(135deg,#6366f1,#f59e0b);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  white-space: nowrap;
}
.logo span { font-style: italic; }

/* Search box */
.search-wrap {
  flex: 1; min-width: 220px; position: relative;
}
.search-wrap input {
  width: 100%;
  padding: .6rem 1rem .6rem 2.6rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  color: var(--text);
  font-size: .95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.2);
}
.search-icon {
  position: absolute; left: .85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
  font-size: 1rem;
}
.suggest-box {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
  overflow: hidden;
}
.suggest-box.open { display: block; }
.suggest-item {
  padding: .65rem 1rem; cursor: pointer; font-size: .9rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.suggest-item:last-child { border-bottom: none; }
.suggest-item:hover { background: rgba(99,102,241,.12); }
.suggest-lang { font-size: .72rem; color: var(--accent); margin-left: .5rem; }

/* Language + admin links */
.header-actions { display: flex; align-items: center; gap: .75rem; }
.lang-select {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: .45rem .75rem; border-radius: 8px; font-size: .85rem;
  cursor: pointer;
}

/* Category nav */
.cat-nav {
  background: rgba(15,15,19,.7);
  border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav ul {
  display: flex; gap: .25rem; padding: .55rem 0; list-style: none;
}
.cat-nav a {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .9rem;
  border-radius: 50px;
  color: var(--text-muted);
  font-size: .85rem; font-weight: 500;
  white-space: nowrap;
  transition: all var(--transition);
}
.cat-nav a:hover, .cat-nav a.active {
  background: rgba(99,102,241,.15);
  color: var(--primary);
}

/* ── Hero ────────────────────────────────────────────────── */
.hero {
  padding: 5rem 0 3rem;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,.18) 0%, transparent 70%);
}
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700; line-height: 1.2;
  margin-bottom: 1rem;
}
.hero h1 em { font-style: italic; color: var(--accent); }
.hero p { color: var(--text-muted); font-size: 1.1rem; max-width: 600px; margin: 0 auto 2rem; }

/* ── Section ─────────────────────────────────────────────── */
.section { padding: 3rem 0; }
.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;
}
.section-title::before {
  content: ''; display: inline-block;
  width: 4px; height: 1.35em;
  background: linear-gradient(180deg,var(--primary),var(--accent));
  border-radius: 2px;
}
.view-all {
  font-size: .85rem; color: var(--text-muted);
  border: 1px solid var(--border); padding: .35rem .9rem;
  border-radius: 50px; transition: all var(--transition);
}
.view-all:hover { border-color: var(--primary); color: var(--primary); }

/* ── Quote Card ──────────────────────────────────────────── */
.quote-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(300px,1fr)); gap: 1.25rem; }
.quote-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex; flex-direction: column; gap: .85rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative; overflow: hidden;
}
.quote-card::before {
  content: '\201C';
  position: absolute; top: .5rem; right: 1rem;
  font-size: 5rem; line-height: 1;
  color: rgba(99,102,241,.07);
  font-family: 'Playfair Display', serif;
  pointer-events: none;
}
.quote-card:hover {
  transform: translateY(-4px);
  border-color: rgba(99,102,241,.3);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.quote-text {
  font-size: 1rem; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.quote-author {
  color: var(--accent); font-size: .85rem; font-weight: 600;
}
.quote-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.badge {
  font-size: .72rem; font-weight: 600; padding: .2rem .55rem;
  border-radius: 50px; background: rgba(99,102,241,.15); color: var(--primary);
  letter-spacing: .02em;
}
.badge.lang { background: rgba(245,158,11,.12); color: var(--accent); }
.badge.cat  { background: rgba(16,185,129,.1); color: #10b981; }

.quote-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .3rem .7rem; border-radius: 6px; font-size: .8rem;
  border: 1px solid var(--border); color: var(--text-muted);
  transition: all var(--transition); cursor: pointer; background: transparent;
}
.share-btn:hover { border-color: currentColor; }
.share-fb { color: #1877f2; } .share-tw  { color: #1da1f2; }
.share-wa { color: #25d366; } .share-tg  { color: #229ed9; }
.share-li { color: #0a66c2; }
.copy-btn { color: var(--text-muted); }
.copy-btn.copied { color: #10b981; }

.read-more {
  margin-top: auto;
  font-size: .85rem; font-weight: 600;
  color: var(--primary);
  display: inline-flex; align-items: center; gap: .3rem;
}
.read-more::after { content: '→'; transition: transform var(--transition); }
.read-more:hover::after { transform: translateX(4px); }

/* ── Featured Quote ──────────────────────────────────────── */
.featured-card {
  background: linear-gradient(135deg, rgba(99,102,241,.15), rgba(245,158,11,.08));
  border: 1px solid rgba(99,102,241,.25);
}

/* ── Quote Detail ────────────────────────────────────────── */
.quote-detail-wrap { max-width: 800px; margin: 3rem auto; padding: 0 1.25rem; }
.quote-detail-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem;
  position: relative;
}
.quote-detail-box::before {
  content: '\201C';
  position: absolute; top: -1rem; left: 1.5rem;
  font-size: 6rem; line-height: 1;
  color: var(--primary); opacity: .15;
  font-family: 'Playfair Display', serif;
}
.quote-detail-text {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.5; font-style: italic;
  margin-bottom: 1.5rem;
}
.quote-detail-author { font-size: 1.05rem; font-weight: 600; color: var(--accent); }
.quote-detail-meta { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: .6rem; }

.article-box {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  font-size: .95rem; line-height: 1.75;
  color: var(--text-muted);
}
.article-box h2 { font-size: 1.1rem; color: var(--text); margin-bottom: .75rem; }

/* ── Share Bar (detail) ──────────────────────────────────── */
.share-bar {
  display: flex; gap: .75rem; flex-wrap: wrap;
  margin: 1.5rem 0;
}
.share-bar .share-btn {
  padding: .5rem 1rem; font-size: .9rem; font-weight: 500;
  border-radius: 8px;
}

/* ── Search ──────────────────────────────────────────────── */
.search-header {
  background: linear-gradient(135deg, rgba(99,102,241,.12), transparent);
  padding: 2.5rem 0 1.5rem;
}
.search-header h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.search-filters {
  display: flex; gap: .75rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.filter-select {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: .5rem .85rem; border-radius: 8px; font-size: .85rem;
}
.search-count { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; }

/* ── Pagination ──────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .5rem; margin: 2.5rem 0; flex-wrap: wrap;
}
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .9rem;
  transition: all var(--transition);
}
.page-btn:hover, .page-btn.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: #0a0a0f;
  border-top: 1px solid var(--border);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem; margin-bottom: 2rem;
}
@media(max-width:768px){ .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .logo { font-size: 1.4rem; margin-bottom: .75rem; }
.footer-brand p { color: var(--text-muted); font-size: .88rem; max-width: 300px; }
.footer-col h4 { font-size: .9rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: .05em; color: var(--text-muted); text-transform: uppercase; }
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.footer-col a { color: var(--text-muted); font-size: .88rem; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 1.25rem;
  display: flex; justify-content: space-between; align-items: center;
  font-size: .8rem; color: var(--text-muted); flex-wrap: wrap; gap: .5rem;
}

/* ── Cookie Consent ──────────────────────────────────────── */
#cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
  background: rgba(15,15,19,.97);
  border-top: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  backdrop-filter: blur(12px);
}
#cookie-banner p { font-size: .88rem; color: var(--text-muted); margin: 0; }
#cookie-banner .btn-accept {
  background: var(--primary); color: #fff; border: none;
  padding: .5rem 1.25rem; border-radius: 8px; cursor: pointer; font-size: .88rem;
  white-space: nowrap; transition: background var(--transition);
}
#cookie-banner .btn-accept:hover { background: var(--primary-d); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.4rem; border-radius: 10px; font-size: .9rem; font-weight: 600;
  border: none; cursor: pointer; transition: all var(--transition);
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); transform: translateY(-1px); }
.btn-outline {
  background: transparent; color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: rgba(99,102,241,.1); }

/* ── AdSense Placeholders ────────────────────────────────── */
.ad-slot {
  min-height: 90px; background: rgba(255,255,255,.02);
  border: 1px dashed var(--border); border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: .8rem;
  margin: 1.5rem 0;
}

/* ── Admin ───────────────────────────────────────────────── */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
@media(max-width:768px){ .admin-layout { grid-template-columns: 1fr; } }
.admin-sidebar {
  background: #0a0a0f; border-right: 1px solid var(--border);
  padding: 1.5rem 0;
}
.admin-sidebar .logo { padding: 0 1.25rem 1.5rem; display: block; }
.admin-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .7rem 1.25rem; color: var(--text-muted); font-size: .9rem;
  transition: all var(--transition);
}
.admin-nav a:hover, .admin-nav a.active {
  background: rgba(99,102,241,.1); color: var(--primary);
}
.admin-content { padding: 2rem; overflow: auto; }
.admin-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem;
}
.admin-card h2 { font-size: 1.1rem; margin-bottom: 1.25rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: .4rem; color: var(--text-muted); }
.form-control {
  width: 100%; padding: .6rem .9rem;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .9rem;
  transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--primary); }
textarea.form-control { min-height: 200px; resize: vertical; }
.alert { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.alert-success { background: rgba(16,185,129,.1); color: #10b981; border: 1px solid rgba(16,185,129,.2); }
.alert-error   { background: rgba(239,68,68,.1);  color: #ef4444;  border: 1px solid rgba(239,68,68,.2); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th { text-align: left; padding: .6rem .75rem; color: var(--text-muted); font-weight: 600; border-bottom: 1px solid var(--border); }
td { padding: .7rem .75rem; border-bottom: 1px solid rgba(255,255,255,.04); vertical-align: top; }
.stat-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-bottom: 1.5rem; }
@media(max-width:768px){ .stat-grid { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  text-align: center;
}
.stat-card .n { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-card .l { color: var(--text-muted); font-size: .85rem; margin-top: .25rem; }

/* ── RTL Support ─────────────────────────────────────────── */
[dir="rtl"] .quote-card::before { right: auto; left: 1rem; }
[dir="rtl"] .read-more::after  { content: '←'; }
[dir="rtl"] .search-icon       { left: auto; right: .85rem; }
[dir="rtl"] .search-wrap input { padding: .6rem 2.6rem .6rem 1rem; }

/* ── Utility ─────────────────────────────────────────────── */
.mt-1{ margin-top:.5rem; } .mt-2{ margin-top:1rem; } .mt-3{ margin-top:1.5rem; } .mt-4{ margin-top:2rem; }
.mb-1{ margin-bottom:.5rem; } .mb-2{ margin-bottom:1rem; }
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.flex { display: flex; } .flex-center { align-items: center; } .gap-1{ gap:.5rem; } .gap-2{ gap:1rem; }
.d-none{ display:none; }

/* ── Trending Badge ──────────────────────────────────────── */
.trending-badge {
  position: absolute; top: .75rem; left: .75rem;
  background: linear-gradient(135deg,#f59e0b,#ef4444);
  color: #fff; font-size: .65rem; font-weight: 700; padding: .2rem .5rem;
  border-radius: 50px; text-transform: uppercase; letter-spacing: .05em;
}

/* ── Related Quotes ──────────────────────────────────────── */
.related-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(240px,1fr)); gap: 1rem; }
.related-card {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  transition: border-color var(--transition);
}
.related-card:hover { border-color: rgba(99,102,241,.3); }
.related-card p { font-size: .88rem; line-height: 1.5; -webkit-line-clamp:3; display:-webkit-box; -webkit-box-orient:vertical; overflow:hidden; }

/* ── Responsive tweaks ───────────────────────────────────── */
@media(max-width:640px){
  .hero { padding: 3rem 0 2rem; }
  .header-top { gap: .6rem; }
  .logo { font-size: 1.35rem; }
  .share-bar { gap: .4rem; }
  .share-bar .share-btn { padding: .4rem .7rem; font-size: .8rem; }
  .quote-detail-box { padding: 1.5rem; }
}
