/* cal-filters.css — 4 дропдауна, навигация по неделям, таблица */

/* ── Filters-bar: 4 равных колонки ── */
.filters-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 10px 0 0;
    background: transparent;
    border: none;
    overflow: visible;  /* дропдауны должны выходить за пределы */
}

.filter-col {
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ── Обёртка кастомного дропдауна ── */
.flt-select {
    position: relative;
    width: 100%;
}

/* ── Единая кнопка-триггер для кастомных дропдаунов ── */
.flt-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 34px;
    padding: 0 10px;
    background: var(--flt-bg);
    border: 1px solid var(--flt-border);
    border-radius: var(--r);
    color: var(--text2);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    gap: 6px;
    transition: border-color 0.15s, color 0.15s;
}
.flt-trigger:hover                          { border-color: var(--green); color: var(--text); }
.flt-trigger[aria-expanded="true"]          { border-color: var(--green); color: var(--green); }
.flt-trigger[aria-expanded="true"] .flt-chevron { transform: rotate(180deg); color: var(--green); }

/* Шеврон (используется в кастомных дропдаунах и lang-select) */
.flt-chevron {
    color: var(--text3);
    flex-shrink: 0;
    transition: transform 0.2s, color 0.2s;
}

/* ── Нативный select (Язык) — стилизован под flt-trigger ── */
.lang-select {
    position: relative;
    display: flex;
    width: 100%;
}
.lang-select select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 34px;
    padding: 0 28px 0 10px;
    background: var(--flt-bg);
    border: 1px solid var(--flt-border);
    border-radius: var(--r);
    color: var(--text2);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, color 0.15s;
}
.lang-select select:hover,
.lang-select select:focus    { border-color: var(--green); color: var(--text); }
.lang-select select option   { background: var(--surface2); }
.lang-select .flt-chevron {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* ── Базовый выпадающий список ── */
.flt-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 100%;
    z-index: 300;
    padding: 6px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--r-lg);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
    display: flex;
    flex-direction: column;
    gap: 3px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-4px);
    transform-origin: top left;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.flt-dropdown.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* 2-колоночная сетка (UTC, Currencies) */
.flt-dropdown--grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    min-width: 180px;
}

/* ── Кнопки UTC-зон ── */
.utc-opt {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text2);
    font-family: var(--mono);
    font-size: 12px;
    padding: 6px 4px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
    transition: background 0.1s, color 0.1s, border-color 0.1s;
}
.utc-opt:hover     { background: var(--surface3); color: var(--text); }
.utc-opt--active   { background: var(--surface3); border-color: var(--green); color: var(--green); font-weight: 500; }
.utc-opt--zero {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    border-left-color: transparent;
    border-right-color: transparent;
    border-radius: 0;
    margin: 1px 0;
}

/* ── Пилюли важности внутри дропдауна ── */
.cb-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 20px;
    border: 1px solid var(--border2);
    background: var(--surface3);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    user-select: none;
    white-space: nowrap;
    width: 100%;
    position: relative;
    transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}
.cb-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* High / Medium */
.cb-impact-pill { opacity: 0.45; color: var(--text2); }
.cb-impact-pill.is-checked { opacity: 1; border-color: var(--green); color: var(--text); }
.cb-impact-pill:hover { opacity: 1; border-color: var(--text2); }

/* Low — заблокирован */
.cb-impact-locked { opacity: 1; border-color: var(--border2); color: var(--text2); cursor: pointer; }
.cb-impact-locked::after { content: "🔒"; font-size: 10px; margin-left: auto; opacity: 0.4; }

/* ── Валюты внутри dropdown--currencies ── */
.flt-dropdown--currencies .cb-pill {
    padding: 6px 4px;
    font-size: 12px;
    justify-content: center;
}

/* free (USD, EUR, GBP, CAD) */
.cb-free { opacity: 0.45; color: var(--text2); border-color: var(--border2); }
.cb-free.is-checked { opacity: 1; border-color: var(--green); color: var(--text); }
.cb-free:hover { opacity: 1; border-color: var(--text2); }

/* pro (CHF, JPY, AUD, NZD) — блюр */
.cb-pro { filter: blur(2.5px); opacity: 0.35; pointer-events: auto; }
.cb-pro:hover { opacity: 0.5; filter: blur(1.5px); }

/* ── Навигация по неделям ── */
#week-nav-wrap { padding: 10px 0 12px; }

.week-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.week-arrow {
    flex-shrink: 0;
    align-self: stretch;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: var(--r);
    color: var(--text2);
    font-size: 12px;
    font-family: var(--mono);
    padding: 0 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, color 0.15s;
}
.week-arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.week-arrow:disabled              { opacity: 0.25; cursor: not-allowed; }

.day-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    justify-content: center;
    overflow-x: auto;
}

.day-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 14px;
    border-radius: var(--r);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text2);
    cursor: pointer;
    font-family: var(--sans);
    font-size: 12px;
    white-space: nowrap;
    min-width: 58px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.day-tab:hover:not(.day-tab--past) { background: var(--surface2); border-color: var(--border2); color: var(--text); }

.day-name { font-weight: 500; font-size: 12px; }
.day-date { font-family: var(--mono); font-size: 11px; color: var(--text3); }

.day-tab--today              { border-color: rgba(46,196,182,0.3); }
.day-tab--today .day-name    { color: var(--green); font-weight: 600; }
.day-tab--today .day-date    { color: var(--green); opacity: 0.7; }

.day-tab--active             { background: var(--surface3); border-color: var(--accent); color: var(--text); }
.day-tab--active .day-name   { color: var(--accent); font-weight: 600; }
.day-tab--active .day-date   { color: var(--accent); opacity: 0.7; }

.day-tab--past               { opacity: 0.25; cursor: not-allowed; pointer-events: none; }

/* ── Таблица ── */
.table-wrap {
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    background: var(--surface);
    overflow-x: auto;
    margin-top: 21px;
}

table               { width: 100%; border-collapse: collapse; font-size: 13px; }
thead               { background: var(--surface2); border-bottom: 1px solid var(--border2); }
thead th {
    padding: 11px 14px;
    text-align: left;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 500;
    color: var(--text3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

tbody tr            { border-bottom: 1px solid var(--border); transition: background 0.1s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover      { background: var(--surface2); }
tbody td            { padding: 10px 14px; vertical-align: middle; }

.col-time     { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--green); white-space: nowrap; }
.col-country  { color: var(--text2); white-space: nowrap; }
.col-currency { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text2); }
.col-impact   { text-align: center; font-size: 14px; }
.col-event    { color: var(--text); max-width: 340px; }

tr.event-row[data-impact="high"]   { border-left: 2px solid var(--accent); }
tr.event-row[data-impact="medium"] { border-left: 2px solid var(--amber); }
tr.event-row[data-impact="low"]    { border-left: 2px solid var(--border2); }

.no-events-msg {
    padding: 48px 24px;
    text-align: center;
    color: var(--text3);
    font-size: 14px;
    font-family: var(--mono);
}
