/* ============================================================
   style.css — News.Dental, copiat exact din conferences.dental
   Font: Plus Jakarta Sans | Accent: auriu #b8973a
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

@font-face {
  font-family: "Plus Jakarta Sans Fallback";
  src: local("Arial");
  size-adjust: 105%;
  ascent-override: 96%;
  descent-override: 22%;
  line-gap-override: 0%;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; }

/* === VARIABILE IDENTICE CU conferences.dental ============= */
:root {
  --bg:          #fafaf8;
  --surface:     #ffffff;
  --surface2:    #f5f4f0;
  --surface3:    #eeecea;
  --border:      #e0ded8;
  --border2:     #cccac3;
  --text:        #1c1a16;
  --text2:       #3d3a32;
  --muted:       #7a776e;
  --muted2:      #a8a59d;
  --accent:      #b8973a;
  --accent-h:    #9d7f2e;
  --accent-light:#fdf8ec;
  --accent-mid:  #f5e9c4;
  --accent-dark: #7a6022;
  --green:       #2d6a4f;
  --green-bg:    #d8f3dc;
  --red:         #9b2335;
  --red-bg:      #fde8eb;
  --amber:       #b8620a;
  --amber-bg:    #fef3e2;
  --font:        'Plus Jakarta Sans', 'Plus Jakarta Sans Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --r:           8px;
  --r-md:        12px;
  --r-lg:        16px;
  --shadow:      0 1px 4px rgba(28,26,22,.07), 0 1px 2px rgba(28,26,22,.04);
  --shadow-md:   0 4px 16px rgba(28,26,22,.09), 0 2px 6px rgba(28,26,22,.05);
  --shadow-lg:   0 10px 32px rgba(28,26,22,.12);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* === HEADER — alb cu border, ca conferences.dental ======== */
.site-header-wrap {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(28,26,22,.06);
}
.site-header {
  position: static;
  border-bottom: none;
  box-shadow: none;
  background: transparent;
}
/* Fallback dacă nu se folosește wrapper */
.site-header:not(.unwrapped) {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(28,26,22,.06);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

/* Logo — text normal + accent auriu pe "bold" */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none;
}
.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  display: block;
  flex-shrink: 0;
}
.logo-icon { font-size: 20px; }
.logo-text { color: var(--text); }
.logo-text strong { color: var(--accent); }

.admin-badge {
  background: var(--accent-mid);
  color: var(--accent-dark);
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .06em;
  text-transform: uppercase;
}

/* Search în header */
.search-bar { flex: 1; display: flex; max-width: 420px; margin-left: auto; }
.search-bar input {
  flex: 1;
  border: 1px solid var(--border);
  border-right: none;
  background: var(--surface2);
  color: var(--text);
  padding: .45rem 1rem;
  font-family: var(--font);
  font-size: .9rem;
  border-radius: var(--r) 0 0 var(--r);
  outline: none;
  transition: border-color .15s, background .15s;
}
.search-bar input::placeholder { color: var(--muted2); }
.search-bar input:focus { border-color: var(--accent); background: var(--surface); }
.search-bar button {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0 1rem;
  cursor: pointer;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 1rem;
  transition: background .2s;
}
.search-bar button:hover { background: var(--accent-h); }

.header-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r);
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  font-size: .95rem;
  text-decoration: none;
  position: relative;
  transition: background .15s, color .15s;
}
.btn-icon:hover  { background: var(--surface2); color: var(--text); }
.btn-icon.active { background: var(--accent-light); color: var(--accent); }

.notif-badge {
  position: absolute;
  top: 2px; right: 2px;
  background: var(--red);
  color: #fff;
  font-size: .56rem;
  font-weight: 700;
  min-width: 15px; height: 15px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  transition: all .15s;
  text-decoration: none;
  border: none;
  background: none;
}
.btn-back:hover { color: var(--accent); background: var(--accent-light); }

/* === NOTIFICĂRI =========================================== */
.notif-panel {
  position: fixed;
  top: 66px; right: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-md);
  z-index: 200;
  white-space: nowrap;
}
.notif-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.notif-header button { background: none; border: none; cursor: pointer; color: var(--muted2); font-size: 12px; padding: 0; line-height: 1; }
.notif-header button:hover { color: var(--text); }

/* === LAYOUT =============================================== */
.layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}

/* === SIDEBAR — exact ca conferences.dental ================ */
.sidebar { position: sticky; top: 80px; }

.sidebar-section {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
  background: none; /* fără box, fără border-radius */
  border-radius: 0;
  box-shadow: none;
  padding-top: 0;
  padding-left: 0;
  padding-right: 0;
}
.sidebar-section:last-child { border-bottom: none; margin-bottom: 0; }

.sidebar-section h3 {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 10px;
}

/* filter-link — stilul conferences.dental: cu border-bottom per item */
.filter-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  transition: color .15s;
  text-decoration: none;
  background: none;
  border-radius: 0;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-link:last-child { border-bottom: none; }
