/* ============================================================
   Site theme — blue/green news design, adapted to our own
   template structure (see templates/*.html).
   ============================================================ */

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

:root {
  --bg-main: #f4f5f7;
  --bg-card: #ffffff;
  --text-primary: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --accent: #0284c7;
  --accent-dark: #0369a1;
  --accent-light: #e0f2fe;
  --accent-green: #10b981;
  --danger: #ef4444;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --header-height: 62px;
}

/* ============================================================
   DARK MODE — <html data-theme="dark"> orqali yoqiladi
   (templates/base.html: localStorage'da saqlangan tanlov)
   ============================================================ */
[data-theme="dark"] {
  --bg-main: #0f1117;
  --bg-card: #171a23;
  --text-primary: #f1f2f4;
  --text-muted: #9aa1ae;
  --border: #2a2e3a;
  --accent: #38bdf8;
  --accent-dark: #0ea5e9;
  --accent-light: #123549;
  --accent-green: #34d399;
}

[data-theme="dark"] .site-footer { background: #090a0e; }
[data-theme="dark"] .hero-feature { background: linear-gradient(135deg, #05060a, #171a23); }
[data-theme="dark"] .card-thumb,
[data-theme="dark"] .mini-card-thumb,
[data-theme="dark"] .sidebar-item-thumb { background: linear-gradient(135deg, #123549, #0d2a22); }

* { box-sizing: border-box; }
html { transition: background-color 0.2s ease; }
body { transition: background-color 0.2s ease, color 0.2s ease; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { line-height: 1.3; margin: 0; }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-height);
  flex-wrap: nowrap;
}

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.hamburger-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.hamburger-btn.is-open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger-btn.is-open span:nth-child(2) { opacity: 0; }
.hamburger-btn.is-open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

.brand {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  background: linear-gradient(120deg, var(--accent) 0%, #0ea5e9 40%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cat-nav-desktop {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}
.cat-nav-desktop::-webkit-scrollbar { display: none; }

.cat-nav-desktop a {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.cat-nav-desktop a:hover { background: var(--accent-light); color: var(--accent); }

/* ============================================================
   MOBILE SIDEBAR (off-canvas) — faqat mobil kenglikda ishlatiladi,
   kompyuter versiyasida hech qachon ko'rinmaydi (pastdagi RESPONSIVE
   bo'limidagi min-width qoidasiga qarang).
   ============================================================ */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, 0.5);
  z-index: 1500;
}
.sidebar-backdrop.is-open { display: block; }

.mobile-sidebar {
  position: fixed;
  top: 0;
  left: -300px;
  width: 280px;
  height: 100%;
  background: var(--bg-card);
  z-index: 1600;
  overflow-y: auto;
  transition: left 0.25s ease;
  display: flex;
  flex-direction: column;
}
.mobile-sidebar.is-open { left: 0; }

.mobile-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-close-btn {
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.mobile-sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.mobile-sidebar-nav a {
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
}
.mobile-sidebar-nav a:hover { background: var(--bg-main); color: var(--accent); }

.mobile-sidebar-section {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.mobile-sidebar-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.mobile-sidebar-article {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  align-items: center;
}
.mobile-sidebar-article-thumb {
  width: 44px;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-light), #f0fdf4);
}
.mobile-sidebar-article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mobile-sidebar-article span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mobile-sidebar-matches-block { padding: 8px 0; border-bottom: 1px dashed var(--border); }
.mobile-sidebar-matches-block:last-child { border-bottom: none; }
.mobile-sidebar-matches-label { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.mobile-sidebar-matches-text {
  font-family: var(--font);
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  margin: 0;
  line-height: 1.6;
}



.auth-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  font-size: 14px;
  position: relative;
}

.user-menu { position: relative; }

.user-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 14px 5px 5px;
  cursor: pointer;
  font: inherit;
  color: var(--text-primary);
  font-weight: 600;
}

.user-pill:hover { border-color: var(--accent); }

.avatar-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-green));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-badge-img { object-fit: cover; background: none; }

.user-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  padding: 8px;
  z-index: 999;
}

.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown { display: block; }

.user-dropdown a,
.user-dropdown .link-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}

.user-dropdown a:hover,
.user-dropdown .link-btn:hover { background: var(--bg-main); color: var(--accent); }

.user-dropdown .link-btn { color: var(--danger); }

.btn-login-link,
.btn-register-link {
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 13px;
  border: none;
  cursor: pointer;
  font-family: var(--font);
}
.btn-login-link { color: var(--accent); background: none; }
.btn-login-link:hover { background: var(--accent-light); }
.btn-register-link { background: var(--accent); color: #fff; }
.btn-register-link:hover { background: var(--accent-dark); }

.cat-nav-special { color: var(--accent) !important; font-weight: 700 !important; }

/* ============================================================
   AUTH POPOVER (Kirish/Ro'yxatdan o'tish — header'dagi popup menyu)
   ============================================================ */
.auth-popover {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 16px;
  z-index: 999;
}
.auth-popover.is-visible { display: block; }

.auth-popover-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  background: var(--bg-main);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font);
}
.auth-tab.is-active { background: var(--bg-card); color: var(--accent); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }

