/* ============================================================
   LIQUID GLASS THEME
   Blob-градиент + декоративные узоры + liquid glass блоки
   ============================================================ */

/* ---------- CSS-переменные ---------- */
:root {
    /* Акцент */
    --gt-accent:       #7B6FE8;
    --gt-accent-dark:  #5547c8;
    /* Стекло */
    --gt-glass:        rgba(255, 255, 255, 0.18);
    --gt-glass-border: rgba(255, 255, 255, 0.50);
    --gt-glass-hover:  rgba(255, 255, 255, 0.26);
    --gt-border:       rgba(160, 140, 200, 0.20);
    /* Текст */
    --gt-text:         #2c2b4b;
    --gt-muted:        #8a84aa;
    --gt-nav-text:     #2c2b4b;
    /* Геометрия */
    --gt-radius:       20px;
    --gt-radius-sm:    12px;
    --gt-blur:         blur(22px) saturate(180%);
    /* Blob-градиент — управляются theme-picker.js */
    --gt-bg-color:     #e8c8e0;
    --gt-blob1:        rgba(148, 122, 248, 0.82);
    --gt-blob2:        rgba(255, 145, 185, 0.70);
    --gt-blob3:        rgba(255, 190, 125, 0.65);
    --gt-blob4:        rgba(195, 148, 255, 0.55);
    --gt-blob5:        rgba(255, 215, 200, 0.80);
    /* Шум — управляется слайдером */
    --gt-noise-opacity: 0.055;
}

/* ---------- Декоративные кружки SVG (ring-dots паттерн) ---------- */
/* Паттерн 1: мелкие кружки-окружности в сетке */
/* Паттерн 2: крупные полупрозрачные кольца */

/* ---------- Blob mesh gradient + узоры фон ---------- */
/* Шум задаётся через JS как первый слой body background-image (var --gt-noise-url) */

