/* ==========================================================================
   STREAM.MARKET — ПОЛНЫЙ ЦЕНТРАЛЬНЫЙ СТИЛЬ (CYBERPUNK GLASSMORPHISM)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;600;800&display=swap');


:root {
    --bg-main: #06040a;               /* Глубокий космический черный */
    --bg-glass: rgba(18, 14, 31, 0.75); /* Полупрозрачное матовое стекло */
    --bg-input: #120f24;              /* Контрастный матовый фон для полей */
    --border-flat: #241f3b;           /* Четкие плоские границы элементов */
    --border-glass: rgba(157, 78, 221, 0.15); /* Тонкая фиолетовая кайма */
    --border-active: rgba(0, 180, 216, 0.5);  /* Синяя кайма при фокусе */
    
    --text-white: #ffffff;
    --text-muted: #9590b2;            /* Приглушенный текст для описаний */
    
    /* Неоновые индикаторы */
    --neon-purple: #9d4edd;           /* Фиолетовый для кнопок */
    --neon-blue: #00b4d8;             /* Бирюзово-синий для акцентов */
    --crypto-green: #06d6a0;          /* Зеленый для цен и баланса */
    --neon-red: #ff4d6d;              /* Красный для ошибок и статуса OFF */
    
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(circle at 80% 20%, rgba(157, 78, 221, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 10% 80%, rgba(0, 180, 216, 0.06) 0%, transparent 40%);
    color: var(--text-white);
    font-family: 'Plus Jakarta Sans', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Обертка контента */
.main-wrapper {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* Стеклянный Header с размытием */
.neon-header {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-glass);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.neon-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-white);
    text-decoration: none;
    letter-spacing: 0.5px;
}

.neon-logo span {
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(0, 180, 216, 0.5);
}

.neon-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.neon-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition-smooth);
}

.neon-nav a:hover {
    color: var(--text-white);
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Виджет баланса */
.balance-nav {
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    padding: 6px 14px;
    border-radius: 8px;
}

.neon-green-text {
    color: var(--crypto-green);
    font-weight: 600;
    text-shadow: 0 0 10px rgba(6, 214, 160, 0.3);
}

/* Колокольчик */
.neon-bell-wrapper {
    position: relative;
    display: inline-block;
}

.neon-bell {
    font-size: 18px;
    text-decoration: none;
    cursor: pointer;
}

.bell-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    background: var(--neon-purple);
    color: var(--text-white);
    font-size: 10px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 20px;
    box-shadow: 0 0 8px var(--neon-purple);
}

.logout-btn {
    color: var(--neon-red) !important;
    font-weight: 500;
}
/* Стеклянные карточки/панели интерфейса (Glassmorphism) */
.admin-card {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* 1. ПОЛНОСТЬЮ КАСТОМНЫЙ ВЫПАДАЮЩИЙ СПИСОК (ПОД ВАШ СКРИНШОТ) */
.custom-select-wrapper {
    position: relative;
    width: 100%;
    user-select: none;
}

.custom-select-trigger {
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    padding: 12px 40px 12px 14px;
    border-radius: 8px;
    color: var(--text-white);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition-smooth);
}

/* Неоновая бирюзовая рамка при раскрытии как на скрине */
.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--neon-blue);
    box-shadow: 0 0 10px rgba(0, 180, 216, 0.2);
}

/* Стрелочка внутри селекта */
.custom-select-trigger:after {
    position: absolute;
    content: "";
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 0; height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    transition: var(--transition-smooth);
}
.custom-select-wrapper.open .custom-select-trigger:after {
    transform: translateY(-50%) rotate(180deg);
    border-top-color: var(--neon-blue);
}

/* Выпадающее меню (Списочная часть как на скрине) */
.custom-options-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0; right: 0;
    background: #0f0b1e; /* Темный матовый фон */
    border: 1px solid var(--neon-blue); /* Бирюзовый контур */
    border-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    z-index: 1100;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: var(--transition-smooth);
}

