/**
 * Стили для страницы турнирной таблицы
 * 
 * @package Arsenal
 * @since 1.0.0
 */

/* ==========================================================================
   CONTAINER
   ========================================================================== */

.container {
	padding: var(--container-padding-y) var(--container-padding-x);
	max-width: var(--container-max-width);
	margin: 0 auto;
}

/* Скрытие элементов для доступности (screen readers) */
.visually-hidden {
	position: absolute;
	width: 0.0625rem;
	height: 0.0625rem;
	padding: 0;
	margin: -0.0625rem;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Основной стиль h1 */
h1 {
	font-size: 2rem;
}

.tournament-standings-section {
    padding: 0rem 0;
    background: var(--color-white);
}

header.standings-header {
    margin-bottom: 1.875rem;
}

.standings-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 1.25rem;
    align-items: start;
    border-bottom: 0.1875rem solid var(--red-800);    
}

.standings-header .standings-controls {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    align-items: center;
}

.standings-controls {
    margin-top: 0.3125rem;
}

.season-selector-form {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.season-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-dark-gray);
    white-space: nowrap;
}

.season-select {
    padding: 0.5rem 0.75rem;
    border: 0.0625rem solid var(--gray-200);
    border-radius: 0.25rem;
    background: var(--color-white);
    color: var(--color-dark-gray);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.season-select:hover {
    border-color: var(--red-700);
}

.season-select:focus {
    outline: none;
    border-color: var(--red-700);
    box-shadow: 0 0 0 0.125rem rgba(196, 30, 58, 0.1);
}

.standings-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-dark-gray);
    margin: 0 0 0.625rem 0;
    display: block;
    line-height: 1.2;
}

.standings-league {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gray-700);
    margin: 0 0 1.25rem 0;
    padding: 0;
    display: block;
    grid-column: 1;
    grid-row: 2;
    align-self: end;
}

.standings-season {
    font-size: 0.875rem;
    color: var(--gray-700);
    margin: 0;
}

.standings-table-wrapper {
    background: var(--color-white);
    border-radius: 0.5rem;
    overflow-x: auto;
    box-shadow: 0 0.125rem 0.5rem var(--shadow-hover);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
}

.standings-table caption {
    display: none;
}

.standings-table thead {
    background: var(--gray-50);
    border-bottom: 0.125rem solid var(--gray-200);
}

.standings-table thead th {
    padding: 0.75rem 0.5rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--color-dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.03125rem;
}

.standings-table tbody tr {
    border-bottom: 0.0625rem solid var(--gray-200);
    transition: background-color 0.2s;
}

.standings-table tbody tr:hover {
    background-color: var(--gray-50);
}

.standings-table tbody tr.arsenal-row {
    background-color: var(--red-100);
    font-weight: 500;
}

.standings-table tbody td {
    padding: 0.75rem 0.5rem;
    font-size: 0.875rem;
    color: var(--color-dark-gray);
}

.standings-table .col-position {
    width: 2.5rem;
    text-align: center;
    font-weight: 600;
    color: var(--gray-700);
}

.standings-table .col-team {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 12.5rem;
    max-width: 15.625rem;
}

.standings-table .team-badge {
    display: block;
    width: 1.5rem;
    height: 1.5rem;
    object-fit: contain;
    flex-shrink: 0;
}

.standings-table .team-name {
    word-break: break-word;
    overflow-wrap: break-word;
    flex: 1;
    min-width: 0;
}

.standings-table .col-games,
.standings-table .col-wins,
.standings-table .col-draws,
.standings-table .col-losses,
.standings-table .col-diff,
.standings-table .col-points {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.standings-table .col-points {
    font-weight: 600;
    color: var(--color-dark-gray);
    width: 4.375rem;
}

.standings-table .text-center {
    text-align: center;
}

.standings-table .font-bold {
    font-weight: 700;
}

.standings-error {
    padding: 1.25rem;
    text-align: center;
    color: var(--gray-500);
}

/* Примечания */
aside.standings-notes {
    margin-top: 1.875rem;
    padding: 1.25rem;
    background: var(--color-white);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.5rem var(--shadow-hover);
}

.standings-notes .notes-title,
aside.standings-notes h2 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-dark-gray);
    margin: 0 0 0.9375rem 0;
}

.standings-notes .note-item {
    margin: 0 0 0.625rem 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-dark-gray);
}

.standings-notes .note-item:last-child {
    margin-bottom: 0;
}

.standings-notes .note-item strong {
    color: var(--red-800);
}

/* Штраф в колонке очков */
.points-penalty {
    display: inline-block;
    margin-left: 0.25rem;
    color: var(--red-800);
    font-weight: 600;
    cursor: help;
}

/* ===== АДАПТАЦИЯ ДЛЯ ПЛАНШЕТОВ И МОБИЛЬНЫХ (768px и выше) ===== */