body {
    min-height: 100vh;
    background-color: var(--gt-bg-color);
    background-image:
        /* Шум — canvas PNG с прозрачностью, задаётся через JS */
        var(--gt-noise-url, none),
        /* Верхний левый — кластер точек-кружков (как в примере) */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Ccircle cx='30' cy='40' r='18' fill='none' stroke='rgba(255,255,255,0.22)' stroke-width='1.5'/%3E%3Ccircle cx='70' cy='20' r='10' fill='none' stroke='rgba(255,255,255,0.18)' stroke-width='1.2'/%3E%3Ccircle cx='110' cy='50' r='22' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1.5'/%3E%3Ccircle cx='55' cy='80' r='14' fill='none' stroke='rgba(255,255,255,0.20)' stroke-width='1.2'/%3E%3Ccircle cx='20' cy='110' r='8' fill='none' stroke='rgba(255,255,255,0.16)' stroke-width='1'/%3E%3Ccircle cx='90' cy='115' r='18' fill='none' stroke='rgba(255,255,255,0.13)' stroke-width='1.2'/%3E%3Ccircle cx='140' cy='90' r='12' fill='none' stroke='rgba(255,255,255,0.18)' stroke-width='1'/%3E%3Ccircle cx='45' cy='150' r='20' fill='none' stroke='rgba(255,255,255,0.12)' stroke-width='1.5'/%3E%3Ccircle cx='120' cy='155' r='9' fill='none' stroke='rgba(255,255,255,0.15)' stroke-width='1'/%3E%3Ccircle cx='170' cy='130' r='16' fill='none' stroke='rgba(255,255,255,0.12)' stroke-width='1'/%3E%3C/svg%3E"),
        /* Правый верх — диагональные штрихи-решётка */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='200'%3E%3Cg stroke='rgba(255,255,255,0.13)' stroke-width='1.2' stroke-linecap='round'%3E%3Cline x1='20' y1='0' x2='0' y2='20'/%3E%3Cline x1='50' y1='0' x2='0' y2='50'/%3E%3Cline x1='80' y1='0' x2='0' y2='80'/%3E%3Cline x1='110' y1='0' x2='0' y2='110'/%3E%3Cline x1='140' y1='0' x2='0' y2='140'/%3E%3Cline x1='170' y1='0' x2='0' y2='170'/%3E%3Cline x1='200' y1='0' x2='30' y2='170'/%3E%3Cline x1='220' y1='10' x2='60' y2='170'/%3E%3Cline x1='220' y1='40' x2='90' y2='170'/%3E%3Cline x1='220' y1='70' x2='120' y2='170'/%3E%3Cline x1='220' y1='100' x2='150' y2='170'/%3E%3Cline x1='220' y1='130' x2='180' y2='170'/%3E%3C/g%3E%3C/svg%3E"),
        /* Нижний правый — сетка точек */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Ccircle cx='20' cy='180' r='2.5' fill='rgba(255,255,255,0.20)'/%3E%3Ccircle cx='50' cy='190' r='1.8' fill='rgba(255,255,255,0.16)'/%3E%3Ccircle cx='80' cy='175' r='2.2' fill='rgba(255,255,255,0.18)'/%3E%3Ccircle cx='110' cy='188' r='1.5' fill='rgba(255,255,255,0.14)'/%3E%3Ccircle cx='140' cy='178' r='2.8' fill='rgba(255,255,255,0.20)'/%3E%3Ccircle cx='170' cy='192' r='1.8' fill='rgba(255,255,255,0.15)'/%3E%3Ccircle cx='35' cy='160' r='1.8' fill='rgba(255,255,255,0.14)'/%3E%3Ccircle cx='65' cy='150' r='2.5' fill='rgba(255,255,255,0.18)'/%3E%3Ccircle cx='95' cy='162' r='1.5' fill='rgba(255,255,255,0.12)'/%3E%3Ccircle cx='125' cy='155' r='2' fill='rgba(255,255,255,0.16)'/%3E%3Ccircle cx='155' cy='165' r='2.5' fill='rgba(255,255,255,0.14)'/%3E%3Ccircle cx='185' cy='158' r='1.8' fill='rgba(255,255,255,0.12)'/%3E%3Ccircle cx='20' cy='135' r='1.5' fill='rgba(255,255,255,0.10)'/%3E%3Ccircle cx='55' cy='128' r='2' fill='rgba(255,255,255,0.12)'/%3E%3Ccircle cx='90' cy='138' r='1.8' fill='rgba(255,255,255,0.10)'/%3E%3Ccircle cx='120' cy='130' r='1.5' fill='rgba(255,255,255,0.12)'/%3E%3Ccircle cx='150' cy='140' r='2' fill='rgba(255,255,255,0.10)'/%3E%3Ccircle cx='180' cy='132' r='1.5' fill='rgba(255,255,255,0.10)'/%3E%3C/svg%3E"),
        /* Левый низ — крупные кольца */
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Ccircle cx='60' cy='200' r='55' fill='none' stroke='rgba(255,255,255,0.10)' stroke-width='1.5'/%3E%3Ccircle cx='60' cy='200' r='38' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='1'/%3E%3Ccircle cx='60' cy='200' r='22' fill='none' stroke='rgba(255,255,255,0.12)' stroke-width='1.2'/%3E%3Ccircle cx='180' cy='80' r='40' fill='none' stroke='rgba(255,255,255,0.08)' stroke-width='1'/%3E%3Ccircle cx='180' cy='80' r='24' fill='none' stroke='rgba(255,255,255,0.10)' stroke-width='1'/%3E%3C/svg%3E"),
        /* Blob gradients — цвета через CSS-переменные */
        radial-gradient(ellipse 75% 65% at 10% 10%, var(--gt-blob1) 0%, transparent 52%),
        radial-gradient(ellipse 62% 58% at 90% 6%,  var(--gt-blob2) 0%, transparent 50%),
        radial-gradient(ellipse 68% 72% at 75% 82%, var(--gt-blob3) 0%, transparent 55%),
        radial-gradient(ellipse 60% 55% at 15% 85%, var(--gt-blob4) 0%, transparent 50%),
        radial-gradient(ellipse 95% 95% at 50% 45%, var(--gt-blob5) 0%, transparent 70%);
    background-size:
        256px 256px,
        260px 260px,
        220px 200px,
        200px 200px,
        240px 240px,
        cover, cover, cover, cover, cover;
    background-position:
        0 0,
        -20px -20px,
        calc(100% + 10px) -10px,
        calc(100% + 10px) calc(100% + 10px),
        -20px calc(100% + 20px),
        center, center, center, center, center;
    background-repeat:
        repeat,
        no-repeat,
        no-repeat,
        no-repeat,
        no-repeat,
        no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
    background-attachment: fixed;
    color: var(--gt-text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---------- Навигация — liquid glass ---------- */
.navbar.bg-primary,
.navbar.navbar-dark.bg-primary {
    background: rgba(255, 255, 255, 0.18) !important;
    backdrop-filter: blur(18px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(18px) saturate(160%) !important;
    box-shadow:
        0 1px 0 rgba(255,255,255,0.45),
        0 4px 20px rgba(100, 80, 180, 0.08) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.38) !important;
}

.navbar-brand {
    color: var(--gt-nav-text) !important;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.01em;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(44, 43, 75, 0.65) !important;
    font-size: 0.855rem;
    font-weight: 500;
    transition: color 0.15s;
}
.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: var(--gt-nav-text) !important;
}

/* ---------- Liquid Glass карточки ---------- */
.card {
    background: var(--gt-glass) !important;
    backdrop-filter: var(--gt-blur) !important;
    -webkit-backdrop-filter: var(--gt-blur) !important;
    border: 1px solid var(--gt-glass-border) !important;
    border-radius: var(--gt-radius) !important;
    box-shadow:
        /* внешняя тень */
        0 8px 32px rgba(100, 80, 200, 0.12),
        0 2px 8px  rgba(100, 80, 200, 0.08),
        /* highlight верхний край (блик стекла) */
        inset 0 1px 0 rgba(255, 255, 255, 0.65),
        /* нижний внутренний — темнее */
        inset 0 -1px 0 rgba(255, 255, 255, 0.15) !important;
    transition: box-shadow 0.2s, background 0.2s;
}
.card:hover {
    background: var(--gt-glass-hover) !important;
    box-shadow:
        0 12px 40px rgba(100, 80, 200, 0.16),
        0 3px 10px  rgba(100, 80, 200, 0.10),
        inset 0 1px 0 rgba(255, 255, 255, 0.70),
        inset 0 -1px 0 rgba(255, 255, 255, 0.18) !important;
}

.card-header {
    background: rgba(255, 255, 255, 0.28) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35) !important;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: calc(var(--gt-radius) - 1px) calc(var(--gt-radius) - 1px) 0 0 !important;
    backdrop-filter: blur(4px);
}

