/* ============================================
   SportJournal — Components
   ============================================ */

/* ─── Кнопки ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 10px 20px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--fs-sm);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    cursor: pointer;
    white-space: nowrap;
    line-height: 1.4;
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: transparent;
    color: var(--color-accent);
    border: 2px solid var(--color-accent);
}

.btn-secondary:hover {
    background: var(--color-accent);
    color: #fff;
}

.btn-danger {
    background: var(--color-danger);
    color: #fff;
}

.btn-danger:hover {
    background: #B91C1C;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-surface-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: var(--fs-xs);
}

.btn-lg {
    padding: 14px 28px;
    font-size: var(--fs-base);
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ─── Бейджи ─── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-sm);
    line-height: 1.4;
}

.badge-live {
    background: var(--color-live);
    color: #fff;
    animation: pulse-live 2s ease-in-out infinite;
}

.badge-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    animation: blink 1s step-end infinite;
}

.badge-breaking {
    background: var(--color-danger);
    color: #fff;
}

.badge-exclusive {
    background: var(--color-accent);
    color: #fff;
}

.badge-category {
    background: var(--color-accent);
    color: #fff;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
}

.badge-sport {
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: none;
}

@keyframes pulse-live {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.85;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ─── Карточки новостей ─── */
.news-card {
    position: relative;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.news-card:hover .news-card__image img {
    transform: scale(1.05);
}

.news-card__image {
    overflow: hidden;
    position: relative;
}

.news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.news-card__image .badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
}

.news-card__body {
    padding: var(--space-md);
}

