/* =====================================================================
   Chets Portal — тема "старый сайт"
   Тёмно-коричнево-золотая гамма (палитра старого сайта).
   Используются оригинальные изображения старого сайта из папки /img
   (logo1.jpg, content1.JPG, footer1.jpg, logom.jpg, tab.JPG).
   Пути указаны относительно assets/css/style.css -> ../../img/.
   ===================================================================== */

/* ===== СБРОС ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0b0b0b;
    color: #e5e5e5;
    font-family: 'Trebuchet MS', 'Segoe UI', Verdana, sans-serif;
    line-height: 1.5;
}

/* ===== КОНТЕЙНЕР ===== */
.site-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    background: #111;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.9);
}

/* Текстура основного контента — img/content1.JPG */
.site-wrapper main,
.site-wrapper > .container {
    flex: 1;
    background-image: url("../../img/content1.JPG");
    background-repeat: repeat;
    background-size: auto;
    background-color: #16100b;
}

/* Контейнер Bootstrap растягиваем на всю ширину обёртки */
.site-wrapper .container {
    max-width: 100%;
    padding-top: 30px;
    padding-bottom: 30px;
}

/* ===== ШАПКА — img/logo1.jpg (лёгкое затемнение для читаемости) ===== */
.site-header,
header {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    border-bottom: 2px solid #5a3a1b;
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.25), rgba(0, 0, 0, 0.45)),
        url("../../img/logo1.jpg");
    background-size: 100% 100%, cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #3b2615;
}

.logo img {
    height: 110px;
    max-width: 100%;
}

.logo-title {
    display: inline-block;
    font-size: 46px;
    font-weight: 900;
    color: #ffd98e;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.85), 0 0 2px #000;
    transition: color 0.2s ease;
    word-break: break-word;
}

.logo-title:hover {
    color: #ffae42;
}

/* ===== МЕНЮ ===== */
.site-header nav ul,
header nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.site-header nav a,
header nav a {
    color: #f5d08a;
    text-decoration: none;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 5px #000;
    padding: 4px 2px;
    transition: color 0.2s ease;
}

.site-header nav a:hover,
header nav a:hover {
    color: #ffae42;
}

.site-header nav a.active,
header nav a.active {
    color: #ffae42;
    border-bottom: 1px solid #ffae42;
}