/* ---------- Кнопки ---------- */
.btn-primary {
    background: linear-gradient(135deg, rgba(123,111,232,0.85) 0%, rgba(85,71,200,0.90) 100%) !important;
    border: 1px solid rgba(255,255,255,0.30) !important;
    border-radius: 999px !important;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow:
        0 2px 10px rgba(123,111,232,0.40),
        inset 0 1px 0 rgba(255,255,255,0.30) !important;
    backdrop-filter: blur(8px);
    transition: all 0.18s !important;
}
.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, rgba(142,131,240,0.90) 0%, rgba(123,111,232,0.92) 100%) !important;
    box-shadow:
        0 4px 16px rgba(123,111,232,0.50),
        inset 0 1px 0 rgba(255,255,255,0.35) !important;
}

.btn-outline-primary {
    color: var(--gt-accent) !important;
    border: 1px solid rgba(123,111,232,0.50) !important;
    border-radius: 999px !important;
    font-weight: 600;
    background: rgba(255,255,255,0.28) !important;
    backdrop-filter: blur(8px);
    transition: all 0.18s !important;
}
.btn-outline-primary:hover {
    background: rgba(123,111,232,0.85) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.btn-secondary {
    border-radius: 999px !important;
    background: rgba(255,255,255,0.30) !important;
    border: 1px solid rgba(255,255,255,0.50) !important;
    color: var(--gt-text) !important;
    font-weight: 600;
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.50) !important;
}

.btn-success {
    border-radius: 999px !important;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.25) !important;
}