.news-card__category {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.news-card__title {
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card__meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.news-card__meta svg {
    width: 14px;
    height: 14px;
}

/* Hero-карточка (большая) */
.news-card--hero {
    grid-column: 1;
    grid-row: 1 / 3;
}

.news-card--hero .news-card__image {
    height: 100%;
    min-height: 400px;
}

.news-card--hero .news-card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    padding: var(--space-xl) var(--space-lg);
}

.news-card--hero .news-card__title {
    font-size: var(--fs-2xl);
    color: #fff;
    -webkit-line-clamp: 3;
}

.news-card--hero .news-card__category {
    color: var(--color-live);
}

.news-card--hero .news-card__meta {
    color: rgba(255, 255, 255, 0.7);
}

/* Компактная карточка */
.news-card--compact {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

.news-card--compact .news-card__image {
    width: 120px;
    min-width: 120px;
    height: auto;
}

.news-card--compact .news-card__title {
    font-size: var(--fs-sm);
    -webkit-line-clamp: 2;
}

/* Средняя карточка (в сетке) */
.news-card--medium .news-card__image {
    height: 180px;
}

.news-card--medium .news-card__title {
    font-size: var(--fs-base);
}

/* ─── Match Widget (тикер матчей) ─── */
.match-ticker {
    background: var(--bg-header);
    height: var(--ticker-height);
    display: flex;
    align-items: center;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.match-ticker__track {
    display: flex;
    gap: var(--space-lg);
    padding: 0 var(--space-md);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory;
}

.match-ticker__track::-webkit-scrollbar {
    display: none;
}

.match-ticker__item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 4px var(--space-md);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: background var(--transition-fast);
    scroll-snap-align: start;
    font-size: var(--fs-xs);
    color: var(--text-inverse);
}

.match-ticker__item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.match-ticker__item--live {
    border: 1px solid var(--color-live);
}

.match-ticker__team {
    font-weight: 600;
    font-size: var(--fs-xs);
    color: #fff; /* Changed from var(--text-inverse) for better visibility */
}

.match-ticker__score {
    font-weight: 700;
    font-size: var(--fs-sm);
    padding: 0 6px;
    color: #fff;
}

.match-ticker__time {
    font-size: 10px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ─── Табы ─── */
.tabs {
    display: flex;
    gap: 2px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: var(--space-lg);
    overflow-x: auto;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.tab:hover {
    color: var(--text-primary);
}

.tab.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ─── Турнирная таблица ─── */
.league-table {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.league-table__header {
    padding: var(--space-md);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--fs-base);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.league-table table {
    font-size: var(--fs-sm);
}

.league-table th {
    padding: var(--space-sm) var(--space-sm);
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: var(--fs-xs);
    text-transform: uppercase;
    background: var(--bg-surface-hover);
}

.league-table td {
    padding: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.league-table tr {
    transition: background var(--transition-fast);
    cursor: pointer;
}

.league-table tbody tr:hover {
    background: var(--bg-surface-hover);
}

.league-table__pos {
    font-weight: 700;
    width: 28px;
    text-align: center;
}

.league-table__pos--ucl {
    color: var(--color-accent);
}

.league-table__pos--uel {
    color: #F59E0B;
}

.league-table__pos--rel {
    color: var(--color-danger);
}

.league-table__team {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
}

.league-table__team img {
    width: 20px;
    height: 20px;
    border-radius: 2px;
}

.league-table__pts {
    font-weight: 700;
}

/* ─── Виджет «Популярное» ─── */
.popular-widget {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.popular-widget__header {
    padding: var(--space-md);
    font-family: var(--font-heading);
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
}

.popular-widget__list {
    padding: var(--space-sm);
}

.popular-widget__item {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-md);
    transition: background var(--transition-fast);
    cursor: pointer;
}

.popular-widget__item:hover {
    background: var(--bg-surface-hover);
}

.popular-widget__num {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: var(--fs-xl);
    color: var(--text-muted);
    min-width: 28px;
    line-height: 1;
}

.popular-widget__text {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-widget__meta {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

/* ─── Progress Bar (чтение) ─── */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), var(--color-live));
    z-index: calc(var(--z-header) + 5);
    transition: width 100ms linear;
}

/* ─── Поиск (overlay) ─── */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    z-index: var(--z-overlay);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-slow);
}

.search-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.search-overlay__inner {
    width: 90%;
    max-width: 640px;
}

.search-overlay__input {
    width: 100%;
    padding: var(--space-lg);
    font-size: var(--fs-2xl);
    font-family: var(--font-heading);
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    outline: none;
}

.search-overlay__input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.search-overlay__input:focus {
    border-bottom-color: var(--color-accent);
}

.search-overlay__close {
    position: absolute;
    top: var(--space-xl);
    right: var(--space-xl);
    color: #fff;
    font-size: var(--fs-xl);
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    transition: background var(--transition-fast);
}

.search-overlay__close:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* ─── Share кнопки (sticky) ─── */
.share-sticky {
    position: sticky;
    top: calc(var(--header-height) + var(--ticker-height) + var(--space-xl));
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.share-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 1px solid var(--border-color);
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.share-btn--vk:hover {
    background: #4C75A3;
    color: #fff;
    border-color: #4C75A3;
}

.share-btn--tg:hover {
    background: #0088CC;
    color: #fff;
    border-color: #0088CC;
}

.share-btn--tw:hover {
    background: #1DA1F2;
    color: #fff;
    border-color: #1DA1F2;
}

.share-btn--copy:hover {
    background: var(--color-accent);
    color: #fff;
    border-color: var(--color-accent);
}

/* ─── Skeleton loading ─── */
.skeleton {
    background: linear-gradient(90deg,
            var(--bg-surface-hover) 25%,
            var(--border-color) 50%,
            var(--bg-surface-hover) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton--text {
    height: 14px;
    margin-bottom: var(--space-sm);
}

.skeleton--title {
    height: 22px;
    width: 80%;
    margin-bottom: var(--space-sm);
}

.skeleton--image {
    height: 200px;
}

.skeleton--avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
}

@keyframes skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ─── Scroll to Top ─── */
.scroll-top {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    z-index: var(--z-sticky);
    opacity: 0;
    transform: translateY(20px);
    transition: all var(--transition-normal);
    pointer-events: none;
}

.scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.scroll-top:hover {
    background: var(--color-accent-hover);
    transform: translateY(-3px);
}

.scroll-top svg {
    width: 20px;
    height: 20px;
}

/* ─── Форма (виджет формы команды W-D-L) ─── */
.form-widget {
    display: flex;
    gap: var(--space-xs);
    align-items: center;
}

.form-widget__item {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-xs);
    font-weight: 700;
    color: #fff;
}

.form-widget__item--w {
    background: var(--color-live);
}

.form-widget__item--d {
    background: var(--text-muted);
}

.form-widget__item--l {
    background: var(--color-danger);
}

/* ─── Match Scoreboard ─── */
.scoreboard {
    background: var(--bg-header);
    color: #fff;
    border-radius: var(--radius-xl);
    padding: var(--space-xl) var(--space-2xl);
    text-align: center;
}

.scoreboard__league {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.scoreboard__teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
}

.scoreboard__team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.scoreboard__team-logo {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-2xl);
}

.scoreboard__team-name {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: var(--fs-base);
}

.scoreboard__score {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: var(--fs-4xl);
    letter-spacing: 0.05em;
}

.scoreboard__time {
    font-size: var(--fs-lg);
    color: var(--color-live);
    margin-top: var(--space-xs);
}

/* ─── Timeline (события матча) ─── */
.timeline {
    position: relative;
    padding: var(--space-lg) 0;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: var(--border-color);
    transform: translateX(-50%);
}

.timeline__event {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
    position: relative;
}

.timeline__event--home {
    flex-direction: row-reverse;
    text-align: right;
}

.timeline__icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    font-size: var(--fs-sm);
}

.timeline__icon--goal {
    background: var(--color-live);
    color: #fff;
}

.timeline__icon--yellow {
    background: var(--color-warning);
    color: #fff;
}

.timeline__icon--red {
    background: var(--color-danger);
    color: #fff;
}

.timeline__icon--sub {
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
}

.timeline__info {
    font-size: var(--fs-sm);
}

.timeline__player {
    font-weight: 600;
    color: var(--text-primary);
}

.timeline__minute {
    color: var(--text-muted);
    font-size: var(--fs-xs);
}

/* ─── Stat bar (статистика матча) ─── */
.stat-bar {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0;
}

.stat-bar__label {
    flex: 1;
    text-align: center;
    font-size: var(--fs-sm);
    color: var(--text-secondary);
}

.stat-bar__value {
    font-weight: 700;
    font-size: var(--fs-sm);
    min-width: 40px;
    text-align: center;
}

.stat-bar__track {
    flex: 2;
    display: flex;
    height: 6px;
    border-radius: var(--radius-full);
    overflow: hidden;
    background: var(--bg-surface-hover);
}

.stat-bar__fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.stat-bar__fill--home {
    background: var(--color-accent);
}

.stat-bar__fill--away {
    background: var(--color-live);
}

/* ─── Comments ─── */
.comment {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.comment__avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-surface-hover);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--fs-sm);
    color: var(--text-muted);
}

