/* ============================================================
   Birbirih — Global News Intelligence
   Consolidated Stylesheet
   ============================================================ */

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== CSS VARIABLES ===== */
:root {
  --bg: #f8f9fc; --bg-card: #ffffff; --bg-nav: #ffffff;
  --text: #1a1a2e; --text-secondary: #5a6170; --text-muted: #8e95a2;
  --border: #e8ecf1; --border-light: #f0f2f5;
  --accent: #2563eb; --accent-bg: #eff6ff;
  --hero-bg: #0a0a23;
  --green-bg: #f0fdf4; --green-text: #166534; --green-border: #d1fae5;
  --card-hover: #fafbfc;
  --edit-bg: #fffbeb; --edit-border: #fde68a;
  --source-bg: #f9fafb; --source-border: #e5e7eb;
  --takeaway-bg: #f8fafc; --takeaway-color: #166534; --takeaway-border: #16a34a;
  --insight-bg: #fffbeb; --insight-color: #92400e; --insight-border: #f59e0b;
  --sentiment-p: #dcfce7; --sentiment-p-text: #166534;
  --sentiment-n: #fce4ec; --sentiment-n-text: #b71c1c;
  --sentiment-netral: #f0f2f5; --sentiment-netral-text: #5a6170;
}

[data-theme="dark"] {
  --bg: #0f0f1a; --bg-card: #1a1a2e; --bg-nav: #14142a;
  --text: #e8ecf1; --text-secondary: #9ca3af; --text-muted: #6b7280;
  --border: #2a2a45; --border-light: #1f1f38;
  --accent: #60a5fa; --accent-bg: #1e293b;
  --hero-bg: #0a0a1a;
  --green-bg: #1a2e1a; --green-text: #86efac; --green-border: #166534;
  --card-hover: #1f1f38;
  --edit-bg: #2a2a1a; --edit-border: #5a4a1a;
  --source-bg: #1a1a2e; --source-border: #2a2a45;
  --takeaway-bg: #1a2e1a; --takeaway-color: #86efac; --takeaway-border: #166534;
  --insight-bg: #2a2a1a; --insight-color: #fbbf24; --insight-border: #5a4a1a;
  --sentiment-p: #1a2e1a; --sentiment-p-text: #86efac;
  --sentiment-n: #2e1a1a; --sentiment-n-text: #fca5a5;
  --sentiment-netral: #2a2a45; --sentiment-netral-text: #9ca3af;
}

/* ===== BODY ===== */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* ===== NAVIGATION ===== */
.nav {
  background: var(--bg-nav); border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; height: 56px; gap: 24px;
}
.nav-logo {
  font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none;
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.nav-logo span { color: var(--accent); }
.nav-links {
  display: flex; gap: 2px; align-items: center; flex-shrink: 0;
}
.nav-links a, .nav-links button {
  font-size: 13px; color: var(--text-secondary); text-decoration: none;
  font-weight: 500; padding: 8px 14px; border-radius: 6px;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
  border: none; background: none; cursor: pointer; font-family: inherit;
}
.nav-links a:hover, .nav-links button:hover { background: var(--border-light); color: var(--text); }
.nav-links a.active { color: var(--accent); background: var(--accent-bg); }
.nav-dropdown { position: relative; }
.nav-dropdown-content {
  display: none; position: absolute; top: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; min-width: 220px; z-index: 300;
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}
.nav-dropdown:hover .nav-dropdown-content { display: block; }
.nav-dropdown-content::before {
  content: ''; position: absolute; top: -8px; left: 0; right: 0; height: 8px;
}
.nav-dropdown-content a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; font-size: 13px; color: var(--text-secondary);
  text-decoration: none; border-radius: 6px; white-space: nowrap;
}
.nav-dropdown-content a:hover { background: var(--border-light); color: var(--text); }
.nav-dropdown-content .dd-icon {
  width: 20px; text-align: center; font-size: 12px; flex-shrink: 0;
}
.nav-dropdown-trigger {
  font-size: 13px; color: var(--text-secondary); font-weight: 500;
  padding: 8px 14px; border-radius: 6px; cursor: pointer;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
  background: none; border: none; font-family: inherit;
  display: flex; align-items: center; gap: 5px;
}
.nav-dropdown-trigger .arrow {
  font-size: 9px; transition: transform 0.2s;
}
.nav-dropdown:hover .nav-dropdown-trigger { background: var(--border-light); color: var(--text); }
.nav-dropdown:hover .nav-dropdown-trigger .arrow { transform: rotate(180deg); }
.nav-right {
  margin-left: auto; display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: var(--text-muted); flex-shrink: 0;
}
.nav-search {
  position: relative; display: flex; align-items: center;
}
.nav-search input {
  width: 200px; padding: 7px 12px 7px 32px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; background: var(--bg);
  color: var(--text); outline: none; transition: border-color 0.2s, width 0.3s;
}
.nav-search input:focus { border-color: var(--accent); width: 260px; }
.nav-search .search-icon {
  position: absolute; left: 10px; color: var(--text-muted); font-size: 14px;
  pointer-events: none;
}
.theme-btn {
  background: var(--border-light); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 10px; cursor: pointer;
  font-size: 16px; line-height: 1; color: var(--text-secondary);
  transition: color 0.15s;
}
.theme-btn:hover { color: var(--accent); }