.btn-danger {
    border-radius: 999px !important;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.20) !important;
}

/* ---------- Таблицы — полностью прозрачные, под стекло ---------- */
.table {
    color: var(--gt-text);
    --bs-table-bg: transparent;
    --bs-table-striped-bg: transparent;
    --bs-table-hover-bg: transparent;
    --bs-table-border-color: rgba(255,255,255,0.22);
}
/* Убираем любой фон у ячеек по умолчанию */
.table > :not(caption) > * > * {
    background-color: transparent !important;
    border-color: rgba(255,255,255,0.18) !important;
}
/* Заголовок таблицы */
.table thead th,
.table > thead > tr > th {
    background: rgba(255,255,255,0.12) !important;
    color: var(--gt-muted) !important;
    font-weight: 600;
    font-size: 0.82rem;
    border-bottom: 1px solid rgba(255,255,255,0.28) !important;
    letter-spacing: 0.01em;
}
/* Чётные строки — едва заметный тинт */
.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255,255,255,0.06) !important;
}
.table-striped > tbody > tr:nth-of-type(even) > * {
    background-color: transparent !important;
}
/* Hover */
.table-hover > tbody > tr:hover > * {
    background-color: rgba(255,255,255,0.16) !important;
}
/* table-light (используется в некоторых заголовках) */
.table-light,
.table > :not(caption) > * > .table-light {
    background-color: rgba(255,255,255,0.12) !important;
    color: var(--gt-muted) !important;
}
.table-primary {
    --bs-table-bg: transparent;
    background-color: rgba(123,111,232,0.10) !important;
    color: var(--gt-text) !important;
}
.table-primary td, .table-primary th {
    color: var(--gt-text) !important;
    background-color: transparent !important;
}
.table-danger  { background-color: rgba(220, 50,  80,  0.08) !important; --bs-table-bg: transparent; }
.table-success { background-color: rgba(40,  160, 100, 0.08) !important; --bs-table-bg: transparent; }
.table-info    { background-color: rgba(80,  130, 200, 0.08) !important; --bs-table-bg: transparent; }
.table-warning { background-color: rgba(210, 150, 30,  0.08) !important; --bs-table-bg: transparent; }

/* ---------- Badges ---------- */
.badge.bg-primary {
    background: linear-gradient(135deg, var(--gt-accent) 0%, var(--gt-accent-dark) 100%) !important;
    border-radius: 999px !important;
    font-weight: 600;
    padding: 0.35em 0.65em;
    box-shadow: 0 1px 4px rgba(123,111,232,0.30);
}

/* ---------- Nav tabs — liquid pill style ---------- */
.nav-tabs {
    border-bottom: none !important;
    gap: 5px;
    flex-wrap: wrap;
}
.nav-tabs .nav-link {
    border: 1px solid rgba(255,255,255,0.45) !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.22) !important;
    color: var(--gt-text) !important;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 1rem;
    transition: all 0.18s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 2px 6px rgba(100,80,180,0.06),
        inset 0 1px 0 rgba(255,255,255,0.55);
}
.nav-tabs .nav-link:hover {
    background: rgba(255,255,255,0.40) !important;
    color: var(--gt-accent) !important;
    border-color: rgba(255,255,255,0.60) !important;
}
.nav-tabs .nav-link.active {
    background: linear-gradient(135deg, rgba(123,111,232,0.82) 0%, rgba(85,71,200,0.88) 100%) !important;
    border-color: rgba(255,255,255,0.25) !important;
    color: #fff !important;
    box-shadow:
        0 3px 10px rgba(123,111,232,0.38),
        inset 0 1px 0 rgba(255,255,255,0.30) !important;
}

/* ---------- Цветные карточки-метрики ---------- */
.card.border-primary { border-color: rgba(123,111,232,0.40) !important; }
.card.border-success { border-color: rgba(40, 160,100, 0.35) !important; }
.card.border-danger  { border-color: rgba(220, 50, 80, 0.35) !important; }
.card.border-info    { border-color: rgba(80, 130,200, 0.35) !important; }
.card.border-warning { border-color: rgba(210,150, 30, 0.35) !important; }

