/* Shared component layer
   Keep page CSS focused on page-only layout; reusable UI belongs here. */

:root {
  --component-motion-easing: cubic-bezier(0.4, 0, 0.2, 1);
  --component-motion-short: 150ms;
  --component-motion-medium: 200ms;
  --component-radius-default: 8px;
  --component-radius-card: 12px;
  --component-border: rgba(150, 150, 150, 0.5);
}

/* State utilities */
.is-hidden,
[hidden].is-hidden {
  display: none !important;
}

.is-visible {
  display: block !important;
}

.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

.is-disabled,
[aria-disabled="true"] {
  opacity: 0.38;
  pointer-events: none;
}

.has-error {
  border-color: var(--error, #D23D3D) !important;
}

.is-faded {
  opacity: 0;
}

.is-opaque {
  opacity: 1;
}

body.has-modal-open {
  overflow: hidden;
}

.copy-tooltip,
.copy-tooltip[hidden] {
  display: none !important;
}

.copy-tooltip.show {
  display: block !important;
}

/* Shared article/news headers and chip navigation */
.section-title {
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #666;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 15px;
}

.section-title h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--titleText, #333);
  display: inline-block;
  position: relative;
  padding: 0;
  margin: 0;
}

.category-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  justify-content: flex-start;
}

.category-nav a {
  color: var(--bodyText);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: background-color var(--component-motion-medium) var(--component-motion-easing),
    color var(--component-motion-medium) var(--component-motion-easing),
    opacity var(--component-motion-medium) var(--component-motion-easing);
  text-align: center;
  background: var(--lightGrey);
  border-radius: 0.25rem;
  white-space: nowrap;
}

.category-nav a:hover,
.category-nav a.active {
  background-color: var(--lightBlue);
}

.category-nav a.active {
  color: var(--blue);
}