/* ===== CONTAINER ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 28px; }
.container-narrow { max-width: 780px; margin: 0 auto; padding: 32px 24px 48px; }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  font-size: 12px; color: var(--text-muted); margin-bottom: 20px;
  display: flex; gap: 6px; align-items: center;
}
.breadcrumb a { color: var(--text-secondary); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--border); }

/* ===== HREFLANG ===== */
.hreflang-bar {
  display: flex; gap: 8px; align-items: center; margin-bottom: 16px;
}
.hreflang-bar a {
  font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 4px; text-decoration: none; text-transform: uppercase;
  background: var(--border-light); color: var(--text-muted);
  border: 1px solid var(--border); transition: all 0.15s;
}
.hreflang-bar a:hover, .hreflang-bar a.active {
  background: var(--accent-bg); color: var(--accent); border-color: var(--accent);
}

/* ============================================================
   HOMEPAGE
   ============================================================ */

/* Hero Section */
.hero-section { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; margin-bottom: 40px; }
.hero-main {
  background: var(--hero-bg); border-radius: 12px; padding: 32px;
  display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 380px; position: relative; overflow: hidden; cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.hero-main::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(10,10,35,0.92) 0%, rgba(10,10,35,0.2) 70%, transparent 100%);
}
.hero-main:hover { transform: translateY(-3px); box-shadow: 0 16px 48px rgba(10,10,35,0.25); }
.hero-main > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-flex; font-size: 11px; font-weight: 600;
  background: rgba(255,255,255,0.12); color: #fff;
  padding: 5px 14px; border-radius: 4px; text-transform: uppercase;
  letter-spacing: 0.8px; margin-bottom: 16px; width: fit-content;
}
.hero-main h2 { font-size: 26px; font-weight: 700; color: #fff; line-height: 1.25; margin-bottom: 10px; }
.hero-main h2 a { color: #fff; text-decoration: none; }
.hero-desc {
  font-size: 14px; color: rgba(255,255,255,0.7); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-meta { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: rgba(255,255,255,0.45); }
.hero-side { display: flex; flex-direction: column; gap: 12px; }
.hero-side-card {
  flex: 1; background: var(--bg-card); border-radius: 10px; padding: 22px 24px;
  border: 1px solid var(--border); cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.hero-side-card:hover {
  border-color: var(--accent); box-shadow: 0 6px 20px rgba(37,99,235,0.08);
  transform: translateY(-2px);
}
.hero-side-card h3 {
  font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 6px;
}
.hero-side-card h3 a { color: inherit; text-decoration: none; }
.hero-side-meta { font-size: 12px; color: var(--text-muted); }

/* Section Header */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 2px solid var(--border);
}
.section-header h2 { font-size: 15px; font-weight: 700; color: var(--text); text-transform: uppercase; letter-spacing: 0.8px; }

/* Article Grid */
.article-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--border); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 40px;
}
.article-card {
  background: var(--bg-card); padding: 26px 28px; cursor: pointer;
  display: flex; flex-direction: column; transition: background 0.15s;
}
.article-card:hover { background: var(--card-hover); }
.article-card:nth-child(odd):not(:last-child) { border-right: 1px solid var(--border); }
.article-card:not(:nth-last-child(-n+2)) { border-bottom: 1px solid var(--border); }
.card-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.site-badge {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  background: var(--border-light); padding: 3px 10px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.8px;
}
.card-date { font-size: 11px; color: var(--text-muted); }
.card-view { font-size: 11px; color: var(--border); margin-left: auto; }
.article-card h3 {
  font-size: 17px; font-weight: 600; color: var(--text); line-height: 1.35;
  margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.article-card h3 a { color: inherit; text-decoration: none; }
.card-summary {
  font-size: 13px; color: var(--text-secondary); line-height: 1.6; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 14px;
}
.card-takeaways { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.takeaway-chip {
  font-size: 11px; background: var(--green-bg); color: var(--green-text);
  padding: 2px 10px; border-radius: 20px; border: 1px solid var(--green-border);
}
.card-footer {
  display: flex; align-items: center; gap: 8px; font-size: 12px;
  color: var(--text-muted); border-top: 1px solid var(--border-light);
  padding-top: 12px; margin-top: auto;
}
.card-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }
.card-footer .read-more { margin-left: auto; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.3px; }

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 32px 0 16px; padding: 16px 0;
}
.pagination a {
  padding: 8px 20px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 13px; font-weight: 500; color: var(--text); text-decoration: none;
  transition: all 0.2s;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
.pagination-info { font-size: 13px; color: var(--text-muted); }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */

.article-header {
  margin-bottom: 32px; padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.article-header h1 {
  font-size: 32px; font-weight: 700; line-height: 1.25;
  color: var(--text); margin-bottom: 16px; letter-spacing: -0.5px;
}
.article-meta {
  font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 12px;
}
.article-meta .authors { color: var(--accent); }

.article-body { font-family: 'Georgia', 'Times New Roman', serif; font-size: 17px; line-height: 1.8; color: #1a1a2e; }
.article-body p { margin-bottom: 1.5em; }
.article-body .summary-lead {
  font-size: 19px; line-height: 1.7; color: var(--text-secondary);
  border-left: 3px solid var(--accent); padding-left: 20px; margin-bottom: 28px;
  font-style: italic;
}
.article-body .summary-lead p { margin-bottom: 1em; }

.sentiment-badge {
  display: inline-block; font-size: 10px; font-weight: 600; padding: 3px 12px;
  border-radius: 20px; margin-bottom: 24px; text-transform: uppercase; letter-spacing: 0.8px;
}
.sentiment-badge.positif { background: var(--sentiment-p); color: var(--sentiment-p-text); }
.sentiment-badge.negatif { background: var(--sentiment-n); color: var(--sentiment-n-text); }
.sentiment-badge.netral { background: var(--sentiment-netral); color: var(--sentiment-netral-text); }

.section-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: 16px; margin-top: 36px;
  padding-bottom: 10px; border-bottom: 2px solid var(--border);
}

/* Key Takeaways */
.takeaway-list { list-style: none; margin-bottom: 24px; counter-reset: takeaways; }
.takeaway-list li {
  padding: 14px 18px; background: var(--takeaway-bg); border-radius: 8px;
  margin-bottom: 10px; font-size: 16px; line-height: 1.6;
  border-left: 3px solid var(--takeaway-border); color: var(--takeaway-color);
  counter-increment: takeaways;
}
.takeaway-list li::before {
  content: counter(takeaways) "."; font-weight: 700; margin-right: 8px; color: #16a34a;
}

/* Insights */
.insight-list { list-style: none; margin-bottom: 24px; }
.insight-list li {
  padding: 14px 18px; background: var(--insight-bg); border-radius: 8px;
  margin-bottom: 10px; font-size: 16px; line-height: 1.6;
  border-left: 3px solid var(--insight-border); color: var(--insight-color);
}
.insight-list li::before { content: "\2726 "; color: #f59e0b; font-weight: 700; }

/* Source Box */
.source-box {
  background: var(--source-bg); border: 1px solid var(--source-border); border-radius: 10px;
  padding: 20px 24px; margin-top: 36px; margin-bottom: 24px;
}
.source-box p { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.source-box a { color: var(--accent); font-size: 13px; word-break: break-all; }
.source-box a:hover { text-decoration: underline; }

/* Article Nav */
.article-nav {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--border);
}
.article-nav a { font-size: 13px; color: var(--accent); text-decoration: none; font-weight: 500; }
.article-nav a:hover { text-decoration: underline; }

/* Related Articles */
.related-articles { margin-top: 32px; }
.related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.related-card {
  display: block; padding: 14px 16px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 8px; text-decoration: none;
  transition: all 0.2s;
}
.related-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.related-site {
  font-size: 10px; font-weight: 600; color: var(--accent);
  text-transform: uppercase; letter-spacing: 0.8px;
}
.related-title {
  display: block; font-size: 14px; font-weight: 500; color: var(--text);
  margin-top: 4px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Social Sharing */
.share-bar {
  display: flex; align-items: center; gap: 8px; margin: 24px 0;
  padding: 16px 0; border-top: 1px solid var(--border-light);
}
.share-bar span { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 6px; font-size: 12px; font-weight: 600;
  text-decoration: none; transition: all 0.15s; border: none; cursor: pointer;
}
.share-btn:hover { transform: translateY(-1px); opacity: 0.9; }
.share-whatsapp { background: #25d366; color: #fff; }
.share-twitter { background: #1da1f2; color: #fff; }
.share-linkedin { background: #0077b5; color: #fff; }
.share-telegram { background: #0088cc; color: #fff; }
.share-copy { background: var(--border-light); color: var(--text-secondary); border: 1px solid var(--border); }
.share-copy:hover { background: var(--accent-bg); color: var(--accent); border-color: var(--accent); }

/* Newsletter */
.newsletter-box {
  background: linear-gradient(135deg, #0a0a23 0%, #1a1a4e 100%);
  border-radius: 12px; padding: 32px; margin: 40px 0; color: #fff;
}
.newsletter-box h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.newsletter-box p { font-size: 14px; color: rgba(255,255,255,0.7); margin-bottom: 16px; }
.newsletter-form { display: flex; gap: 8px; max-width: 460px; }
.newsletter-form input {
  flex: 1; padding: 12px 16px; border: 2px solid rgba(255,255,255,0.2);
  border-radius: 8px; font-size: 14px; background: rgba(255,255,255,0.1);
  color: #fff; outline: none; transition: border-color 0.2s;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.4); }
.newsletter-form input:focus { border-color: var(--accent); }
.newsletter-form button {
  padding: 12px 24px; background: var(--accent); color: #fff; border: none;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
  transition: background 0.2s; white-space: nowrap;
}
.newsletter-form button:hover { background: #1d4ed8; }
.newsletter-form button:disabled { opacity: 0.5; cursor: not-allowed; }
.newsletter-msg { font-size: 13px; margin-top: 10px; min-height: 20px; }
.newsletter-msg.success { color: #86efac; }
.newsletter-msg.error { color: #fca5a5; }

/* ============================================================
   CATEGORY PAGE
   ============================================================ */
.category-header { margin-bottom: 32px; }
.category-header h1 { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.category-header p { font-size: 14px; color: var(--text-secondary); }

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-header { margin-bottom: 32px; }
.search-header h1 { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.search-header .query { color: var(--accent); }
.search-form {
  display: flex; gap: 8px; max-width: 600px; margin-bottom: 24px;
}
.search-form input {
  flex: 1; padding: 12px 16px; border: 2px solid var(--border); border-radius: 8px;
  font-size: 15px; outline: none; transition: border-color 0.2s;
  background: var(--bg-card); color: var(--text);
}
.search-form input:focus { border-color: var(--accent); }
.search-form button {
  padding: 12px 24px; background: var(--accent); color: #fff; border: none;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.search-form button:hover { background: #1d4ed8; }
.search-count { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* ============================================================
   TOOLS PAGE (Admin)
   ============================================================ */
.tools-layout .container { max-width: 960px; }

.tools-steps {
  display: flex; gap: 12px; margin-bottom: 24px; justify-content: center;
}
.tools-step {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #999; font-weight: 500;
}
.tools-step.active { color: #2563eb; }
.tools-step.done { color: #166534; }
.tools-step-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: #e5e7eb; color: #999;
}
.tools-step.active .tools-step-num { background: #2563eb; color: white; }
.tools-step.done .tools-step-num { background: #16a34a; color: white; }
.tools-step-arrow { color: #d1d5db; font-size: 18px; }

.tools-input-section {
  background: var(--bg-card); padding: 24px; border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin-bottom: 24px;
  border: 1px solid var(--border);
}
.tools-input-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.ticker-wrap {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
  overflow: hidden; white-space: nowrap; font-size: 13px; color: var(--text-secondary);
  user-select: none;
}
.ticker-label {
  flex-shrink: 0; font-weight: 600; color: #2563eb;
  background: #eff6ff; padding: 4px 10px; border-radius: 4px; font-size: 12px; z-index: 1;
}
.ticker-track {
  display: inline-flex; align-items: center; gap: 6px;
  animation: ticker-scroll 40s linear infinite;
}
.ticker-track a { color: #2563eb; text-decoration: none; }
.ticker-track a:hover { color: #1d4ed8; text-decoration: underline; }
.ticker-sep { color: #ccc; font-weight: bold; }
@keyframes ticker-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }

.tools-input-group { display: flex; gap: 8px; }
.tools-input-group input {
  flex: 1; padding: 12px 16px; border: 2px solid var(--border); border-radius: 8px;
  font-size: 14px; transition: border-color 0.2s; outline: none;
  background: var(--bg); color: var(--text);
}
.tools-input-group input:focus { border-color: #2563eb; }
.tools-input-group button {
  padding: 12px 24px; background: #2563eb; color: white; border: none;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.tools-input-group button:hover { background: #1d4ed8; }
.tools-input-group button:disabled { background: #93c5fd; cursor: not-allowed; }

.tools-loading { display: none; text-align: center; padding: 40px; }
.tools-loading.active { display: block; }
.spinner {
  width: 36px; height: 36px; border: 4px solid #e0e0e0; border-top-color: #2563eb;
  border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.tools-loading p { color: #666; font-size: 14px; }

.tools-error { display: none; background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; padding: 14px 18px; border-radius: 8px; margin-bottom: 24px; font-size: 14px; }
.tools-error.active { display: block; }

.tools-panels { display: grid; gap: 24px; }
.tools-panel {
  background: var(--bg-card); border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); overflow: hidden;
  border: 1px solid var(--border);
}
.tools-panel-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.tools-panel-header h3 { font-size: 15px; font-weight: 600; }
.tools-panel-body { padding: 24px; }

.tools-full-text { font-size: 14px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; max-height: 400px; overflow-y: auto; }
.tools-summary-text { font-size: 15px; line-height: 1.8; color: var(--text); margin-bottom: 20px; }
.tools-takeaway-list { list-style: none; margin-bottom: 20px; }
.tools-takeaway-list li {
  padding: 10px 14px; background: #f0fdf4; border-radius: 8px; margin-bottom: 8px;
  font-size: 14px; color: #166534; border-left: 3px solid #16a34a;
}
.tools-insight-list { list-style: none; }
.tools-insight-list li {
  padding: 10px 14px; background: #fffbeb; border-radius: 8px; margin-bottom: 8px;
  font-size: 14px; color: #92400e; border-left: 3px solid #f59e0b;
}

.tools-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.tools-meta span { margin-right: 12px; }
.tools-meta .authors { color: #2563eb; }
.tools-source-box { margin-top: 16px; padding: 12px; background: var(--source-bg); border-radius: 6px; font-size: 13px; border: 1px solid var(--source-border); }

.tools-publish-section {
  padding: 20px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.tools-publish-section .info { font-size: 13px; color: var(--text-muted); }
.btn-publish {
  padding: 10px 24px; background: #16a34a; color: white; border: none;
  border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn-publish:hover { background: #15803d; }
.btn-publish:disabled { background: #86efac; cursor: not-allowed; }

.tools-batch-toggle {
  margin-top: 12px; display: flex; align-items: center; gap: 10px;
}
.tools-batch-toggle label { font-size: 13px; color: var(--text-secondary); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.tools-batch-toggle span { font-size: 12px; color: var(--text-muted); }
.tools-batch-area textarea {
  width: 100%; padding: 12px; border: 2px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: monospace; resize: vertical;
  background: var(--bg); color: var(--text);
}
.tools-batch-status { font-size: 12px; color: var(--text-muted); align-self: center; }

.tools-category-select {
  flex: 1; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px;
  font-size: 13px; background: var(--bg-card); color: var(--text);
}

.tools-result { display: none; }
.tools-result.active { display: block; }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.login-box {
  background: var(--bg-card); padding: 40px; border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08); width: 100%; max-width: 400px;
  border: 1px solid var(--border);
}
.login-box .logo { text-align: center; margin-bottom: 20px; font-size: 14px; color: var(--text-muted); }
.login-box .logo span { color: var(--accent); font-weight: 700; }
.login-box h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; text-align: center; }
.login-box p { font-size: 14px; color: var(--text-secondary); margin-bottom: 24px; text-align: center; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-group input {
  width: 100%; padding: 12px 16px; border: 2px solid var(--border); border-radius: 8px;
  font-size: 15px; outline: none; transition: border-color 0.2s;
  background: var(--bg); color: var(--text);
}
.form-group input:focus { border-color: var(--accent); }
.form-group .error { color: #dc2626; font-size: 12px; margin-top: 6px; display: none; }
.form-group .error.show { display: block; }
.login-btn {
  width: 100%; padding: 12px; background: #0a0a23; color: white; border: none;
  border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.login-btn:hover { background: var(--accent); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.back-link { display: block; text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); text-decoration: none; }
.back-link:hover { color: var(--accent); }

/* ============================================================
   404 PAGE
   ============================================================ */
.error-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.error-page .container { text-align: center; padding: 40px 20px; max-width: 500px; }
.error-code { font-size: 72px; font-weight: 700; color: var(--border); line-height: 1; margin-bottom: 8px; }
.error-page h1 { font-size: 22px; font-weight: 700; margin-bottom: 8px; }
.error-page p { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.error-page .btn {
  display: inline-block; padding: 10px 24px; background: #0a0a23; color: white;
  border-radius: 8px; text-decoration: none; font-size: 13px; font-weight: 600;
  transition: background 0.2s;
}
.error-page .btn:hover { background: var(--accent); }

/* ============================================================
   EDIT MODE (Admin)
   ============================================================ */
.edit-bar {
  padding: 10px 32px; background: var(--edit-bg); border-bottom: 1px solid var(--edit-border);
  display: flex; align-items: center; justify-content: space-between;
  max-width: 780px; margin: 0 auto;
}
.btn {
  padding: 6px 16px; border-radius: 6px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: none;
}
.btn-edit { background: var(--accent); color: white; }
.btn-save { background: #16a34a; color: white; }
.btn-save:hover { background: #15803d; }
.btn-cancel { background: #f3f4f6; color: var(--text-secondary); border: 1px solid var(--border); }

.edit-field { margin-bottom: 16px; }
.edit-field label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.edit-field input, .edit-field textarea, .edit-field select {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 8px;
  font-size: 14px; background: var(--bg-card); color: var(--text);
}
.edit-field input:focus, .edit-field textarea:focus { border-color: var(--accent); outline: none; }
.edit-field textarea { min-height: 80px; resize: vertical; }

.list-item-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.list-item-row input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--bg-card); color: var(--text); }
.list-item-row .remove-btn {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: var(--sentiment-n); color: #dc2626; font-size: 14px; cursor: pointer;
}
.add-btn {
  padding: 6px 14px; background: var(--accent-bg); color: var(--accent);
  border: 1px dashed #2563eb; border-radius: 6px; font-size: 12px;
  font-weight: 600; cursor: pointer;
}
#edit-mode { display: none; }

/* ============================================================
   UTILITIES
   ============================================================ */
.btn-outline {
  background: transparent; color: #2563eb; border: 1px solid #2563eb;
}
.btn-outline:hover { background: #eff6ff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: #1a1a1a; color: white; padding: 12px 24px; border-radius: 8px;
  font-size: 14px; opacity: 0; transition: all 0.3s ease; pointer-events: none; z-index: 200;
}
.toast.active { opacity: 1; transform: translateX(-50%) translateY(0); }

.empty-state { text-align: center; padding: 100px 20px; }
.empty-state .icon { font-size: 64px; margin-bottom: 20px; }
.empty-state h3 { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.empty-state p { font-size: 15px; color: var(--text-secondary); max-width: 440px; margin: 0 auto; line-height: 1.7; }
.empty-state .btn {
  display: inline-block; margin-top: 28px; padding: 14px 32px;
  background: #0a0a23; color: white; font-weight: 600; font-size: 13px;
  border-radius: 8px; text-decoration: none;
}
.empty-state .btn:hover { background: var(--accent); }

/* ============================================================
   PAGE TRANSITIONS (Turbo Drive)
   ============================================================ */
body { transition: opacity 0.08s ease-in-out; }
body.turbo-loading { opacity: 0.6; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--border); padding: 28px 0; margin-top: 20px; }
.footer-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
}
.footer-inner a { color: var(--text-secondary); text-decoration: none; }
.footer-inner a:hover { color: var(--accent); }

/* ============================================================
   HAMBURGER MENU (Mobile)
   ============================================================ */
.nav-hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px; color: var(--text); font-size: 24px; line-height: 1;
}
.nav-hamburger span {
  display: block; width: 22px; height: 2px; background: var(--text);
  margin: 5px 0; border-radius: 2px; transition: all 0.2s;
}
.nav-hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-hamburger.active span:nth-child(2) { opacity: 0; }
.nav-hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

.nav-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 98; opacity: 0; transition: opacity 0.2s;
}
.nav-overlay.active { display: block; opacity: 1; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-section { grid-template-columns: 1fr; }
  .hero-main { min-height: 300px; }
}
@media (max-width: 768px) {
  .container { padding: 16px; }
  .nav-hamburger { display: block; z-index: 200; }
  .nav-inner { padding: 0 16px; gap: 12px; flex-wrap: nowrap !important; height: 56px !important; }
  .nav-links {
    display: none !important; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-nav); flex-direction: column; align-items: stretch;
    padding: 72px 24px 24px; gap: 0; z-index: 199;
    border-bottom: 1px solid var(--border); overflow-y: auto; overflow-x: hidden;
  }
  .nav-links.mobile-open { display: flex !important; }
  .nav-links a, .nav-links button {
    padding: 14px 16px !important; font-size: 15px !important;
    border-bottom: 1px solid var(--border-light);
    border-radius: 0; text-align: left; width: 100%;
  }
  .nav-links a:hover, .nav-links button:hover { background: var(--border-light); }
  .nav-links a.active { background: var(--accent-bg); }
  .nav-dropdown {
    position: static !important;
  }
  .nav-dropdown-content {
    position: static !important; display: block !important; box-shadow: none !important;
    border: none !important; border-radius: 0; padding: 0; min-width: unset !important;
    background: transparent !important; margin-left: 0 !important;
    left: auto !important; transform: none !important;
    max-width: 100%; overflow-x: hidden;
  }
  .nav-dropdown-content::before { display: none !important; }
  .nav-dropdown-content a {
    display: block !important; padding: 12px 16px !important; font-size: 14px !important;
    border-bottom: 1px solid var(--border-light);
    white-space: normal; text-align: left;
    align-items: unset !important; gap: unset !important;
    border-radius: 0 !important;
  }
  .nav-dropdown-trigger { justify-content: space-between; width: 100%; }
  .nav-dropdown-trigger .arrow { transition: none; }
  .nav-right { display: none !important; }
  .nav-search input { width: 140px; }
  .nav-search input:focus { width: 180px; }
  .hero-main { min-height: 260px; padding: 24px; }
  .hero-main h2 { font-size: 22px; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card:nth-child(odd):not(:last-child) { border-right: none; }
  .article-card:not(:last-child) { border-bottom: 1px solid var(--border); }
  .article-card { padding: 20px; }
  .container-narrow { padding: 20px 16px 32px; }
  .article-header h1 { font-size: 24px; }
  .article-body { font-size: 16px; }
  .article-body .summary-lead { font-size: 17px; }
  .edit-bar { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; gap: 8px; text-align: center; }
  .newsletter-form { flex-direction: column; }
  .share-bar { flex-wrap: wrap; }
  .tools-input-group { flex-direction: column; }
  .tools-input-group button { width: 100%; }
  .tools-step-arrow { display: none; }
  .tools-publish-section { flex-direction: column; align-items: stretch; }
}
@media (max-width: 480px) {
  .article-header h1 { font-size: 20px; }
  .nav-search { display: none; }
}