/* ---------- Семантические цвета — читаемые на градиентном фоне ---------- */
.text-primary   { color: var(--gt-accent-dark, #5547c8) !important; }
.text-info      { color: #2563a8 !important; }
.text-success   { color: #1a7a4a !important; }
.text-danger    { color: #c0284a !important; }
.text-warning   { color: #b85c00 !important; }
.text-secondary { color: #5a5480 !important; }
.text-muted     { color: #6b6490 !important; }

.badge.bg-primary  { background-color: var(--gt-accent, #7B6FE8) !important; color: #fff !important; }
.badge.bg-info     { background-color: #2563a8 !important; color: #fff !important; }
.badge.bg-success  { background-color: #1a7a4a !important; color: #fff !important; }
.badge.bg-danger   { background-color: #c0284a !important; color: #fff !important; }
.badge.bg-warning  { background-color: #b85c00 !important; color: #fff !important; }
.badge.bg-secondary{ background-color: #5a5480 !important; color: #fff !important; }

/* ---------- Аккордеон — liquid glass ---------- */
.accordion-item {
    border: 1px solid rgba(255,255,255,0.45) !important;
    border-radius: var(--gt-radius-sm) !important;
    margin-bottom: 6px;
    overflow: hidden;
    background: rgba(255,255,255,0.16) !important;
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow:
        0 2px 10px rgba(100,80,180,0.08),
        inset 0 1px 0 rgba(255,255,255,0.55);
}
.accordion-button {
    background: rgba(255,255,255,0.20) !important;
    color: var(--gt-text) !important;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: none !important;
    border-radius: var(--gt-radius-sm) !important;
}
.accordion-button:not(.collapsed) {
    background: rgba(123,111,232,0.12) !important;
    color: var(--gt-accent) !important;
}
.accordion-button::after {
    filter: invert(30%) sepia(20%) saturate(600%) hue-rotate(220deg);
}
.accordion-body {
    background: rgba(255,255,255,0.10);
}

/* ---------- Формы ---------- */
.form-control,
.form-select {
    background: rgba(255,255,255,0.35) !important;
    border: 1px solid rgba(255,255,255,0.55) !important;
    border-radius: var(--gt-radius-sm) !important;
    color: var(--gt-text);
    backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45) !important;
}
.form-control:focus,
.form-select:focus {
    border-color: rgba(123,111,232,0.70) !important;
    background: rgba(255,255,255,0.55) !important;
    box-shadow:
        0 0 0 3px rgba(123,111,232,0.15),
        inset 0 1px 0 rgba(255,255,255,0.55) !important;
}

/* ---------- Модалки — liquid glass ---------- */
.modal-content {
    border-radius: var(--gt-radius) !important;
    border: 1px solid rgba(255,255,255,0.50) !important;
    background: rgba(255,255,255,0.30) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    box-shadow:
        0 24px 64px rgba(80,60,160,0.22),
        inset 0 1px 0 rgba(255,255,255,0.65) !important;
}
.modal-header {
    background: rgba(255,255,255,0.25) !important;
    border-bottom: 1px solid rgba(255,255,255,0.35) !important;
    border-radius: calc(var(--gt-radius) - 1px) calc(var(--gt-radius) - 1px) 0 0 !important;
}
.modal-footer {
    border-top: 1px solid rgba(255,255,255,0.30) !important;
    background: rgba(255,255,255,0.15) !important;
}

/* ---------- Alerts ---------- */
.alert {
    border-radius: var(--gt-radius-sm) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.40) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.50);
}
.alert-success { background: rgba(40,160,100, 0.18) !important; }
.alert-danger   { background: rgba(220,50, 80,  0.16) !important; }
.alert-warning  { background: rgba(210,150,30,  0.16) !important; }
.alert-info     { background: rgba(123,111,232, 0.14) !important; }

/* ---------- Заголовки страниц ---------- */
h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--gt-text);
}
h1 { font-size: 2.4rem; }

/* ---------- Scrollbar (Webkit) ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35);
    border-radius: 3px;
    backdrop-filter: blur(4px);
}
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.55); }