.comment__body {
    flex: 1;
}

.comment__author {
    font-weight: 600;
    font-size: var(--fs-sm);
    margin-bottom: 2px;
}

.comment__date {
    font-size: var(--fs-xs);
    color: var(--text-muted);
}

.comment__text {
    font-size: var(--fs-sm);
    line-height: var(--lh-normal);
    color: var(--text-secondary);
    margin-top: var(--space-xs);
    margin-bottom: 0;
}
/* ============================================
   WPDISCuz COMMENTS - CUSTOM STYLES
   ============================================ */

#wpdcom {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    margin-top: 32px;
}

#wpdcom .wpd-form {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 20px;
}

#wpdcom .wpd-form-head {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

#wpdcom .wpd-s-head-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
}

#wpdcom .wpdiscuz-item textarea {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 12px;
}

#wpdcom .wpdiscuz-item textarea:focus {
    border-color: var(--color-accent);
    outline: none;
}

#wpdcom .wpd-button {
    background: var(--color-accent);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    padding: 12px 24px;
    cursor: pointer;
    transition: all 0.2s;
}

#wpdcom .wpd-button:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

#wpdcom .wpd-comment {
    background: var(--bg-elevated);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

#wpdcom .wpd-comment-header {
    color: var(--text-primary);
}

#wpdcom .wpd-comment-author {
    color: var(--color-accent);
    font-weight: 600;
}

#wpdcom .wpd-comment-text {
    color: var(--text-secondary);
    line-height: 1.6;
}

#wpdcom .wpd-comment-date {
    color: var(--text-muted);
    font-size: 12px;
}

#wpdcom .wpd-reply {
    margin-left: 40px;
    border-left: 2px solid var(--border-color);
    padding-left: 16px;
}

#wpdcom .wpd-vote {
    color: var(--text-muted);
}

#wpdcom .wpd-vote-up:hover,
#wpdcom .wpd-vote-down:hover {
    color: var(--color-accent);
}


/* Team logo in standings table */
.league-table__team {
    display: flex;
    align-items: center;
    gap: 6px;
}
.league-table__team-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}