.news-subcategory {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.subcategory-chips {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
}

.subcategory-chips .chip:first-child {
  margin-left: 0;
}

/* Social/share controls used by news, analyses, and tip details */
.share-news {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.analiza-social {
  display: flex;
  gap: 15px;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

.share-btn button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--bodyText, #333);
  padding: 6px 10px;
  border-radius: 4px;
  transition: background-color var(--component-motion-medium) var(--component-motion-easing),
    opacity var(--component-motion-medium) var(--component-motion-easing);
  font-size: 14px;
}

.share-btn button:hover {
  background-color: rgba(240, 240, 240, 0.1);
}

.like-btn.active {
  color: #e91e63;
}

.like-btn.active .feather[data-feather="heart"] {
  fill: #e91e63;
  color: #e91e63;
}

.like-count-container {
  display: flex;
  align-items: center;
  color: #777;
}

.like-count {
  font-weight: 600;
  margin-left: 5px;
  font-size: 14px;
}

/* Shared article/detail content primitives */
.single-analysis {
  background-color: #fff;
  border-radius: var(--component-radius-default);
  padding: 0;
  margin-bottom: 30px;
}

.analysis-header {
  margin-bottom: 20px;
}

.analysis-meta {
  display: none;
}

.analysis-location,
.analysis-date,
.analysis-author {
  display: flex;
  align-items: center;
}

.analysis-location a {
  color: var(--darkGrey, #6c757d);
  text-decoration: none;
}

.analysis-location a:hover {
  text-decoration: underline;
}

.analysis-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.tag-badge {
  background-color: var(--lightGrey, #f0f0f0);
  color: var(--bodyText, #333);
  font-size: 0.875rem;
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 2rem;
  font-family: "Red Hat Display", sans-serif;
  text-decoration: none;
}

.tag-badge:hover {
  background-color: #e0e0e0;
  color: var(--bodyText, #333);
}

.related-analyses {
  border-top: 1px solid #eee;
  padding-top: 20px;
  margin-top: 20px;
}

.related-analyses h3 {
  margin-bottom: 20px;
  font-size: 22px;
  color: var(--titleText, #333);
  font-weight: 600;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.related-item {
  background-color: #f9f9f9;
  border-radius: var(--component-radius-default);
  overflow: hidden;
  transition: transform 150ms var(--component-motion-easing),
    box-shadow 150ms var(--component-motion-easing);
}

.related-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.related-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.related-img {
  height: 150px;
}

.related-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

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

.analize-card:hover .news-img,
.novosti-card:hover .news-img {
  transform: scale(1.05);
}

.news-img-placeholder {
  width: 100%;
  height: 100%;
  background-color: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  font-size: 14px;
}

.news-meta {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
}

.news-excerpt {
  font-size: 13px;
  color: #666;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.page-link,
.page-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 4px;
  font-size: 14px;
}

.page-link {
  background-color: #f5f5f5;
  color: #555;
  text-decoration: none;
  transition: background-color 0.2s;
}

.page-link:hover {
  background-color: #e0e0e0;
}

.page-current {
  background-color: var(--c-main, #0e77a9);
  color: #fff;
  font-weight: 500;
}

.page-dots {
  color: #888;
  padding: 0 5px;
}

.no-content,
.error-message {
  text-align: center;
  padding: 40px 20px;
  color: #666;
  background-color: #f9f9f9;
  border-radius: var(--component-radius-default);
  margin: 20px 0;
}

.feather {
  vertical-align: middle;
}

.breadcrumb {
  display: flex;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  list-style: none;
  background-color: #f8f9fa;
  border-radius: 0.25rem;
  color: #666;
  font-size: 14px;
}

.breadcrumb-item {
  white-space: nowrap;
}

.breadcrumb-item + .breadcrumb-item {
  padding-left: 0.25rem;
}

.breadcrumb-item + .breadcrumb-item::before {
  padding-right: 0.25rem;
  color: var(--darkGrey);
  content: "/";
}

.breadcrumb-item a {
  color: var(--darkGrey);
  text-decoration: none;
}

.breadcrumb-item a:hover,
.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumb-item.active {
  color: var(--darkGrey);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: inline;
}

.breadcrumbs .current {
  color: #333;
}

.item-info img {
  width: 32px !important;
  padding: 0 !important;
  border-radius: 50%;
}

/* Shared horizontal chips */
.chips-container {
  flex-grow: 1;
  margin-right: 20px;
  overflow: hidden;
}

.chips-container h1 {
  margin-bottom: 0;
  color: var(--titleText);
}

.chips-scroll {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chips-scroll::-webkit-scrollbar {
  display: none;
}

/* Shared tip cards used on homepage, tip listings, and related tip modules */
.bet-cards {
  margin-top: 16px;
  width: 100%;
}

.bet-card {
  border-radius: var(--component-radius-default);
  background-color: var(--white, #fff);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--boxGrey, #F1F3F7);
  display: flex;
  width: 100%;
  flex-direction: column;
  overflow: hidden;
  align-items: stretch;
  justify-content: center;
  margin-bottom: 12px;
}

.bet-card:first-child {
  margin-top: 0;
}

.bet-card-link {
  flex: 1;
}

.bet-card-header {
  background-color: var(--boxGrey, #F1F3F7);
  display: flex;
  flex-direction: row;
  padding: 8px 12px;
  align-items: center;
  gap: 40px 100px;
  justify-content: space-between;
  flex-wrap: nowrap;
}

.bet-league {
  align-self: stretch;
  display: flex;
  min-width: 240px;
  margin-top: auto;
  margin-bottom: auto;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--bodyText);
  font-weight: 500;
  line-height: 1.4;
  justify-content: start;
  flex-wrap: wrap;
}

.league-icon {
  object-fit: contain;
  object-position: center;
  height: 16px;
  border-radius: 2px;
  align-self: stretch;
  margin-top: auto;
  margin-bottom: auto;
  flex-shrink: 0;
  overflow: hidden;
}

.league-title,
.match-time {
  align-self: stretch;
  margin-top: auto;
  margin-bottom: auto;
}

.match-time {
  font-weight: 500;
  line-height: 1;
}

.bet-card-content {
  display: flex;
  width: 100%;
  padding: 12px;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.user-comments,
.tip-user-name,
.bet-user-name {
  display: flex;
  align-items: center;
}

.user-comments {
  gap: 1rem;
}

.tip-user-name,
.bet-user-name {
  gap: 0.25rem;
}

.teams-tip-home {
  color: var(--titleText);
  font-size: 1rem;
  font-family: Red Hat Display, -apple-system, Roboto, Helvetica, sans-serif;
  font-weight: 600;
  line-height: 1;
  align-self: stretch;
  display: flex;
  align-items: center;
  flex: 1;
  flex-shrink: 1;
  flex-basis: 0%;
  margin: 0;
  gap: 0.5rem;
}

.bet-icon-container {
  align-self: stretch;
  display: flex;
  margin-top: auto;
  margin-bottom: auto;
  min-height: 16px;
  align-items: stretch;
  gap: 8px;
  justify-content: start;
  width: 16px;
}

.bet-icon {
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  width: 16px;
  flex: 1;
  flex-shrink: 1;
  flex-basis: 0%;
}

.bet-details {
  align-self: stretch;
  display: flex;
  margin-top: auto;
  margin-bottom: auto;
  align-items: start;
  gap: 8px;
  font-size: 14px;
  color: var(--titleText);
  font-weight: 400;
  line-height: 1;
  justify-content: start;
}

.odds-separator {
  color: #3c3c3c;
}

.bet-progress {
  background-color: rgba(217, 217, 217, 1);
  align-self: stretch;
  display: flex;
  margin-top: auto;
  margin-bottom: auto;
  width: 80px;
  flex-shrink: 0;
  height: 20px;
}

.bet-user {
  align-self: stretch;
  display: flex;
  margin-top: auto;
  margin-bottom: auto;
  min-height: 20px;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--titleText);
  font-weight: 500;
  line-height: 1;
  justify-content: start;
}

.user-avatar {
  aspect-ratio: 1;
  object-fit: contain;
  object-position: center;
  width: 20px;
  border-radius: 50%;
  align-self: stretch;
  margin-top: auto;
  margin-bottom: auto;
  flex-shrink: 0;
}

/* Fixture/bookmaker shared primitives */
.bookmaker-logo {
  object-fit: contain;
  object-position: center;
}

.bookmaker-card-media .bookmaker-logo {
  max-width: 80%;
  max-height: 60px;
}

.match-card-nizovi .bookmaker-logo,
.stat-card .bookmaker-logo {
  height: 24px;
  max-width: 40px;
  border-radius: 2px;
}

.odd-provider-logo {
  height: 24px;
  margin-left: 5px;
  vertical-align: middle;
}

.odd-trend {
  display: inline-block;
  margin-left: 2px;
}

.trend-up {
  color: var(--success, #54C273);
}

.trend-down {
  color: var(--error, #D23D3D);
}

.is-collapsed {
  display: none !important;
}

.is-expanded {
  display: block !important;
}

@media (max-width: 768px) {
  .section-title {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .category-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 5px;
    width: 100%;
  }

  .analysis-meta {
    display: flex;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }

  .share-btn span {
    display: none;
  }

  .share-btn button {
    padding: 8px;
  }
}

@media (max-width: 576px) {
  .related-grid,
  .news-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  .bet-cards,
  .bet-card,
  .bet-card-header,
  .bet-card-content,
  .bet-league {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .bet-card-header {
    max-width: 100%;
    gap: 0;
  }

  .league-name {
    flex: 1 1 0;
  }

  .bet-card-content {
    flex-direction: column;
  }

  .bet-details {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
}