/* Плавное раскрытие меню */
.custom-select-wrapper.open .custom-options-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Элементы списка опций */
.custom-option-item {
    padding: 12px 14px;
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.custom-option-item:hover {
    background: rgba(0, 180, 216, 0.1);
    color: var(--text-white);
}
.custom-option-item.selected {
    background: rgba(123, 44, 191, 0.2); /* Фиолетовый маркер активного */
    color: var(--text-white);
    font-weight: 600;
}

/* Стильный тонкий скроллбар для меню как на скрине */
.custom-options-menu::-webkit-scrollbar {
    width: 6px;
}
.custom-options-menu::-webkit-scrollbar-track {
    background: transparent;
}
.custom-options-menu::-webkit-scrollbar-thumb {
    background: var(--border-glass);
    border-radius: 4px;
}
.custom-options-menu::-webkit-scrollbar-thumb:hover {
    background: var(--neon-blue);
}

/* 2. ЗОНА ИНФОРМАЦИИ О КОМИССИЯХ БИРЖИ */
.commission-info-panel {
    background: rgba(6, 214, 160, 0.03);
    border: 1px dashed rgba(6, 214, 160, 0.2);
    padding: 14px;
    border-radius: 8px;
    margin-top: 5px;
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 3. КНОПКИ ВЫБОРА ПЕРИОДА ТЕСТА (ВЗАМЕН РАДИОКНОПОК) */
.test-btn-group { 
    display: flex; 
    gap: 12px; 
    margin-top: 4px; 
}
.test-tab-btn {
    flex: 1; 
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-glass);
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 14px; 
    font-weight: 600;
    text-align: center; 
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}
.test-tab-btn:hover {
    border-color: rgba(0, 180, 216, 0.3);
    color: var(--text-white);
}
.test-tab-btn.active {
    border-color: var(--neon-blue);
    color: var(--text-white);
    background: rgba(0, 180, 216, 0.05);
    box-shadow: 0 0 12px rgba(0, 180, 216, 0.15);
}

/* 4. ЗОНА ЗАГРУЗКИ M3U */
.file-upload-zone {
    position: relative;
    background: var(--bg-input);
    border: 1px dashed var(--border-glass);
    padding: 22px;
    border-radius: 8px;
    text-align: center; 
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.file-upload-zone:hover { 
    border-color: var(--border-active);
}
.file-upload-zone input[type="file"] {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.file-name-text { 
    color: var(--neon-blue); 
    font-weight: 600; 
    margin-top: 6px; 
    font-size: 13px;
    display: none;
}

/* 5. КЛАССЫ ДЛЯ ПЛАВНОГО РАЗДВИЖЕНИЯ (JS АНИМАЦИЯ) */
.expandable-block {
    max-height: 0; 
    overflow: hidden; 
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin-top 0.3s ease;
    display: flex; 
    flex-direction: column; 
    gap: 8px;
}
.expandable-block.show { 
    opacity: 1; 
    margin-top: 12px; 
}

/* ==========================================================================
   ТОЧНАЯ КОПИЯ ТУМБЛЕРА ИЗ СКРИНШОТА (НЕОНОВЫЙ КОНТУР И ЦВЕТНОЙ БЕГУНОК)
   ========================================================================== */

.switch-box {
    position: relative;
    display: inline-block;
    width: 48px;  /* Пропорции плашки со скриншота */
    height: 24px;
    user-select: none;
}

.switch-box input { 
    opacity: 0; width: 0; height: 0; 
}

/* СОСТОЯНИЕ OFF (По умолчанию): Черный фон, красная неоновая обводка */
.slider-neon {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #06040a; /* Глубокий черный фон плашки */
    border: 1px solid #ff4d6d; /* Обводка горит неоновым красным */
    box-shadow: 0 0 6px rgba(255, 77, 109, 0.2); /* Легкое красное свечение контура */
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 24px;
}

/* Бегунок в состоянии OFF: Ярко-красный круг */
.slider-neon:before {
    position: absolute;
    content: "";
    height: 16px; 
    width: 16px;
    left: 4px; 
    bottom: 3px;
    background-color: #ff4d6d; /* Бегунок горит красным */
    box-shadow: 0 0 6px rgba(255, 77, 109, 0.4);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

/* СОСТОЯНИЕ ON: Черный фон сохраняется, обводка переключается на зеленый */
.switch-box input:checked + .slider-neon {
    background-color: #06040a; /* Фон остается черным, как на скрине */
    border-color: #00cc11;      /* Обводка горит неоновым зеленым */
    box-shadow: 0 0 6px rgba(0, 204, 17, 0.2); /* Легкое зеленое свечение контура */
}

/* Бегунок в состоянии ON: Смещается вправо и загорается ярко-зеленым */
.switch-box input:checked + .slider-neon:before {
    background-color: #00cc11; /* Бегунок становится зеленым в точности как на скрине */
    box-shadow: 0 0 6px rgba(0, 204, 17, 0.4);
    transform: translateX(22px); /* Точное плавное смещение */
}

/* Минималистичный плоский подвал */
.neon-footer {
    background: transparent;
    border-top: 1px solid var(--border-flat);
    padding: 20px;
    margin-top: auto;
}
.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
}
.footer-brand { color: var(--text-white); font-weight: 600; }
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s ease; }
.footer-links a:hover { color: var(--neon-blue); }

/* Скрытие дефолтных стрелочек вверх-вниз в числовых полях ввода */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield; /* Для браузеров Firefox */
}
/* Изолированные цвета элементов внутри текстового информера предупреждений */
.inf-text-red { color: var(--neon-red) !important; }
.inf-val-green { color: var(--crypto-green) !important; font-weight: 700; text-shadow: 0 0 6px rgba(6, 214, 160, 0.3); }
.inf-bal-white { color: #ffffff !important; font-weight: 600; }


/* ==========================================================================
   УСИЛЕННАЯ ЧЕТКОСТЬ, КОНТРАСТ ГРАНИЦ И НЕОНОВАЯ ФИКСАЦИЯ СТРОК ТАБЛИЦ
   ========================================================================== */

/* Базовые параметры строк — добавляем pointer и плавные переходы */
.stream-item-row {
    cursor: pointer;
    background: transparent;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Мягкая подсветка при наведении курсора */
.stream-item-row:hover {
    background-color: rgba(0, 180, 216, 0.02) !important;
}

/* ИСПРАВЛЕНО: Четкие, контрастные и видимые границы между ячейками таблицы */
#streams_table th, 
#streams_table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important; /* Тонкая, но четкая светящаяся линия */
    border-right: 1px solid rgba(255, 255, 255, 0.03) !important;  /* Едва заметный вертикальный разделитель */
}

/* Убираем правый бордюр у последней колонки, чтобы не ломать геометрию */
#streams_table th:last-child, 
#streams_table td:last-child {
    border-right: none !important;
}

/* Шапка таблицы — делаем разметку разделения плотнее и четче */
#streams_table producers, 
#streams_table thead tr {
    background: rgba(18, 14, 34, 0.8) !important;
    border-bottom: 2px solid rgba(0, 180, 216, 0.4) !important; /* Четкая бирюзовая линия под шапкой */
}