/* ===== АДМИН-НАВБАР (оставшийся Bootstrap .navbar) ===== */
.navbar {
    background: linear-gradient(180deg, #1a120b, #120c07) !important;
    border-bottom: 2px solid #5a3a1b;
}

.navbar .navbar-brand {
    color: #ffd98e;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.navbar .navbar-brand:hover {
    color: #ffae42;
}

.navbar .nav-link {
    color: #f5d08a !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar .nav-link:hover,
.navbar .nav-link.active {
    color: #ffae42 !important;
}

.navbar .navbar-toggler {
    border-color: #5a3a1b;
    color: #f5d08a;
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
main {
    flex: 1;
    padding: 40px;
}

.site-wrapper main {
    padding: 30px 0;
}

/* ===== ТАБЫ ===== */
.tabs {
    display: flex;
    border-bottom: 2px solid #5a3a1b;
    flex-wrap: wrap;
    gap: 0 0;
}

.tab {
    padding: 15px 30px;
    cursor: pointer;
    background: #1a120b;
    border: 1px solid #5a3a1b;
    border-bottom: none;
    color: #cfae70;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: background 0.2s ease, color 0.2s ease;
    font-family: inherit;
}

.tab:hover {
    background: #2a1c0f;
    color: #ffd98e;
}

.tab.active {
    background: #3b2615;
    color: #ffd98e;
}

.tab + .tab {
    border-left: none;
}

/* ===== КОНТЕНТ ТАБОВ ===== */
.tab-content {
    padding: 30px 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active,
.tab-pane.show.active {
    display: block;
}

.tab-content h2 {
    margin-bottom: 15px;
    color: #ffd98e;
}

/* ===== ПОДВАЛ — img/footer1.jpg (лёгкое затемнение для читаемости) ===== */
.site-footer {
    height: 250px;
    background-image:
        linear-gradient(180deg, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0.55)),
        url("../../img/footer1.jpg");
    background-size: 100% 100%, cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-color: #0e0a06;
    position: relative;
    border-top: 2px solid #5a3a1b;
}

/* Затемняющий слой для читаемости текста */
.footer-overlay {
    height: 100%;
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #f5d08a;
    font-size: 14px;
    letter-spacing: 1px;
    text-shadow: 0 0 6px #000;
}

.footer-overlay a {
    color: #ffd98e;
    text-decoration: none;
}

.footer-overlay a:hover {
    color: #ffae42;
    text-decoration: underline;
}

/* ===== ЗАГОЛОВКИ ===== */
h1, h2, h3, h4, h5, h6 {
    color: #ffd98e;
}

/* ===== КАРТОЧКИ ===== */
.card {
    background: #1a120b;
    border: 1px solid #5a3a1b;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
    color: #e5e5e5;
}

.card .card-body {
    color: #e5e5e5;
}

.card-header {
    background: linear-gradient(180deg, #3b2615, #2a1a0d) !important;
    border-bottom: 1px solid #5a3a1b;
    color: #ffd98e !important;
    font-weight: 600;
}

.card-header h5,
.card-header h6 {
    color: inherit;
}

/* Все цветовые варианты шапок карточек — в старую гамму */
.card-header.text-white,
.card-header.text-dark {
    color: #ffd98e !important;
}

/* ===== ТАБЛИЦЫ ===== */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: #e5e5e5;
    --bs-table-border-color: #5a3a1b;
    color: #e5e5e5;
    border-color: #5a3a1b;
    margin-bottom: 0;
}

.table > thead {
    background: linear-gradient(180deg, #3b2615, #2a1a0d);
}

.table > thead th {
    color: #ffd98e;
    font-weight: 700;
    border-color: #5a3a1b;
    background: transparent;
    white-space: nowrap;
}

.table > tbody td,
.table > tbody th {
    border-color: rgba(90, 58, 27, 0.65);
    background-image: url("../../img/tab.JPG");
    background-repeat: repeat;
    background-size: auto;
    background-color: #241408;
    color: #000000;
    vertical-align: middle;
}

/* Строка итогов (суммы) внизу таблиц публичной части */
.table > tfoot td {
    border-top: 2px solid #5a3a1b;
    background-image: linear-gradient(180deg, #3b2615, #2a1a0d);
    color: #ffd98e;
    font-weight: 700;
    vertical-align: middle;
    white-space: nowrap;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(90, 58, 27, 0.30);
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(245, 208, 138, 0.12) !important;
    color: #fff;
}

/* Ссылки на игроков */
a.player-link {
    color: #171008;
    text-decoration: none;
    border-bottom: 1px dashed #5a3a1b;
    transition: color 0.15s ease-in-out;
}

a.player-link:hover {
    color: #422f15;
    border-bottom-style: solid;
}

/* Сортировка */
.sortable {
    cursor: pointer;
    user-select: none;
}

.sortable:hover {
    background-color: rgba(90, 58, 27, 0.5);
}

.sortable .bi-arrow-down-up {
    font-size: 0.8rem;
    opacity: 0.5;
}

/* Вертикальные заголовки колонок монстров */
#monstersTable thead th.source-header {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    max-width: 40px;
    padding: 8px 4px;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

#monstersTable thead th.source-header .bi-arrow-down-up {
    display: none;
}

#monstersTable tbody td {
    text-align: center;
    font-size: 0.85rem;
}

#monstersTable tbody td:nth-child(2) {
    text-align: left;
    white-space: normal;
    word-break: break-word;
    max-width: 150px;
}

/* ===== ФОРМЫ ===== */
.form-label {
    color: #cfae70;
}

.form-control,
.form-select {
    background-color: #0e0a06;
    border: 1px solid #5a3a1b;
    color: #f4e2db;
}

.form-control:focus,
.form-select:focus {
    background-color: #171008;
    color: #f4e2db;
    border-color: #ffae42;
    box-shadow: 0 0 0 0.25rem rgba(255, 174, 66, 0.15);
}

.form-control::placeholder {
    color: #9c8a6e;
}

.form-select option {
    background: #1a120b;
    color: #f4e2db;
}

/* Кнопки */
.btn-primary {
    background: linear-gradient(180deg, #5a3a1b, #3b2615);
    border: 1px solid #7a4f26;
    color: #ffd98e;
}

.btn-primary:hover,
.btn-primary:focus {
    background: linear-gradient(180deg, #7a4f26, #5a3a1b);
    border-color: #8a5c2b;
    color: #ffffff;
}

.btn-outline-primary {
    color: #7d6941;
    border-color: #5a3a1b;
}

.btn-outline-primary:hover {
    background: #3b2615;
    color: #ffd98e;
    border-color: #7a4f26;
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.breadcrumb {
    --bs-breadcrumb-divider-color: #5a3a1b;
    margin-bottom: 1rem;
}

.breadcrumb-item a {
    color: #f5d08a;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    color: #ffae42;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #cfae70;
}

/* ===== АЛЕРТЫ ===== */
.alert {
    background: #1a120b;
    border: 1px solid #5a3a1b;
    color: #e5e5e5;
}

.alert-danger {
    background: #3a1210;
    border-color: #8a2a20;
    color: #ffb4a8;
}

.alert-link {
    color: #ffae42;
}

/* ===== СПИСКИ (нормы в сайдбаре) ===== */
.list-group-item {
    background: #171008;
    border-color: #3c1a05;
    color: #e5e5e5;
    border-left: 3px solid #5a3a1b;
}

.list-group-item small,
.text-muted {
    color: #a48f6e !important;
}

/* ===== ИМЯ ИГРОКА В СТАРЫХ ТАБЛИЦАХ ===== */
.names {
    padding-left: 7px;
    padding-top: 5px;
    width: 180px;
    color: #f4e2db;
    font-weight: 900;
}

/* =====================================================================
   СТАРЫЕ КЛАССЫ FLEX-ТАБЛИЦ (перенесены со старого сайта)
   ===================================================================== */

.flex-table {
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* .row переопределяем ТОЛЬКО внутри старых flex-таблиц,
   чтобы не ломать сетку Bootstrap (.row) */
.flex-table .row {
    display: flex;
    flex-wrap: nowrap;
    min-width: min-content;
}

.flex-table .row:nth-child(odd) {
    background-color: #f8f9fa;
}

.flex-table .row:nth-child(even) {
    background-color: #e9ecef;
}

.header {
    background-color: #f8f9fa;
    font-weight: bold;
}

.cell {
    box-sizing: border-box;
    padding: 12px 16px;
    border: 1px solid #5a3a1b;
    background-image: url("../../img/tab.JPG");
    background-repeat: repeat;
    background-size: auto;
    background-color: #241408;
    color: #f4e2db;
    white-space: normal;
    overflow: hidden;
    min-width: 0;
    cursor: pointer;
    position: relative;
}

/* Ширина колонок старой flex-таблицы */
.col-1  { flex: 0 0 10%; }
.col-2  { flex: 0 0 50%; }
.col-3  { flex: 0 0 20%; }
.col-4  { flex: 0 0 10%; }
.col-10 { flex: 0 0 80%; }
.col-20 { flex: 0 0 20%; }
.col-11 { flex: 0 0 10%; }
.col-12 { flex: 0 0 50%; }
.col-13 { flex: 0 0 20%; }
.col-14 { flex: 0 0 70%; }
.col-15 { flex: 0 0 10%; }

.cell:after {
    content: attr(data-sort);
    position: absolute;
    right: 8px;
    color: #6c757d;
}

.body {
    display: flex;
    flex-direction: column;
}

/* Контейнер старой таблицы */
.table-containers {
    position: relative;
    width: 100%;
    border: 1px solid #5a3a1b;
    border-radius: 8px;
    overflow: visible;
    background: #1a1a1a;
    margin-bottom: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background-image: url("../../img/tab.JPG");
    background-repeat: repeat;
    background-size: auto;
}

.flex-tables {
    display: flex;
    flex-direction: column;
    min-width: 600px;
}

.rows {
    display: flex;
    width: 100%;
}

.cells {
    padding: 12px 16px;
    border-bottom: 1px solid #3c1a05;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #f4e2db;
}

/* Ширина колонок старой таблицы rows/cells */
.cols-1 { flex: 0 0 40%; }
.cols-2 { flex: 0 0 12%; }
.cols-3 { flex: 0 0 12%; }
.cols-4 { flex: 0 0 12%; }
.cols-5 { flex: 0 0 12%; }
.cols-6 { flex: 0 0 12%; }
.cols-7 { flex: 0 0 8%; }
.cols-8 { flex: 0 0 8%; }
.cols-9 { flex: 0 0 8%; }
.cols-22 { flex: 0 0 9%; }

/* Заголовок старой таблицы */
.headers .cells {
    background-image: url("../../img/tab.JPG");
    background-repeat: repeat;
    background-size: auto;
    background-color: #241408;
    color: #ffd98e;
    font-weight: 600;
    text-align: left;
    border-bottom: 2px solid #3c1a05;
}

/* Прокручиваемое тело старой таблицы */
.table-body-wrapper {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: #cfae70;
}

.table-body-wrapper::-webkit-scrollbar {
    height: 8px;
}

.table-body-wrapper::-webkit-scrollbar-track {
    background: #cfae70;
    border-radius: 4px;
}

.table-body-wrapper::-webkit-scrollbar-thumb {
    background: #cfae70;
    border-radius: 4px;
}

/* ===== СЧЁТЧИКИ / БЛОКИ (старый сайт) ===== */
.count {
    display: flex;
    flex-direction: row;
    gap: 10px;
}

.blockcount {
    margin-bottom: 10px;
}

.circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #5a3a1b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    border: 3px solid white;
}

.quadro {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    border: 3px solid white;
}

/* ===== ПРОГРЕСС-БАРЫ (старый сайт) ===== */
.progress-bar {
    width: 100%;
    height: auto;
    background-color: #B22222;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 10px 0 0 10px;
    transition: width 0.3s ease-in-out;
}

/* Защита нативных Bootstrap-прогресс-баров от старых правил */
.progress {
    background: #2a1a0d;
    border: 1px solid #5a3a1b;
}

.progress .progress-bar {
    background: linear-gradient(180deg, #B22222, #7a1515);
    height: 100%;
    overflow: hidden;
    border-radius: 0;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 992px) {
    .site-wrapper .container {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 900px) {
    .site-header,
    header {
        flex-direction: column;
        height: auto;
        min-height: 200px;
        padding: 20px;
        gap: 16px;
        background-image:
            linear-gradient(180deg, rgba(0, 0, 0, 0.30), rgba(0, 0, 0, 0.55)),
            url("../../img/logom.jpg");
        background-size: 100% 100%, cover;
        background-position: center;
        background-repeat: no-repeat;
        background-color: #1a120b;
    }

    .logo-title {
        font-size: 32px;
        text-align: center;
    }

    .site-header nav ul,
    header nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    main {
        padding: 20px;
    }

    .tabs {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .site-footer {
        height: 150px;
        background-position: center center;
    }

    .footer-overlay {
        font-size: 12px;
    }

    .cells {
        padding: 8px 12px !important;
        font-size: 0.9em;
    }

    .names {
        padding-left: 7px;
        padding-top: 5px;
        width: 150px;
        color: #f4e2db;
        font-weight: 900;
    }
}

/* Очень узкие экраны — старые колонки flex-таблиц */
@media (max-width: 480px) {
    .cell {
        padding: 8px 12px;
        font-size: 0.9em;
    }

    .col-1  { flex: 0 0 12%; }
    .col-2  { flex: 0 0 55%; }
    .col-3  { flex: 0 0 18%; }
    .col-4  { flex: 0 0 15%; }
    .col-10 { flex: 0 0 80%; }
    .col-20 { flex: 0 0 20%; }
    .col-11 { flex: 0 0 12%; }
    .col-12 { flex: 0 0 55%; }
    .col-13 { flex: 0 0 18%; }
    .col-14 { flex: 0 0 55%; }
    .col-15 { flex: 0 0 15%; }

    h1 {
        font-size: 14px;
    }

    .tab {
        padding: 12px 18px;
        font-size: 15px;
    }
}