.filter-link:hover  { color: var(--accent); }
.filter-link.active { color: var(--accent); font-weight: 600; }

/* Select surse */
.filter-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  cursor: pointer;
  transition: border-color .15s;
  appearance: auto;
}
.filter-select:focus { border-color: var(--accent); }

/* === MAIN FEED ============================================ */
.main-feed { min-width: 0; }

.results-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  font-size: 14px;
  color: var(--muted);
  flex-wrap: wrap;
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
}
.results-header strong { color: var(--text); }
.clear-search {
  background: var(--red-bg);
  color: var(--red);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  margin-left: auto;
  transition: background .15s;
}
.clear-search:hover { background: #fbd0d6; }

/* === GRID ARTICOLE ======================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}

/* Card — identic cu .event-card */
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s, border-color .2s;
  box-shadow: var(--shadow);
}
.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent);
}
.article-card.is-read { opacity: .6; }

/* Imagine — aspect ratio ca .ec-img */
.card-image {
  aspect-ratio: 290/148;
  overflow: hidden;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border);
  position: relative;
  flex-shrink: 0;
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s;
}
.article-card:hover .card-image img { transform: scale(1.04); }

/* Badge suprapus pe imagine */
.card-category-tag {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-mid);
  color: var(--accent-dark);
  padding: 2px 8px;
  border-radius: 20px;
}
.tag-ro       { background: #fde8eb; color: var(--red); }
.tag-dental   { background: var(--green-bg); color: var(--green); }
.tag-research { background: var(--green-bg); color: var(--green); }
.tag-general  { background: var(--accent-mid); color: var(--accent-dark); }

/* Body card — ca .ec-body */
.card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Badges rând — ca .ec-badges */
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin-bottom: 2px;
}
.card-source {
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-mid);
  color: var(--accent-dark);
  padding: 2px 8px;
  border-radius: 20px;
}
.card-category {
  font-size: 11px;
  font-weight: 600;
  background: var(--surface2);
  color: var(--muted);
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.card-time {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-left: auto;
}

/* Titlu — ca .ec-title */
.card-title {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-title:hover { color: var(--accent); }

.card-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer card — ca .ec-footer */
.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.btn-fav {
  background: none;
  border: none;
  color: var(--muted2);
  cursor: pointer;
  padding: 0;
  font-size: 1rem;
  line-height: 1;
  transition: color .15s;
}
.btn-fav:hover  { color: var(--red); }
.btn-fav.active { color: var(--red); }

/* "Sursă originală →" — ca .ec-arrow */
.btn-ext {
  font-size: 14px;
  color: var(--muted2);
  text-decoration: none;
  transition: transform .15s, color .15s;
  display: inline-flex; align-items: center;
}
.article-card:hover .btn-ext { transform: translateX(3px); color: var(--accent); }

/* === EMPTY STATE ========================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 15px;
  grid-column: 1/-1;
}
.empty-icon { font-size: 2rem; margin-bottom: .75rem; }
.empty-state p { margin-bottom: 1rem; }

/* === PAGINARE — ca .page-btn ============================ */
.pagination { display: flex; gap: 6px; margin-top: 32px; justify-content: center; flex-wrap: wrap; }
.page-link {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  text-decoration: none;
  transition: all .15s;
}
.page-link:hover  { border-color: var(--accent); color: var(--accent); }
.page-link.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* === ARTICLE PAGE ========================================= */
.article-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 32px;
  align-items: start;
}
.article-main {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.article-header { margin-bottom: 20px; }
.article-meta-top { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.article-author { font-size: 12px; color: var(--muted); }
.article-title { font-size: 22px; font-weight: 700; line-height: 1.35; margin-bottom: 14px; }
.article-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.article-image { margin: 20px 0; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border); }
.article-image img { width: 100%; max-height: 380px; object-fit: cover; display: block; }

.article-description { font-size: 15px; color: var(--text2); line-height: 1.75; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }

/* ── AI Summary block ── */
.ai-block {
  background: linear-gradient(160deg, var(--accent-light) 0%, #fffdf5 100%);
  border: 1px solid var(--accent-mid);
  border-top: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 22px 26px 24px;
  margin-top: 32px;
  box-shadow: 0 2px 10px rgba(184,151,58,.08);
}
.ai-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.ai-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: .08em;
  background: var(--accent-mid);
  padding: 3px 10px;
  border-radius: 20px;
}
.ai-date { font-size: 12px; color: var(--muted2); margin-left: auto; font-style: italic; }
.btn-ai-generate {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 13px 24px;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  transition: background .2s, transform .15s, box-shadow .2s;
  box-shadow: 0 3px 10px rgba(184,151,58,.35);
  letter-spacing: .01em;
  margin-top: 6px;
}
.btn-ai-generate:hover {
  background: var(--accent-h);
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(184,151,58,.45);
}
.btn-ai-generate:active { transform: translateY(0); }
/* After summary generated — shrink to small inline button */
.ai-block.has-summary .btn-ai-generate {
  width: auto;
  padding: 5px 12px;
  font-size: 12px;
  margin-top: 0;
  box-shadow: none;
  margin-left: auto;
}
.ai-content {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.75;
  padding-top: 16px;
  border-top: 1px solid var(--accent-mid);
}
.ai-placeholder {
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 4px;
}
.ai-error { color: var(--red); font-style: italic; font-size: 14px; }
.ai-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-dark);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 0;
}
.spinner { width: 16px; height: 16px; border: 2px solid var(--accent-mid); border-top-color: var(--accent); border-radius: 50%; animation: spin .65s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.article-sidebar { position: sticky; top: 80px; }
.article-sidebar .sidebar-section { background: none; border: none; padding: 0; margin-bottom: 22px; padding-bottom: 22px; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.similar-item { display: block; padding: 6px 0; border-bottom: 1px solid var(--border); text-decoration: none; }
.similar-item:last-child { border-bottom: none; }
.similar-title { display: block; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; }
.similar-item:hover .similar-title { color: var(--accent); }
.similar-time { font-size: 12px; color: var(--muted); margin-top: 2px; display: block; }

/* === ADMIN =============================================== */
.admin-layout { max-width: 1100px; margin: 32px auto; padding: 0 24px; }
.admin-msg { padding: 10px 14px; border-radius: var(--r); margin-bottom: 20px; font-weight: 600; font-size: .86rem; border: 1px solid; }
.admin-msg.ok  { background: #f0fdf4; border-color: #86efac; color: #166534; }
.admin-msg.err { background: var(--red-bg); border-color: #f0a0aa; color: var(--red); }

.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 20px; text-align: center; box-shadow: var(--shadow); }
.stat-num { display: block; font-size: 2rem; font-weight: 700; color: var(--accent); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }

.admin-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); }
.admin-section h2 { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

.add-form { margin-bottom: 18px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.form-row input, .form-row select { padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--r); font-family: var(--font); font-size: 14px; background: var(--bg); color: var(--text); flex: 1; min-width: 120px; outline: none; transition: border-color .15s; }
.form-row input:focus, .form-row select:focus { border-color: var(--accent); background: var(--surface); }

.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table th { text-align: left; padding: 8px 10px; background: var(--surface2); border-bottom: 1px solid var(--border); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.admin-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover td { background: var(--bg); }
.inactive-row td { opacity: .45; }
.url-small { color: var(--muted2); font-size: 11px; font-family: monospace; }
.feed-error { color: var(--red); font-size: 12px; margin-top: 3px; font-weight: 600; }

.btn-sm { padding: 4px 8px; font-size: 12px; font-weight: 600; border-radius: var(--r); cursor: pointer; border: 1px solid var(--border); background: none; transition: all .15s; color: var(--text2); }
.btn-sm:hover { background: var(--surface2); }
.btn-toggle { padding: 4px 10px; font-size: 12px; font-weight: 600; border-radius: var(--r); cursor: pointer; border: 1px solid var(--border); background: none; color: var(--muted); transition: all .15s; }
.btn-toggle.active { color: #166534; border-color: #86efac; background: #f0fdf4; }
.btn-del { color: var(--red); border-color: #f0a0aa; }
.btn-del:hover { background: var(--red-bg); }
.btn-fetch-single { color: var(--accent-dark); border-color: var(--accent-mid); }
.btn-fetch-single:hover { background: var(--accent-light); }

.fetch-log { margin-top: 10px; background: #1c1a16; color: #c8b870; font-family: monospace; font-size: 12px; padding: 12px 14px; border-radius: var(--r); white-space: pre-wrap; max-height: 180px; overflow-y: auto; }

.terms-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.term-chip { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-mid); border: 1px solid var(--border2); border-radius: 20px; padding: 3px 10px; font-size: 13px; font-weight: 600; color: var(--accent-dark); }
.term-del { background: none; border: none; cursor: pointer; color: var(--muted2); font-size: 11px; padding: 0; line-height: 1; transition: color .15s; }
.term-del:hover { color: var(--red); }

/* === BUTOANE GLOBALE ==================================== */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: none;
  padding: 8px 16px; border-radius: var(--r); cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  text-decoration: none; transition: background .2s;
  letter-spacing: .01em;
}
.btn-primary:hover    { background: var(--accent-h); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; }

/* === RESPONSIVE ========================================= */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; padding: 20px 16px 48px; gap: 16px; }
  .sidebar {
    position: static;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
  }
  .sidebar-section {
    flex: 1;
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
    min-width: 0;
  }
  .sidebar-section h3 { margin-bottom: 5px; }
  .filter-select { font-size: 13px; padding: 7px 8px; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .articles-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .form-row { flex-direction: column; }
  .article-main { padding: 16px; }
  .article-title { font-size: 18px; }
  .header-inner { padding: 0 12px; gap: 8px; }
}

/* ── Notificări — secțiune articole noi ── */

