/* --- Настройки переменных --- */
:root {
    --cfc-blue: #034694;
    --cfc-dark: #1a1a1a;
    --cfc-gray: #f0f2f5;
    --cfc-win: #2ecc71;  /* Зеленый для победы */
    --cfc-loss: #e74c3c; /* Красный для поражения */
    --cfc-draw: #95a5a6; /* Серый для ничьей */
    --text-color: #333;
}

/* --- Контейнер карточки матча --- */
.chelsea-match-card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
    font-family: 'Roboto', 'Arial', sans-serif; /* Более современный шрифт */
    overflow: hidden;
}

.chelsea-match-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(3, 70, 148, 0.15);
    border-color: rgba(3, 70, 148, 0.2);
}

/* Ссылка поверх всего блока */
.match-link-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 10;
}

/* --- Верхняя полоса (Дата и Турнир) --- */
.match-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #888;
    margin-bottom: 12px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 8px;
}

.match-time {
    color: var(--cfc-blue);
    margin-left: 5px;
}

.status-alert {
    color: #e67e22; /* Оранжевый для переносов */
    font-weight: bold;
}

/* --- Тело матча (Команды и счет) --- */
.match-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Команды */
.team {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 35%; /* Фиксируем ширину для баланса */
}

.team-home {
    justify-content: flex-end;
    text-align: right;
}

.team-away {
    justify-content: flex-start;
    text-align: left;
}

.team-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--cfc-dark);
    line-height: 1.2;
    /* Обрезаем длинные названия с троеточием */
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis; 
    max-width: 120px;
}

.team-logo {
    width: 40px;
    height: 40px;
    min-width: 40px; /* Чтобы лого не сжималось */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Табло счета */
.score-board {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cfc-gray);
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 18px;
    color: var(--cfc-dark);
    margin: 0 15px;
    min-width: 80px;
}

.score-divider {
    margin: 0 4px;
    opacity: 0.4;
}