/* Tablet Large (1024px) */
@media (max-width: 1024px) {
    h1, h2, h3, h4, h5, h6 {
        text-align: left;
    }

    .tournament-standings-section {
        padding: 2rem 0;
    }

    .standings-header {
        margin-bottom: 1.5rem;
    }

    .standings-title {
        font-size: 1.75rem;
    }

    .standings-table thead th {
        padding: 0.625rem 0.375rem;
        font-size: 0.75rem;
    }

    .standings-table tbody td {
        padding: 0.625rem 0.375rem;
        font-size: 0.8125rem;
    }

    .standings-table .col-team {
        min-width: 11.25rem;
        max-width: 12.5rem;
        gap: 0.375rem;
    }

    .standings-table .team-badge {
        width: 1.25rem;
        height: 1.25rem;
    }

    .standings-table .col-points {
        width: 3.75rem;
    }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
    h1, h2, h3, h4, h5, h6 {
        text-align: left;
    }

    .tournament-standings-section {
        padding: 1.75rem 0;
    }

    .standings-header {
        margin-bottom: 1.25rem;
    }

    .standings-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .standings-season {
        font-size: 0.75rem;
    }

    .standings-table-wrapper {
        border-radius: 0.375rem;
        overflow-x: auto;
    }

    .standings-table thead th {
        padding: 0.5625rem 0.3125rem;
        font-size: 0.6875rem;
    }

    .standings-table tbody td {
        padding: 0.5625rem 0.3125rem;
        font-size: 0.75rem;
    }

    .standings-table .col-team {
        min-width: 10rem;
        max-width: 11.25rem;
        gap: 0.375rem;
    }

    .standings-table .team-badge {
        width: 1.25rem;
        height: 1.25rem;
    }

    .standings-table .team-name {
        font-size: 0.75rem;
    }

    .standings-table .col-position {
        width: 2.1875rem;
        font-size: 0.75rem;
    }

    .standings-table .col-points {
        width: 3.4375rem;
        font-size: 0.8125rem;
    }

    aside.standings-notes {
        margin-top: 1.25rem;
        padding: 0.9375rem;
    }

    .standings-notes .notes-title {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .standings-notes .note-item {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
}

/* ===== МОБИЛЬНАЯ АДАПТАЦИЯ (480px и меньше) ===== */
@media (max-width: 480px) {
    h1, h2, h3, h4, h5, h6 {
        text-align: left;
    }

    .standings-title {
        font-size: 1.375rem;
    }
    
    .standings-season {
        font-size: 0.8125rem;
    }
    
    /* Скрываем таблицу */
    .standings-table thead {
        display: none;
    }
    
    .standings-table,
    .standings-table tbody,
    .standings-table tr,
    .standings-table td {
        display: block;
        width: 100%;
    }
    
    /* Карточка команды */
    .standings-table tbody tr {
        margin-bottom: 0.9375rem;
        border: 0.0625rem solid var(--gray-200);
        border-radius: 0.5rem;
        padding: 0.9375rem;
        background: var(--color-white);
        box-shadow: 0 0.125rem 0.25rem rgba(26, 26, 26, 0.05);
    }
    
    .standings-table tbody tr:hover {
        background-color: var(--color-white);
        box-shadow: 0 0.25rem 0.5rem var(--color-dark-gray)1a;
    }
    
    .standings-table tbody tr.arsenal-row {
        background-color: var(--red-100);
        border-color: var(--red-800);
    }
    
    /* Позиция команды - бейдж */
    .standings-table .col-position {
        position: absolute;
        top: 0.9375rem;
        right: 0.9375rem;
        width: 2rem;
        height: 2rem;
        line-height: 2rem;
        background: var(--gray-50);
        border-radius: 50%;
        font-size: 0.875rem;
        font-weight: 700;
        color: var(--gray-700);
    }
    
    .standings-table tr.arsenal-row .col-position {
        background: var(--red-800);
        color: var(--color-white);
    }
    
    /* Название команды */
    .standings-table .col-team {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin-bottom: 0.9375rem;
        padding-right: 2.8125rem;
        min-width: 0;
        max-width: 100%;
    }
    
    .standings-table .team-badge {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .standings-table .team-name {
        font-size: 1rem;
        font-weight: 600;
        color: var(--color-dark-gray);
    }
    
    /* Статистика - строки одна под другой */
    .standings-table td:not(.col-position):not(.col-team) {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        margin: 0 0 0.5rem 0;
        padding: 0.625rem 0.75rem;
        background: var(--gray-50);
        border-radius: 0.375rem;
    }
    
    .standings-table td:not(.col-position):not(.col-team)::before {
        content: attr(data-label);
        font-size: 0.8125rem;
        font-weight: 600;
        color: var(--gray-700);
        text-transform: uppercase;
        letter-spacing: 0.03125rem;
    }
    
    /* Значение справа */
    .standings-table td:not(.col-position):not(.col-team) {
        font-size: 0.9375rem;
        font-weight: 600;
        color: var(--color-dark-gray);
    }
    
    /* Очки - выделяем */
    .standings-table .col-points {
        background: var(--color-dark-gray);
        color: var(--color-white);
        font-size: 1rem;
        padding: 0.75rem;
        margin: 0.5rem 0 0 0;
    }
    
    .standings-table tr.arsenal-row .col-points {
        background: var(--red-800);
    }
    
    .standings-table .col-points::before {
        color: rgba(255, 255, 255, 0.8);
    }
    
    /* Штраф */
    .points-penalty {
        display: block;
        margin: 0.25rem 0 0 0;
        font-size: 0.875rem;
        color: var(--red-100);
    }
    
    /* Примечания */
    aside.standings-notes {
        margin-top: 1.25rem;
        padding: 0.9375rem;
    }
    
    .standings-notes .notes-title {
        font-size: 1rem;
    }
    
    .standings-notes .note-item {
        font-size: 0.8125rem;
        margin-bottom: 0.75rem;
    }

    /* Селектор сезона на мобильных */
    .standings-header {
        flex-direction: column;
        align-items: flex-start;
        padding-bottom: 1.25rem;       
    }

    .standings-controls {       
        width: 100%;
    }

    .season-selector-form {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .season-select {
        width: 100%;
    }
}

