/*
 * ByCulture Google Sheets Table — Front-end styles
 * Neutral, theme-agnostic, lightweight.
 */

/*
 * Шрифт: Montserrat (ближайший публичный аналог Noah).
 * Если на сайте уже подключён Noah — замените 'Montserrat' на 'Noah'
 * в переменной --byculture-font ниже, и строку @import можно удалить.
 */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700&display=swap');

:root {
    --byculture-font: 'Noah', 'Montserrat', sans-serif;
}

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.byculture-gst-wrapper {
    margin: 1.5em 0;
    font-family: var(--byculture-font);
    font-size: 17;
    color: inherit;
}

/* Шрифт применяется ко всем элементам DataTables внутри плагина */
.byculture-gst-wrapper *,
.byculture-gst-wrapper .dataTables_wrapper,
.byculture-gst-wrapper .dataTables_filter input,
.byculture-gst-wrapper .dataTables_length select,
.byculture-gst-wrapper .dataTables_info,
.byculture-gst-wrapper .dataTables_paginate {
    font-family: var(--byculture-font);
}

/* ── Action buttons row ───────────────────────────────────────────────────── */
.byculture-gst-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6em;
    margin-bottom: 1em;
    align-items: center;
}

.byculture-gst-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4em;
    padding: 0.45em 1.1em;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: opacity 0.15s ease, background 0.15s ease;
    border: none;
    line-height: 1.5;
}

.byculture-gst-btn:hover {
    opacity: 0.85;
    text-decoration: none !important;
}

/* PDF button — dark, serious */
.byculture-gst-btn--pdf {
    background-color: #1a1a1a;
    color: #ffffff !important;
}

.byculture-gst-btn--pdf::before {
    content: "↓";
    font-weight: 400;
}

/* CSV button — muted green */
.byculture-gst-btn--csv {
    background-color: #217a3b;
    color: #ffffff !important;
}

.byculture-gst-btn--csv::before {
    content: "↓";
    font-weight: 400;
}

/* ── Table scroll container ───────────────────────────────────────────────── */
.byculture-gst-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

/* ── The table itself ─────────────────────────────────────────────────────── */
.byculture-sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.1em;
    line-height: 1.55;
}

.byculture-sheet-table thead th {
    background-color: #f3f4f6;
    color: #1d1d1d;
    font-weight: 700;
    padding: 0.65em 0.85em;
    text-align: left;
    border-bottom: 2px solid #d1d5db;
    white-space: nowrap;
}

.byculture-sheet-table tbody td {
    padding: 0.55em 0.85em;
    border-bottom: 1px solid #e5e7eb;
    vertical-align: top;
    color: #1d1d1d;
}

.byculture-sheet-table tbody tr:last-child td {
    border-bottom: none;
}

.byculture-sheet-table tbody tr:nth-child(even) td {
    background-color: #f9fafb;
}

.byculture-sheet-table tbody tr:hover td {
    background-color: #f0f4ff;
}

/* ── DataTables overrides — keep look consistent ──────────────────────────── */

/* Отступ под строкой с полем поиска и выбором количества строк */
.byculture-gst-wrapper .byculture-dt-top {
    margin-bottom: 1.2em;    /* ← меняйте это значение: 0.5em / 1em / 1.5em и т.д. */
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5em;
}

.dataTables_wrapper .dataTables_filter input {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.3em 0.6em;
    font-size: 0.9em;
    outline: none;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.dataTables_wrapper .dataTables_length select {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.25em 0.5em;
    font-size: 0.9em;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 3px;
    padding: 0.2em 0.7em;
    font-size: 0.88em;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: #6366f1 !important;
    color: #fff !important;
    border-color: #6366f1 !important;
}

.dataTables_wrapper .dataTables_info {
    font-size: 0.85em;
    color: #6b7280;
    padding-top: 0.4em;
}


/* Sorting arrows — DataTables 2.x fix: скрываем дублирующиеся CSS-стрелки,
   оставляем только встроенные SVG-иконки из DataTables 2.x */


/* Sorting arrows — keep them understated */
table.dataTable thead th.sorting,
table.dataTable thead th.sorting_asc,
table.dataTable thead th.sorting_desc {
    cursor: pointer;
}

/* ── Error box ────────────────────────────────────────────────────────────── */
.byculture-error {
    padding: 0.9em 1.2em;
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #7f1d1d;
    border-radius: 4px;
    font-size: 0.95em;
    margin: 1em 0;
}

/* ── Responsive tweaks ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .byculture-gst-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .byculture-gst-btn {
        width: 100%;
        justify-content: center;
    }

    .dataTables_wrapper .dataTables_filter,
    .dataTables_wrapper .dataTables_length {
        text-align: left;
        float: none;
    }
}


/* ── DataTables sorting arrows: one active arrow, no duplicates ───────────── */

/* Убираем новые стрелки DataTables v2 */
.dt-column-order,
.dt-column-order::before,
.dt-column-order::after {
    display: none !important;
}

/* На всякий случай убираем старые (если вдруг подмешались стили) */
table.dataTable thead th::before,
table.dataTable thead th::after {
    display: none !important;
}