/* Цветовая индикация результата */
.score-board.status-win { background: var(--cfc-win); color: #fff; }
.score-board.status-loss { background: var(--cfc-loss); color: #fff; }
.score-board.status-draw { background: var(--cfc-draw); color: #fff; }
.score-board.status-postponed { background: #eee; color: #aaa; text-decoration: line-through; }

/* --- Подвал (Локация) --- */
.match-location {
    margin-top: 10px;
    font-size: 11px;
    color: #999;
    text-align: center;
}

/* --- Адаптивность для мобильных (Менее 400px) --- */
@media (max-width: 420px) {
    .team-name {
        font-size: 13px;
        max-width: 80px; /* Уменьшаем длину имени на телефонах */
        white-space: normal; /* Разрешаем перенос слов */
    }
    
    .team-logo {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }
    
    .score-board {
        margin: 0 8px;
        padding: 4px 8px;
        font-size: 16px;
        min-width: 60px;
    }
    
    .chelsea-match-card {
        padding: 10px;
    }
}

/* --- Контейнер выбора сезона --- */
.season-selector {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 15px 20px;
    border-radius: 12px; /* Закругленные углы как у карточек матчей */
    margin-bottom: 20px; /* Отступ от списка матчей */
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); /* Легкая тень */
    border: 1px solid #eee;
    flex-wrap: wrap;
    gap: 10px;
}

/* --- Текст "Сезон:" --- */
.season-label {
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    color: #888;
    margin-right: 5px;
    letter-spacing: 0.5px;
}

/* --- Блок со ссылками (чтобы они стояли ровно) --- */
.season-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Расстояние между кнопками */
    align-items: center;
}

/* --- Стили ссылок (сами сезоны) --- */
/* uCoz генерирует ссылки внутри $CATEGORIES$, стилизуем их */
.season-links a {
    display: inline-block;
    padding: 6px 16px;
    background-color: #f0f2f5; /* Светло-серый фон по умолчанию */
    color: #333;
    text-decoration: none;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border-radius: 20px; /* Форма "таблетки" (pill shape) */
    transition: all 0.2s ease;
    border: 1px solid transparent;
margin-top: 10px;
}

/* --- Эффект при наведении --- */
.season-links a:hover {
    background-color: #034694; /* Официальный синий Челси */
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(3, 70, 148, 0.2);
}

/* --- Активная ссылка (если uCoz добавляет класс, или через JS) --- */
.season-links a.active-season {
    background-color: #034694;
    color: #fff;
    cursor: default;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

/* --- Адаптивность для мобильных --- */
@media (max-width: 678px) {
    .season-selector {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
    }
    
    .season-links {
        width: 100%;
        margin-top: 5px;
    }
    
    .season-links a {
        flex: 1; /* Кнопки растягиваются для удобного нажатия пальцем */
        text-align: center;
        font-size: 13px;
    }
}

/* ================================================================= */
/* ТЕМНАЯ ТЕМА ДЛЯ РАСПИСАНИЯ И МАТЧЕЙ (DARK MODE) */
/* ================================================================= */

/* 1. Карточка матча (список и полная страница) */
body.dark-theme .chelsea-match-card {
    background: #2b3642; /* Цвет фона карточек из твоего CSS */
    border-color: rgba(255, 255, 255, 0.04); /* Тонкая рамка */
    box-shadow: none;
}

body.dark-theme .chelsea-match-card:hover {
    background: #354150; /* Цвет при наведении */
    border-color: rgba(255, 255, 255, 0.1);
}

/* 2. Тексты внутри карточки */
body.dark-theme .match-meta {
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

body.dark-theme .match-date {
    color: #a3a3a3;
}

body.dark-theme .match-time {
    color: #6fa8dc; /* Светло-голубой для времени */
}

body.dark-theme .match-tournament {
    color: #888;
}

body.dark-theme .team-name {
    color: #e3e3e3; /* Основной светлый текст */
}

body.dark-theme .match-location {
    color: #888;
}

/* 3. Табло счета */
body.dark-theme .score-board {
    background: #1d262f; /* Более темный фон для счета */
    color: #fff;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Статусы победы/поражения оставляем цветными, но меняем фон для "Перенесен" */
body.dark-theme .score-board.status-postponed {
    background: #384452;
    color: #ccc;
}

/* 4. Выбор сезона (Селектор) */
body.dark-theme .season-selector {
    background: #2b3642;
    border-color: rgba(255, 255, 255, 0.04);
}

body.dark-theme .season-label {
    color: #a3a3a3;
}

body.dark-theme .season-links a {
    background-color: #354150;
    color: #d3d3d3;
    border-color: rgba(255, 255, 255, 0.04);
}

body.dark-theme .season-links a:hover,
body.dark-theme .season-links a.active-season {
    background-color: #034694; /* Синий Челси оставляем */
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* 5. Вкладки (Анонс / Отчет / Live) на полной странице */
body.dark-theme .tab-label {
    background-color: #354150;
    color: #d3d3d3;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

body.dark-theme .tab-label:hover {
    background-color: #404d5e;
    color: #fff;
}

/* Активная вкладка (логика через checkbox/radio) */
body.dark-theme #tab_brief:checked ~ .match-tabs-nav label[for="tab_brief"],
body.dark-theme #tab_report:checked ~ .match-tabs-nav label[for="tab_report"],
body.dark-theme #tab_live:checked ~ .match-tabs-nav label[for="tab_live"] {
    background-color: #034694;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    border-color: #034694;
}

/* 6. Блоки контента (Текст отчета, Анонс) */
body.dark-theme .tab-content-block,
body.dark-theme .match-details-content {
    background: #2b3642;
    border-color: rgba(255, 255, 255, 0.04);
    color: #d3d3d3;
}

/* 7. Блок комментариев */
body.dark-theme .comment-wrapper {
    background: #2b3642;
    border-color: rgba(255, 255, 255, 0.04);
}

body.dark-theme .commnent-header {
    color: #e3e3e3;
    border-bottom-color: rgba(255, 255, 255, 0.04);
}

body.dark-theme .commnet-nope {
    background: #354150;
    color: #ccc;
    box-shadow: none;
}

/* ================================================================= */
/* СОВРЕМЕННАЯ ФОРМА ДОБАВЛЕНИЯ (ADD/EDIT FORM) */
/* ================================================================= */

/* Контейнер формы */
.chelsea-modern-form {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    max-width: 900px;
    margin: 0 auto;
}

/* Группы полей */
.form-group {
    margin-bottom: 20px;
}

/* Сетка для двух колонок (например, счет или логотипы) */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* Заголовки полей (Label) */
.form-label {
    display: block;
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.form-label .manStar {
    color: #e74c3c;
    margin-left: 3px;
}

/* Подсказки (мелкий текст) */
.form-helper {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    line-height: 1.3;
}
.form-helper a { color: #034694; text-decoration: underline; }

/* --- Стилизация Input, Select, Textarea от uCoz --- */
/* Важно: мы обращаемся к элементам внутри нашего класса, чтобы перебить стандартные стили */
.chelsea-modern-form input[type="text"],
.chelsea-modern-form input[type="password"],
.chelsea-modern-form input[type="file"],
.chelsea-modern-form select,
.chelsea-modern-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #f9f9f9;
    font-family: 'Noto Sans', sans-serif;
    font-size: 14px;
    color: #333;
    transition: all 0.2s ease;
    box-sizing: border-box; /* Чтобы padding не ломал ширину */
}

.chelsea-modern-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* Фокус на поле */
.chelsea-modern-form input:focus,
.chelsea-modern-form select:focus,
.chelsea-modern-form textarea:focus {
    outline: none;
    border-color: #034694; /* Синий Челси */
    background: #fff;
    box-shadow: 0 0 0 3px rgba(3, 70, 148, 0.1);
}

/* Кнопки (Сохранить / Отмена) */
.form-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.manTdBut input {
    cursor: pointer;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 30px !important;
    border-radius: 6px !important;
    border: none !important;
    transition: background 0.2s;
}

/* Кнопка "Добавить/Сохранить" */
.manTdBut input[type="submit"] {
    background-color: #034694 !important;
    color: #fff !important;
}
.manTdBut input[type="submit"]:hover {
    background-color: #022f63 !important;
}

/* Кнопка "Отмена/Просмотр" */
.manTdBut input[type="button"], 
.manTdBut input[type="reset"] {
    background-color: #e0e0e0 !important;
    color: #333 !important;
}

/* --- Адаптивность --- */
@media (max-width: 600px) {
    .form-grid-2 {
        grid-template-columns: 1fr; /* На мобильном в одну колонку */
        gap: 10px;
    }
    .chelsea-modern-form {
        padding: 15px;
    }
}

/* --- ТЕМНАЯ ТЕМА (DARK THEME) --- */
body.dark-theme .chelsea-modern-form {
    background: #2b3642;
    box-shadow: none;
    border: 1px solid #384452;
}

body.dark-theme .form-label {
    color: #e3e3e3;
}

body.dark-theme .form-helper {
    color: #aaa;
}
body.dark-theme .form-helper a { color: #6fa8dc; }

body.dark-theme .chelsea-modern-form input[type="text"],
body.dark-theme .chelsea-modern-form input[type="password"],
body.dark-theme .chelsea-modern-form select,
body.dark-theme .chelsea-modern-form textarea {
    background: #1d262f;
    border-color: #384452;
    color: #fff;
}

body.dark-theme .chelsea-modern-form input:focus,
body.dark-theme .chelsea-modern-form select:focus,
body.dark-theme .chelsea-modern-form textarea:focus {
    border-color: #034694;
    background: #151d25;
}

body.dark-theme .form-buttons {
    border-top-color: rgba(255,255,255,0.1);
}

body.dark-theme .manTdBut input[type="button"] {
    background-color: #354150 !important;
    color: #fff !important;
}