.auth-tab-panel { display: none; flex-direction: column; gap: 10px; }
.auth-tab-panel.is-active { display: flex; }
.auth-tab-panel label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.auth-tab-panel input {
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  background: var(--bg-main);
  color: var(--text-primary);
}
.auth-tab-panel input:focus { outline: none; border-color: var(--accent); }
.auth-tab-panel button[type="submit"] { width: 100%; padding: 10px; font-size: 13px; }

.auth-popover .divider { text-align: center; color: var(--text-muted); font-size: 11px; margin: 12px 0 10px; }
.auth-popover .oauth-buttons { gap: 8px; }


/* ============================================================
   MAIN LAYOUT
   ============================================================ */
main.wrap { padding: 28px 20px 56px; }

.page-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 20px;
}

/* Generic content headings (admin pages, plain content blocks that don't
   opt into a more specific class already styled above). */
main.wrap > h1 { font-size: 24px; font-weight: 800; margin-bottom: 20px; }
main.wrap > h2 { font-size: 18px; font-weight: 800; margin: 28px 0 14px; }

/* ============================================================
   SECTION HEADER (shared)
   ============================================================ */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 32px 0 16px;
  gap: 12px;
}

.section-header .section-title {
  font-size: 19px;
  font-weight: 800;
}

.section-header:first-child { margin-top: 0; }

/* ============================================================
   CATEGORY PILLS
   ============================================================ */
.category-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill .count { color: var(--text-muted); font-weight: 500; }

/* ============================================================
   HERO (home page featured article + next-up list)
   ============================================================ */
.hero-grid {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 20px;
  margin-bottom: 8px;
}

.hero-feature {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 340px;
  background: linear-gradient(135deg, #1f2937, #374151);
  display: flex;
  align-items: flex-end;
}

.hero-feature img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-feature::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.88) 100%);
}

.hero-feature-body {
  position: relative;
  z-index: 2;
  padding: 24px;
  color: #fff;
}

.hero-feature .category-tag { margin-bottom: 10px; }

.hero-feature-title {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 10px;
}

.hero-feature-title a { color: #fff; }

.hero-feature-meta { color: rgba(255, 255, 255, 0.75); font-size: 12px; }

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mini-card {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 10px;
  flex: 1;
}

.mini-card-thumb {
  width: 92px;
  height: 74px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-light), #f0fdf4);
}

.mini-card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.mini-card-body { min-width: 0; }

.mini-card-title {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mini-card-title a:hover { color: var(--accent); }
.mini-card-meta { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   ARTICLE GRID / CARDS
   ============================================================ */
.article-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border: 1px solid #f0f0f0;
  transition: box-shadow 0.2s, transform 0.2s;
}

.article-card:hover { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08); }