/* ИСПРАВЛЕНО: Премиальная жесткая фиксация строки при клике по референсу */
.stream-item-row.selected-row {
    background-color: rgba(0, 180, 216, 0.07) !important;
    position: relative;
    /* Контур и неоновое свечение в точности как на вашем скриншоте */
    box-shadow: inset 0 0 0 1px #00b4d8, 0 0 15px rgba(0, 180, 216, 0.35) !important;
}

/* Подкрашиваем бордюры внутри выделенной строки, чтобы они не спорили с неоновым контуром */
.stream-item-row.selected-row td {
    border-bottom-color: transparent !important;
}

.p2p-policy-bar {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    background: rgba(24, 18, 43, 0.96) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    z-index: 999999 !important;
    padding: 14px 0 !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.6) !important;
    box-sizing: border-box !important;
}

.p2p-policy-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 20px !important;
    box-sizing: border-box !important;
}

.p2p-policy-text {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
    font-weight: 500 !important;
    text-align: left !important;
    font-family: sans-serif !important;
    flex: 1 !important;
}

.p2p-policy-link,
.p2p-policy-link:link,
.p2p-policy-link:visited {
    color: #00b4d8 !important; /* Базовый неоновый голубой */
    text-decoration: none !important;
    font-weight: 700 !important;
    border-bottom: 1px dashed rgba(0, 180, 216, 0.4) !important;
    display: inline !important;
    transition: all 0.2s ease !important; /* Плавный переход, как в меню */
}

/* ИСПРАВЛЕНО: Эффект при наведении полностью скопирован с вашей навигационной панели */
.p2p-policy-link:hover {
    color: var(--text-white, #ffffff) !important; /* Перекрашивается в белый */
    border-bottom-color: transparent !important;
    text-shadow: 0 0 10px rgba(0, 180, 216, 0.8), 0 0 20px rgba(0, 180, 216, 0.4) !important; /* Неоновое свечение */
    opacity: 1 !important;
}

.p2p-policy-btn,
.p2p-policy-btn:link,
.p2p-policy-btn:visited {
    background: rgba(6, 214, 160, 0.12) !important;
    border: 1px solid rgba(6, 214, 160, 0.4) !important;
    color: #06d6a0 !important;
    padding: 8px 24px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    white-space: nowrap !important;
    display: inline-block !important;
    text-align: center !important;
    font-family: sans-serif !important;
    transition: all 0.2s ease !important;
}

.p2p-policy-btn:hover {
    background: #06d6a0 !important;
    color: #1a1630 !important;
    box-shadow: 0 0 12px rgba(6, 214, 160, 0.4) !important;
}

@media (max-width: 768px) {
    .p2p-policy-container {
        flex-direction: column !important;
        text-align: center !important;
        gap: 12px !important;
    }
    .p2p-policy-text {
        text-align: center !important;
        font-size: 12px !important;
    }
    .p2p-policy-btn {
        width: 100% !important;
    }
}

/* Отключаем стандартный белый/желтый фон Chromium для автозаполнения */
    .admin-card input:-webkit-autofill,
    .admin-card input:-webkit-autofill:hover, 
    .admin-card input:-webkit-autofill:focus,
    .admin-card input:-webkit-autofill:active {
        -webkit-box-shadow: 0 0 0 1000px var(--bg-input) inset !important;
        -webkit-text-fill-color: var(--text-white) !important;
        transition: background-color 5000s ease-in-out 0s;
    }





@media (min-width: 992px) {
    .lang-switcher-container:hover .lang-dropdown {
        display: block !important;
        animation: fadeInLang 0.12s ease-out;
    }
    .lang-switcher-container:hover .lang-current {
        background: rgba(255, 255, 255, 0.06) !important;
        border-color: #00b4d8 !important;
        box-shadow: 0 0 10px rgba(0, 180, 216, 0.2);
    }
    .lang-switcher-container:hover .lang-arrow {
        transform: rotate(180deg);
        color: #00b4d8 !important;
    }
}
@keyframes fadeInLang {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}




.bshow { 
    opacity: 1; 
    transition: 0.3s ease; 
    text-align: right;
} 
.bhide { 
    opacity: 0; 
    transition: 0.3s ease; 
    text-align: right;
}
