/* ===========================================================
   Bukmekerlar.uz — Unified sidebar component styles
   Используется на: reyting.html, bashoratlar.html, maqolalar.html
   =========================================================== */

/* ===== Sidebar container layouts ===== */
.reyting-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 88px;
}

.predict-sidebar,
.articles-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 96px;
}

/* ===== Widget base ===== */
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

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

.sidebar-widget__title {
  font-family: var(--font-display);
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.sidebar-widget__more {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--orange);
  text-decoration: none;
}
.sidebar-widget__more:hover {
  text-decoration: underline;
}

.sidebar-widget__link {
  display: block;
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--orange);
  text-decoration: none;
  border-top: 1px solid var(--border);
  transition: color 0.2s ease;
}
.sidebar-widget__link:hover {
  color: var(--orange-light);
}

.sidebar-date {
  font-size: 0.73rem;
  color: var(--text-faint);
}

/* ===== Ad widget ===== */
.sidebar-widget--ad {
  border-color: rgba(255, 122, 26, 0.35);
  background: linear-gradient(160deg, var(--surface), rgba(255, 122, 26, 0.05));
}
.sidebar-ad-inner {
  padding: 16px;
}
.sidebar-ad-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-faint);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.sidebar-ad-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.sidebar-ad-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}
.sidebar-ad-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.76rem;
  color: var(--gold);
  font-weight: 600;
  margin-top: 2px;
}
.sidebar-ad-offer {
  font-size: 0.86rem;
  line-height: 1.5;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.sidebar-ad-offer strong {
  color: var(--orange-light);
  font-weight: 700;
}
.sidebar-ad-btn {
  width: 100%;
  justify-content: center;
  display: flex;
}
.sidebar-ad-disclaimer {
  font-size: 0.67rem;
  color: var(--text-faint);
  margin-top: 8px;
  text-align: center;
}

/* ===== Recent posts widget ===== */
.sidebar-posts {
  padding: 4px 0;
  list-style: none;
}
.sidebar-post {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sidebar-post:last-child {
  border-bottom: none;
}
.sidebar-post a {
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.42;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}
.sidebar-post a:hover {
  color: var(--orange);
}
.sidebar-post__date {
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ===== TOP bookmakers widget ===== */
.sidebar-top-list {
  list-style: none;
  padding: 4px 0;
}
.sidebar-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-top-row:last-child {
  border-bottom: none;
}
.sidebar-top-rank {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.76rem;
  color: var(--text-faint);
}
.sidebar-top-rank.rank--gold {
  color: #161200;
  background: var(--grad-primary);
  border-radius: 50%;
}
.sidebar-top-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.sidebar-top-name {
  font-size: 0.84rem;
  font-weight: 600;
  font-family: var(--font-display);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-top-score {
  font-size: 0.74rem;
  color: var(--text-faint);
}

/* ===== Categories widget ===== */
.sidebar-cats-list {
  list-style: none;
  padding: 6px 0;
}
.sidebar-cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  transition: background 0.2s ease;
}
.sidebar-cat-link:hover {
  background: rgba(255, 255, 255, 0.04);
}
.sidebar-cat-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--c) 14%, transparent);
  color: var(--c);
}
.sidebar-cat-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}
.sidebar-cat-count {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* ===== Popular articles widget ===== */
.sidebar-popular-list {
  list-style: none;
  padding: 4px 0;
}
.sidebar-popular-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-popular-row:last-child {
  border-bottom: none;
}
.sidebar-popular-num {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--orange-light);
  min-width: 22px;
  flex-shrink: 0;
  padding-top: 2px;
}
.sidebar-popular-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sidebar-popular-title {
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}
.sidebar-popular-title:hover {
  color: var(--orange);
}
.sidebar-popular-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  color: var(--text-faint);
}

/* ===== Prediction widget ===== */
.sidebar-widget--pred {
  border-color: rgba(91, 141, 239, 0.3);
}
.sidebar-pred {
  padding: 14px 16px;
}
.sidebar-pred__match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: var(--font-display);
  margin-bottom: 10px;
}
.sidebar-pred__vs {
  font-size: 0.6rem;
  color: var(--text-faint);
  font-weight: 800;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}
.sidebar-pred__details {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sidebar-pred__tip {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(91, 141, 239, 0.14);
  border: 1px solid rgba(91, 141, 239, 0.3);
  color: #8fb6ff;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 0.84rem;
}
.sidebar-pred__koef {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.sidebar-pred__link {
  font-size: 0.82rem;
  color: var(--orange);
  font-weight: 600;
  text-decoration: none;
}
.sidebar-pred__link:hover {
  text-decoration: underline;
}

/* ===== Telegram widget ===== */
.sidebar-widget--tg {
  background: linear-gradient(
    135deg,
    rgba(0, 136, 204, 0.1),
    rgba(0, 136, 204, 0.03)
  );
  border-color: rgba(0, 136, 204, 0.3);
}
.sidebar-tg {
  padding: 18px 16px;
  text-align: center;
}
.sidebar-tg__icon {
  width: 36px;
  height: 36px;
  color: #0088cc;
  margin-bottom: 8px;
}
.sidebar-tg__title {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.sidebar-tg__text {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}
.sidebar-tg-btn {
  width: 100%;
  justify-content: center;
  display: flex;
  border-color: rgba(0, 136, 204, 0.4) !important;
  color: #0088cc !important;
}
.sidebar-tg-btn:hover {
  border-color: #0088cc !important;
  background: rgba(0, 136, 204, 0.08) !important;
}

/* ===== Shared helper ===== */
.brand-mark--sm {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  font-size: 0.66rem;
}

/* ===== Responsive ===== */
@media (max-width: 1040px) {
  .reyting-wrap__inner {
    grid-template-columns: 1fr 250px;
    gap: 28px;
  }
}

@media (max-width: 800px) {
  .reyting-wrap__inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .reyting-sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (max-width: 980px) {
  .predict-sidebar,
  .articles-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
}

@media (max-width: 560px) {
  .predict-sidebar,
  .articles-sidebar {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .reyting-sidebar {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sidebar-widget__head {
    padding: 10px 12px;
  }
  .sidebar-ad-inner,
  .sidebar-pred,
  .sidebar-tg {
    padding: 12px 12px;
  }
  .sidebar-post {
    padding: 8px 12px;
  }
  .sidebar-post a {
    font-size: 0.78rem;
  }
  .sidebar-pred__match {
    font-size: 0.8rem;
    margin-bottom: 8px;
  }
  .sidebar-pred__details {
    margin-bottom: 10px;
  }
  .sidebar-tg__title {
    font-size: 0.86rem;
  }
  .sidebar-tg__text {
    font-size: 0.76rem;
    margin-bottom: 10px;
  }
}