.card-thumb {
  position: relative;
  width: 100%;
  height: 170px;
  background: linear-gradient(135deg, var(--accent-light), #f0fdf4);
  overflow: hidden;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .card-thumb img { transform: scale(1.04); }

.card-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
}

.article-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 14px 20px 0 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 9px;
}

.article-card-body h2 {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: auto;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card-body h2 a:hover { color: var(--accent); }

.article-card-body p { display: none; } /* keep excerpt out of the compact card look */

.card-meta {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.card-stats { white-space: nowrap; }

.mini-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.mini-card-stats { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

time { color: var(--text-muted); font-size: 12px; }

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
}

/* "load more" link */
.load-more-row { margin-top: 28px; text-align: center; }
.load-more-row .pill {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  padding: 10px 26px;
}
.load-more-row .pill:hover { background: var(--accent-dark); color: #fff; }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}

.article-full {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  min-width: 0;
  overflow-wrap: break-word;
}

.article-full h1 {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.35;
  margin: 14px 0 10px;
}

.article-image {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin: 16px 0;
}

.article-body {
  font-size: 15px;
  line-height: 1.85;
  color: #374151;
  white-space: pre-wrap;
}

.hashtags {
  display: block;
  margin-top: 18px;
  color: var(--accent);
  font-weight: 600;
  font-size: 13px;
}

.source-link {
  margin-top: 14px;
  font-size: 13px;
}
.source-link a {
  color: var(--text-muted);
  text-decoration: underline;
}

.reactions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid #f3f4f6;
}
.reactions form { display: inline; }
.reactions button {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font);
}
.reactions button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.reactions button:hover:not(.active) { border-color: var(--accent); color: var(--accent); }

/* ---- sidebar ---- */
.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
}

.sidebar-widget {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.widget-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f3f4f6;
}

.sidebar-item {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid #f3f4f6;
}
.sidebar-item:last-child { border-bottom: 0; padding-bottom: 0; }

.sidebar-item-thumb {
  width: 62px;
  height: 48px;
  border-radius: 7px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-light), #f0fdf4);
}
.sidebar-item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-item-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sidebar-item-title:hover { color: var(--accent); }

/* ============================================================
   COMMENTS
   ============================================================ */
.comments { margin-top: 40px; }

.comments-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 18px;
}

.notice {
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

.comment {
  display: flex;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 14px;
}

.comment-body { min-width: 0; flex: 1; }

.comment-head-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.comment b { font-size: 13px; font-weight: 700; }
.comment time { font-size: 11px; }

.comment p { margin: 4px 0 0; white-space: pre-wrap; font-size: 14px; line-height: 1.6; color: #374151; }

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  padding: 18px;
}

.comment-form textarea {
  min-height: 90px;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); }

.comment-form button { align-self: flex-start; }

.login-to-comment {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.login-to-comment a { color: var(--accent); font-weight: 700; }

/* ============================================================
   BUTTONS (generic)
   ============================================================ */
button, input[type="submit"] { font: inherit; }
button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.15s;
}
button:hover { background: var(--accent-dark); }
button.danger { background: var(--danger); }
button.danger:hover { background: #dc2626; }

/* ============================================================
   AUTH FORMS (login / register)
   ============================================================ */
.auth-form {
  max-width: 420px;
  margin: 20px auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-form h1 {
  font-size: 21px;
  font-weight: 800;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--accent-light);
  margin-bottom: 4px;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.auth-form input,
.auth-form textarea,
.auth-form select {
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 400;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-primary);
  background: var(--bg-main);
}
.auth-form input:focus, .auth-form textarea:focus, .auth-form select:focus { outline: none; border-color: var(--accent); }

.auth-form button { width: 100%; padding: 11px; font-size: 15px; }

.auth-form .divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  position: relative;
  margin: 2px 0;
}

