@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@400;600;700&display=swap');

:root {
    --bg: #050505;
    --primary: #ff00ff;
    --cyan: #00ffff;
    --glass: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.15);
}

body {
    background: var(--bg);
    background-image: radial-gradient(circle at 50% 10%, #220022 0%, #050505 60%);
    color: white;
    font-family: 'Rajdhani', sans-serif;
    margin: 0; padding: 0;
    height: 100vh;
    overflow: hidden;
}

.hidden { display: none !important; }

/* Loader */
.screen-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg); z-index: 2000;
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
}
.spinner {
    width: 50px; height: 50px; border: 3px solid var(--primary);
    border-top-color: transparent; border-radius: 50%;
    animation: spin 1s infinite linear;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* Inputs & Selects (Fixing "Ugly Dropdowns") */
.neon-input {
    background: #111; 
    border: 1px solid var(--border);
    color: white; 
    padding: 12px; 
    border-radius: 8px;
    width: 100%; 
    box-sizing: border-box; 
    font-family: inherit; 
    font-size: 1rem;
    outline: none;
    appearance: none; /* Убираем стандартную стрелку браузера */
}
.neon-input:focus { border-color: var(--primary); }

select.neon-input {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23ff00ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right .7em top 50%;
    background-size: .65em auto;
    padding-right: 1.5em;
}

/* App Structure */
#app-container { padding: 20px; height: 100vh; overflow-y: auto; box-sizing: border-box; }

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.profile-chip { display: flex; gap: 10px; align-items: center; background: rgba(255,255,255,0.05); padding: 5px 15px 5px 5px; border-radius: 30px; border: 1px solid var(--border); }
#head-avatar { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--primary); }
.profile-text { line-height: 1.1; }
#head-nick { font-weight: bold; font-size: 0.9rem; }
#head-addr { font-size: 0.7rem; color: #aaa; font-family: monospace; }
.icon-btn { background: none; border: 1px solid var(--border); color: white; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }

.balance-card { text-align: center; margin-bottom: 20px; }
.balance-card h1 { font-size: 2.5rem; margin: 5px 0 20px; text-shadow: 0 0 10px rgba(255,255,255,0.3); }
.label { color: #888; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; }

/* Buttons & Icons */
.actions-row { display: flex; justify-content: space-around; }
.action-item { background: none; border: none; color: white; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; }
.act-icon { 
    width: 50px; height: 50px; 
    background: rgba(255,255,255,0.08); 
    border-radius: 14px; 
    display: flex; align-items: center; justify-content: center; 
    font-size: 1.4rem; 
    transition: 0.2s;
    border: 1px solid transparent;
}
.act-icon i { color: white !important; } /* Force White Icons */
.action-item:active .act-icon { background: var(--primary); border-color: white; }

/* Tabs */
.tabs-nav { display: flex; background: #111; padding: 5px; border-radius: 12px; margin-bottom: 15px; }
.tab-link { flex: 1; background: none; border: none; color: #666; padding: 10px; font-weight: bold; cursor: pointer; border-radius: 8px; transition: 0.3s; }
.tab-link.active { background: #222; color: white; }
.tab-content { display: none; animation: fade 0.3s; }
.tab-content.active { display: block; }
@keyframes fade { from{opacity:0} to{opacity:1} }

/* Assets */
.asset-row { display: flex; justify-content: space-between; align-items: center; padding: 15px; margin-bottom: 10px; background: rgba(255,255,255,0.03); border-radius: 12px; border: 1px solid var(--border); }
.coin-icon { width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: bold; }

/* Charts */
.glass-panel { background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.chart-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.neon-text { color: var(--primary); text-shadow: 0 0 10px var(--primary); }

/* Modals */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 1000; display: flex; align-items: flex-end; }
.bottom-sheet { width: 100%; background: #111; border-top: 1px solid var(--primary); border-radius: 20px 20px 0 0; padding: 25px; box-sizing: border-box; animation: slideUp 0.3s; position: relative; }
@keyframes slideUp { from{transform:translateY(100%)} to{transform:translateY(0)} }

.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close-icon-btn { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 5px; }
.qr-wrapper { background: white; padding: 15px; width: 180px; margin: 0 auto 20px; border-radius: 15px; }
.addr-copier { background: black; padding: 15px; border: 1px solid #333; border-radius: 10px; color: var(--primary); font-family: monospace; display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }

.neon-btn { background: linear-gradient(90deg, #b300b3, var(--primary)); color: white; border: none; padding: 14px; font-weight: bold; font-size: 1.1rem; border-radius: 8px; cursor: pointer; width: 100%; text-transform: uppercase; }
.neon-btn.secondary { background: #333; border: 1px solid #555; }

.input-col { margin-bottom: 15px; }
.input-col label { display: block; font-size: 0.8rem; color: #888; margin-bottom: 5px; }

/* Swap Styles */
.swap-icon-divider { text-align: center; margin: 10px 0; color: var(--cyan); }
.text-btn { background: none; border: none; color: var(--cyan); text-decoration: underline; cursor: pointer; display: block; margin: 0 auto 15px; }

/* Setup */
.glass-modal { background: rgba(20, 20, 20, 0.9); border: 1px solid var(--primary); padding: 30px; border-radius: 20px; text-align: center; width: 80%; }
.avatar-cycler { position: relative; width: 100px; margin: 0 auto 20px; }
#setup-avatar { width: 100px; height: 100px; border-radius: 50%; border: 2px solid var(--primary); }
.cycle-btn { position: absolute; bottom: 0; right: 0; background: var(--cyan); border: none; border-radius: 50%; width: 30px; height: 30px; cursor: pointer; }
/* --- TOAST NOTIFICATIONS (Красивые уведомления) --- */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px; /* Справа сверху */
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(10, 10, 10, 0.95);
    border-left: 4px solid var(--primary);
    border-radius: 4px;
    padding: 15px 20px;
    color: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    opacity: 0;
    transform: translateX(50px);
    animation: slideIn 0.3s forwards;
}

.toast.error { border-left-color: #ff0033; }
.toast.success { border-left-color: #00ff88; }
.toast.warning { border-left-color: #ffaa00; }

.toast-icon { font-size: 1.2rem; }

@keyframes slideIn {
    to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateY(-20px); }
}

/* Фикс для иконок в кнопках (на твоем скрине их не было) */
.act-icon i {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900;
    color: white;
}

/* --- CUSTOM DROPDOWNS (Вместо стандартных Select) --- */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 100%;
}

.custom-select {
    position: relative;
    display: flex;
    flex-direction: column;
}

.custom-select__trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    font-size: 1rem;
    font-weight: bold;
    color: #fff;
    background: #111;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}

.custom-select__trigger:hover {
    border-color: var(--primary);
}

.custom-select-wrapper.open .custom-select__trigger {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-color: var(--primary);
}

.custom-options {
    position: absolute;
    display: block;
    top: 100%;
    left: 0;
    right: 0;
    border: 1px solid var(--primary);
    border-top: 0;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    background: rgba(10, 10, 10, 0.98); /* Сделал фон чуть плотнее */
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 9999; /* Максимальный приоритет, чтобы был поверх всего */
    overflow: hidden;
    
    /* --- НОВЫЕ СВОЙСТВА ДЛЯ СКРОЛЛА --- */
    max-height: 200px; /* Ограничиваем высоту, чтобы не улетал вниз */
    overflow-y: auto;  /* Включаем вертикальный скролл */
    box-shadow: 0 10px 20px rgba(0,0,0,0.5); /* Тень чтобы выделялся */
}

/* Стилизация скроллбара для Webkit (Chrome, Safari, Telegram Web) */
.custom-options::-webkit-scrollbar {
    width: 6px;
}
.custom-options::-webkit-scrollbar-track {
    background: #111;
}
.custom-options::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}
.custom-options::-webkit-scrollbar-thumb:hover {
    background: #d900d9;
}

.custom-select-wrapper.open .custom-options {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.custom-option {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    font-size: 0.9rem;
    color: #ccc;
    cursor: pointer;
    transition: 0.2s;
}

.custom-option:hover {
    background: rgba(255, 0, 255, 0.1);
    color: #fff;
    padding-left: 18px; /* Небольшой сдвиг при наведении */
}

.custom-option.selected {
    color: var(--primary);
    font-weight: bold;
}

.arrow {
    position: relative;
    height: 10px;
    width: 10px;
}
.arrow::before, .arrow::after {
    content: "";
    position: absolute;
    bottom: 0px;
    width: 0.15rem;
    height: 100%;
    transition: all 0.2s;
    background-color: var(--primary);
}
.arrow::before { left: -3px; transform: rotate(45deg); }
.arrow::after { left: 3px; transform: rotate(-45deg); }
.open .arrow::before { transform: rotate(-45deg); }
.open .arrow::after { transform: rotate(45deg); }

/* Анимация обновления цены */
@keyframes flashUpdate {
    0% { color: var(--primary); text-shadow: 0 0 10px var(--primary); }
    100% { color: white; text-shadow: none; }
}
.price-update {
    animation: flashUpdate 1s ease-out;
}

/* --- СТИЛИ ДЛЯ ИКОНОК В ДРОПДАУНЕ --- */
.coin-ico-mini {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    margin-right: 8px;
    background: rgba(255,255,255,0.1);
}

/* --- СТИЛИ ДЛЯ БАЛАНСА В SWAP --- */
.balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.8rem;
    color: #888;
}

.max-btn {
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: bold;
    margin-left: 5px;
}

.max-btn:hover {
    background: var(--cyan);
    color: #000;
    box-shadow: 0 0 5px var(--cyan);
}

/* Добавь это в конец файла */

/* История транзакций */
.history-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.h-left { display: flex; align-items: center; gap: 12px; }
.h-icon {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: #222;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
}
.h-info { display: flex; flex-direction: column; gap: 2px; }
.h-type { font-weight: bold; font-size: 0.95rem; }
.h-date { color: #666; font-size: 0.75rem; }

.h-right { text-align: right; }
.h-amt { font-weight: bold; font-size: 1rem; }

.tx-sent .h-icon { color: #ff3333; background: rgba(255, 51, 51, 0.1); }
.tx-sent .h-amt { color: #ff3333; }

.tx-recv .h-icon { color: #00ff88; background: rgba(0, 255, 136, 0.1); }
.tx-recv .h-amt { color: #00ff88; }

.tx-swap .h-icon { color: var(--cyan); background: rgba(0, 255, 255, 0.1); }
.tx-swap .h-amt { color: var(--text); }

/* В конец файла */

/* Админская карточка юзера */
.adm-user-card {
    background: #1a1a1a;
    border-left: 3px solid #ff3333;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
}
.adm-user-card:active { background: #333; }

.auc-top { display: flex; justify-content: space-between; align-items: center; }
.auc-nick { font-weight: bold; color: white; }
.auc-username { color: #aaa; font-size: 0.8rem; }
.auc-id { font-size: 0.7rem; color: #666; font-family: monospace; margin-top: 4px; }
.auc-bal { color: #00ff88; font-weight: bold; font-size: 0.9rem; }

/* Тэги балансов в админке */
.adm-bal-tag {
    background: #222; border: 1px solid #444; 
    padding: 5px 10px; border-radius: 4px; font-size: 0.8rem;
}
/* Custom Checkbox for Admin */
.silent-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
}

.silent-checkbox-wrapper input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 18px;
    width: 18px;
    background-color: #222;
    border: 1px solid #555;
    border-radius: 4px;
    position: relative;
    transition: 0.2s;
}

.silent-checkbox-wrapper:hover input ~ .checkmark {
    border-color: #ff3333;
}

.silent-checkbox-wrapper input:checked ~ .checkmark {
    background-color: #ff3333;
    border-color: #ff3333;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.silent-checkbox-wrapper input:checked ~ .checkmark:after {
    display: block;
}

.silent-checkbox-wrapper .checkmark:after {
    left: 5px;
    top: 1px;
    width: 4px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}