.auth-form p { font-size: 13px; color: var(--text-muted); margin: 0; text-align: center; }
.auth-form p a { color: var(--accent); font-weight: 600; }

.error {
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #111827;
  color: #9ca3af;
  padding: 28px 0;
  margin-top: 48px;
  font-size: 13px;
}
.site-footer .wrap { text-align: center; }
.site-footer a { color: #d1d5db; }
.site-footer a:hover { color: #fff; }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.admin-tile {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-top: 3px solid var(--accent);
}
.admin-tile b { font-size: 26px; font-weight: 800; }
.admin-tile span { color: var(--text-muted); font-size: 12px; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.admin-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-main);
  padding: 10px 14px;
}
.admin-table td { padding: 12px 14px; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }

.inline-form { display: inline-flex; gap: 6px; }
.inline-form input[type="text"] {
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
}

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.moderation-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 14px;
}
.moderation-item p { margin: 8px 0; }
.moderation-item small { color: var(--text-muted); }
.moderation-item .actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ============================================================
   HERO SLIDESHOW
   ============================================================ */
.hero-slideshow { position: relative; }

.hero-slide {
  display: none;
  animation: heroFadeIn 0.4s ease;
}
.hero-slide.is-active { display: flex; }

@keyframes heroFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-slide-dots {
  position: absolute;
  z-index: 3;
  bottom: 14px;
  right: 18px;
  display: flex;
  gap: 6px;
}

.hero-slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  padding: 0;
}
.hero-slide-dot.is-active { background: #fff; width: 20px; border-radius: 4px; }

/* ============================================================
   CATEGORY IMAGE GRID (home page, images uploaded from admin panel)
   ============================================================ */
.category-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.category-image-card {
  position: relative;
  height: 120px;
  border-radius: var(--radius-md);
  background-color: #1f2937;
  background-image: linear-gradient(135deg, var(--accent), var(--accent-green));
  background-size: cover;
  background-position: center;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}

.category-image-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.75) 100%);
}

.category-image-overlay {
  position: relative;
  z-index: 2;
  padding: 12px 14px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.category-image-name { font-size: 14px; font-weight: 800; }
.category-image-stats { font-size: 11px; color: rgba(255, 255, 255, 0.8); }

/* ============================================================
   CURRENCY TICKER (o'ngdan chapga aylanadi)
   ============================================================ */
.rate-ticker {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 12px 0;
}

.rate-ticker.rate-ticker-top { margin-top: 0; margin-bottom: 24px; }

.rate-ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: rateScroll 22s linear infinite;
}
.rate-ticker:hover .rate-ticker-track { animation-play-state: paused; }

@keyframes rateScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.rate-item {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 28px;
  border-right: 1px solid var(--border);
}

/* ============================================================
   EMOJI REACTIONS (maqola sahifasi)
   ============================================================ */
.reaction-box {
  margin-top: 22px;
  padding: 20px;
  background: var(--bg-main);
  border-radius: var(--radius-lg);
}

.reaction-question { font-size: 15px; font-weight: 700; margin-bottom: 14px; }

.reaction-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 18px;
}
.reaction-bar-fill { height: 100%; border-radius: 999px; transition: width 0.3s ease; }

.reaction-emoji-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.reaction-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.reaction-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.reaction-circle:hover { transform: translateY(-2px); }
.reaction-circle.is-selected { border-width: 3px; background: var(--accent-light); }

.reaction-percent { font-size: 12px; font-weight: 700; color: var(--text-muted); }

.reaction-circle.c-gray { border-color: #9ca3af; }
.reaction-circle.c-yellow { border-color: #eab308; }
.reaction-circle.c-green { border-color: #22c55e; }
.reaction-circle.c-red { border-color: #ef4444; }
.reaction-circle.c-blue { border-color: #3b82f6; }
.reaction-circle.c-purple { border-color: #a855f7; }

.reaction-bar-fill.c-gray { background: #9ca3af; }
.reaction-bar-fill.c-yellow { background: #eab308; }
.reaction-bar-fill.c-green { background: #22c55e; }
.reaction-bar-fill.c-red { background: #ef4444; }
.reaction-bar-fill.c-blue { background: #3b82f6; }
.reaction-bar-fill.c-purple { background: #a855f7; }

/* ============================================================
   TELEGRAM SUBSCRIBE POPUP (cookie orqali har 3 soatda)
   ============================================================ */
.tg-popup-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 23, 0.55);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tg-popup-overlay.is-visible { display: flex; }

.tg-popup {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 28px 28px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.tg-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}
.tg-popup-close:hover { color: var(--text-primary); }

.tg-popup-title { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.tg-popup-text { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; line-height: 1.6; }
.tg-popup-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
}
.tg-popup-btn:hover { background: var(--accent-dark); }

/* ============================================================
   ADMIN CATEGORY IMAGE MANAGEMENT
   ============================================================ */
.admin-cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.admin-cat-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.admin-cat-thumb {
  height: 110px;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
}
.admin-cat-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-cat-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.admin-cat-body b { font-size: 14px; }
.admin-cat-body > span { font-size: 12px; color: var(--text-muted); }
.admin-cat-form { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.admin-cat-form input[type="file"] { font-size: 11px; max-width: 140px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { position: static; }
  .article-list { grid-template-columns: repeat(2, 1fr); }
  .reaction-circle { width: 44px; height: 44px; font-size: 20px; }
}

@media (max-width: 640px) {
  .hamburger-btn { display: flex; }
  .site-header .wrap { gap: 12px; }
  .brand { font-size: 18px; }

  /* Kompyuterdagi kategoriya qatori mobilda butunlay yashiriladi - u
     endi hamburger orqali ochiladigan sidebar'ga ko'chirilgan. Kirish/
     Ro'yxatdan o'tish va kecha-kunduz tugmasi esa mobilda ham HEADER'da
     qoladi (faqat ixchamlashtiriladi). */
  .cat-nav-desktop { display: none; }
  .header-right { gap: 6px; }
  .user-pill-name { display: none; }
  .btn-login-link, .btn-register-link { padding: 7px 10px; font-size: 12px; }

  .article-list { grid-template-columns: 1fr; }
  .article-full { padding: 18px; }
  .article-full h1 { font-size: 21px; }
  .auth-form { padding: 22px; margin: 12px; }

  .category-image-grid { grid-template-columns: repeat(2, 1fr); }
  .reaction-emoji-row { justify-content: center; gap: 14px; }
  .rate-item { padding: 0 16px; font-size: 12px; }

  .card-meta { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* Kompyuter versiyada sidebar/hamburger hech qachon kerak emas - hatto
   biror sabab bilan JS orqali "is-open" qo'shilib qolsa ham. */
@media (min-width: 641px) {
  .mobile-sidebar, .sidebar-backdrop, .hamburger-btn { display: none !important; }
}

/* ============================================================
   TODAY'S MATCHES (category page — sport-turdagi bo'limlarda)
   ============================================================ */
.matches-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 22px;
}
.matches-box-title { font-size: 16px; font-weight: 800; margin-bottom: 10px; }
.matches-box-text {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
  margin: 0;
  font-family: var(--font);
}

/* ============================================================
   OAUTH BUTTONS (login/register)
   ============================================================ */
.oauth-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* ============================================================
   CHAT
   ============================================================ */
.chat-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  height: 65vh;
  min-height: 420px;
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message { display: flex; gap: 10px; align-items: flex-start; }
.chat-message-body { min-width: 0; background: var(--bg-main); border-radius: var(--radius-md); padding: 8px 12px; }
.chat-message-author { display: block; font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.chat-message-text { font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

.chat-form { border-top: 1px solid var(--border); padding: 12px 16px; position: relative; }
.chat-input-row { display: flex; align-items: center; gap: 8px; }
.chat-input-row input[type="text"] {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font: inherit;
  background: var(--bg-main);
  color: var(--text-primary);
}
.chat-input-row input:focus { outline: none; border-color: var(--accent); }
.chat-input-row button[type="submit"] { border-radius: 999px; padding: 10px 20px; }

.chat-emoji-btn {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.chat-emoji-picker {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 8px;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  z-index: 50;
}
.chat-emoji-picker.is-open { display: grid; }
.chat-emoji-picker button {
  background: none;
  border: none;
  font-size: 20px;
  padding: 6px;
  cursor: pointer;
  border-radius: 6px;
}
.chat-emoji-picker button:hover { background: var(--bg-main); }

.chat-error { color: var(--danger); font-size: 12px; margin: 8px 0 0; min-height: 14px; }

/* ============================================================
   FOOTER LINKS (AdSense/Yandex talabiga mos huquqiy havolalar)
   ============================================================ */
.footer-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-bottom: 10px;
}
.footer-links a { font-size: 12px; color: #d1d5db; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-copyright { text-align: center; }

/* ============================================================
   LEGAL PAGE (maxfiylik, shartnoma, qoidalar, aloqa)
   ============================================================ */
.legal-page {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 780px;
  margin: 0 auto;
}
.legal-page .page-title { margin-bottom: 16px; }
.legal-body { font-size: 14px; line-height: 1.8; color: #374151; }
.legal-body p { margin: 0 0 14px; }
.legal-body ul { margin: 0 0 14px; padding-left: 20px; }
.legal-body li { margin-bottom: 6px; }
.legal-contact-btn { display: inline-block; margin-top: 6px; }

/* ============================================================
   AD SLOT ("bu yerda sizning reklamangiz bo'lishi mumkun")
   ============================================================ */
.ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin: 22px 0;
  transition: border-color 0.15s, color 0.15s;
}
.ad-slot:hover { border-color: var(--accent); color: var(--accent); }
.ad-slot-sidebar { min-height: 160px; margin: 0; }

/* ============================================================
   CRYPTO in ticker (adds after currency items)
   ============================================================ */
.rate-item.rate-item-crypto { color: var(--accent-green); }

/* ============================================================
   WEATHER TICKER (bottom, chapdan o'ngga)
   ============================================================ */
.weather-ticker {
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 10px 0;
}
.weather-ticker-track {
  display: inline-flex;
  white-space: nowrap;
  animation: weatherScroll 26s linear infinite;
}
.weather-ticker:hover .weather-ticker-track { animation-play-state: paused; }
@keyframes weatherScroll {
  from { transform: translateX(-50%); }
  to { transform: translateX(0); }
}
.weather-item {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 22px;
  border-right: 1px solid var(--border);
}

/* ============================================================
   SEARCH (header dropdown + mobile sidebar + search page)
   ============================================================ */
.search-widget { position: relative; }

.search-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-main);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.search-toggle-btn:hover { border-color: var(--accent); }

.search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  padding: 10px;
  gap: 8px;
  z-index: 999;
}
.search-dropdown.is-open { display: flex; }
.search-dropdown input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg-main);
  color: var(--text-primary);
}
.search-dropdown input:focus { outline: none; border-color: var(--accent); }
.search-dropdown button { padding: 8px 14px; font-size: 13px; }

.mobile-sidebar-search {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}
.mobile-sidebar-search input {
  flex: 1;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg-main);
  color: var(--text-primary);
}
.mobile-sidebar-search button { padding: 8px 12px; }

.search-page-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
  margin-bottom: 24px;
}
.search-page-form input {
  flex: 1;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg-card);
  color: var(--text-primary);
}
.search-page-form input:focus { outline: none; border-color: var(--accent); }
