/* ============================================================
   ТОРГОВЫЙ СОВЕТНИК — стиль в духе образовательного мини-аппа
   Тёмная тема · зелёный #00e676 · золото #FFD700 · стекло
   ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #fff;
    background: #05030f;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 10px 12px 40px;
}

/* ── Header ──────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 4px 10px;
}
.logo {
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    text-align: center;
}
.logo-green { color: #00e676; text-shadow: 0 0 14px rgba(0, 230, 110, 0.6); }
.logo-gold  { color: #FFD700; text-shadow: 0 0 14px rgba(255, 215, 0, 0.55); }

/* ── Поиск ───────────────────────────────────────────────── */
.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
    margin: 8px 0;
}
.search-icon {
    position: absolute;
    left: 14px;
    font-size: 0.95rem;
    opacity: 0.7;
    pointer-events: none;
}
.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: #fff;
    font-size: 0.95rem;
    padding: 13px 40px 13px 40px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.search-input:focus {
    border-color: rgba(0, 230, 110, 0.55);
    box-shadow: 0 0 16px rgba(0, 230, 110, 0.18);
}
.search-clear {
    position: absolute;
    right: 10px;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.search-empty {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 18px;
    font-size: 0.9rem;
}

/* ── Toggle buttons ──────────────────────────────────────── */
.asset-toggle-btn, .news-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    margin-top: 8px;
    transition: all 0.25s;
}
.asset-toggle-btn {
    background: rgba(0, 230, 110, 0.08);
    border: 1px solid rgba(0, 230, 110, 0.35);
    color: #00e676;
}
.asset-toggle-btn:hover, .asset-toggle-btn.active {
    background: rgba(0, 230, 110, 0.14);
    border-color: rgba(0, 230, 110, 0.65);
    box-shadow: 0 0 16px rgba(0, 230, 110, 0.22);
}
.news-toggle-btn {
    background: rgba(255, 215, 0, 0.07);
    border: 1px solid rgba(255, 215, 0, 0.32);
    color: #FFD700;
}
.news-toggle-btn:hover {
    background: rgba(255, 215, 0, 0.13);
    border-color: rgba(255, 215, 0, 0.6);
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.2);
}
.dropdown-arrow {
    margin-left: auto;
    font-size: 0.7rem;
    opacity: 0.8;
    transition: transform 0.3s ease;
}
.asset-toggle-btn.active .dropdown-arrow { transform: rotate(180deg); }

/* ── Asset panel ─────────────────────────────────────────── */
.asset-panel {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.asset-group {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}
.asset-cat-head {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}
.asset-cat-head.active { background: rgba(0, 230, 110, 0.08); }
.asset-cat-head > span:first-child { flex: 1; min-width: 0; text-align: left; }
.asset-cat-head .dropdown-arrow { transition: transform 0.3s; width: 12px; text-align: center; flex-shrink: 0; }
.asset-cat-head.active .dropdown-arrow { transform: rotate(180deg); }
.asset-cat-count {
    margin-left: auto;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 0;
    border-radius: 10px;
    min-width: 32px;
    text-align: center;
    box-sizing: border-box;
}
.asset-cat-list { display: flex; flex-direction: column; }

.asset-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: background 0.15s;
}
.asset-row:hover { background: rgba(0, 230, 110, 0.07); }

/* иконка / флаги слева (SVG) */
.asset-ic {
    flex: 0 0 auto;
    width: 42px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
}
.asset-ic .ic-img { width: 20px; height: 20px; object-fit: contain; display: block; }
.ic-img.ic-mono { filter: brightness(0) invert(1); }  /* чёрные лого → белые */

/* пара валют — два флага внахлёст */
.asset-flags { gap: 0; }
.asset-flags .flag {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid rgba(8, 5, 24, 0.9);
}
.asset-flags .flag-2 { margin-left: -7px; }
.asset-flags .flag-globe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.1);
}

/* индекс — флаг + бейдж */
.asset-index .flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; }
.asset-index .ic-badge { position: absolute; right: 1px; bottom: 0; font-size: 0.55rem; }
.asset-stock { background: rgba(255, 255, 255, 0.1); }

.asset-row-main { flex: 1; min-width: 0; }
.asset-row-symbol { font-size: 0.92rem; font-weight: 700; color: #fff; }
.asset-row-name {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.asset-row-cat {
    display: inline-block;
    font-size: 0.66rem;
    color: rgba(0, 230, 110, 0.8);
    margin-top: 3px;
}
.asset-row-payout {
    font-size: 0.85rem;
    font-weight: 800;
    color: #00e676;
    background: rgba(0, 230, 110, 0.1);
    padding: 4px 9px;
    border-radius: 10px;
}

/* ── Overlays ────────────────────────────────────────────── */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(3, 2, 10, 0.7);
    backdrop-filter: blur(6px);
    overflow-y: auto;
}
.overlay-card {
    background: rgba(8, 5, 24, 0.96);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(120, 80, 255, 0.3);
    border-radius: 24px;
    width: 100%;
    max-width: 400px;
    padding: 26px 20px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    margin: auto;
}
.btn-close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    border-radius: 10px;
    padding: 6px 12px;
    font-size: 0.95rem;
    cursor: pointer;
    z-index: 2;
}

/* ── Окно выбора экспирации ───────────────────────────────── */
.exp-asset { text-align: center; margin: 4px 0 18px; }
.exp-flags { display: flex; justify-content: center; margin-bottom: 10px; }
.exp-flags .asset-ic {
    width: 64px;
    height: 46px;
    border-radius: 14px;
}
.exp-flags .asset-ic .ic-img { width: 32px; height: 32px; }
.exp-flags .asset-flags .flag { width: 30px; height: 30px; border-width: 2px; }
.exp-flags .asset-flags .flag-2 { margin-left: -11px; }
.exp-flags .asset-index .flag { width: 34px; height: 24px; }
.exp-pair { font-size: 1.4rem; font-weight: 900; color: #FFD700; }
.exp-pair-name { font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); margin-top: 3px; }

.exp-label {
    text-align: center;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 12px;
}
.exp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
}
.exp-btn {
    padding: 13px 4px;
    border-radius: 12px;
    background: rgba(0, 230, 110, 0.08);
    border: 1px solid rgba(0, 230, 110, 0.3);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}
.exp-btn:hover { background: rgba(0, 230, 110, 0.16); border-color: rgba(0, 230, 110, 0.5); }
.exp-btn.active {
    background: rgba(0, 230, 110, 0.28);
    border-color: #00e676;
    color: #00e676;
    box-shadow: 0 0 16px rgba(0, 230, 110, 0.35);
}

/* кнопка ПОЛУЧИТЬ ПРОГНОЗ */
.forecast-btn {
    width: 100%;
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    border: none;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    color: #05030f;
    background: linear-gradient(90deg, #00e676, #FFD700);
    box-shadow: 0 6px 24px rgba(0, 230, 110, 0.35);
    transition: opacity 0.2s, transform 0.15s;
}
.forecast-btn:active { transform: scale(0.98); }
.forecast-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

/* анимация поиска сигнала */
.forecast-loading { text-align: center; padding: 16px 0 6px; }
.forecast-loading .exp-flags { margin-bottom: 8px; }
.fc-spinner {
    width: 54px;
    height: 54px;
    margin: 20px auto 16px;
    border: 4px solid rgba(0, 230, 110, 0.18);
    border-top-color: #00e676;
    border-radius: 50%;
    animation: fc-spin 0.8s linear infinite;
}
@keyframes fc-spin { to { transform: rotate(360deg); } }
.fc-step { font-size: 0.9rem; color: rgba(255, 255, 255, 0.7); min-height: 1.2em; }

/* ── Догон ───────────────────────────────────────────────── */
.dogon-badge {
    text-align: center;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffb300;
    background: rgba(255, 179, 0, 0.12);
    border: 1px solid rgba(255, 179, 0, 0.4);
    border-radius: 10px;
    padding: 6px 12px;
    margin: 0 auto 12px;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
}
.dogon-intro { text-align: center; padding: 10px 0 4px; }
.dogon-warn {
    font-size: 1.25rem;
    font-weight: 900;
    color: #ff4d4d;
    margin-bottom: 8px;
}
.dogon-msg { font-size: 0.85rem; color: rgba(255, 255, 255, 0.6); margin-bottom: 14px; }
.dogon-dir {
    font-size: 1.3rem;
    font-weight: 900;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 14px;
}
.dogon-dir.buy { color: #00e676; background: rgba(0, 230, 110, 0.12); border: 1px solid rgba(0, 230, 110, 0.4); }
.dogon-dir.sell { color: #ff4d4d; background: rgba(255, 70, 70, 0.12); border: 1px solid rgba(255, 70, 70, 0.4); }
.dogon-cd-wrap { font-size: 0.95rem; color: #FFD700; font-weight: 700; margin-bottom: 6px; }
.dogon-cd-wrap span { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.dogon-intro .fc-spinner { margin: 14px auto; }

/* ── Сигнал ──────────────────────────────────────────────── */
.sig-flags { display: flex; justify-content: center; margin: 4px 0 10px; }
.sig-flags .asset-ic { width: 64px; height: 46px; border-radius: 14px; }
.sig-flags .asset-ic .ic-img { width: 32px; height: 32px; }
.sig-flags .asset-flags .flag { width: 30px; height: 30px; border-width: 2px; }
.sig-flags .asset-flags .flag-2 { margin-left: -11px; }
.sig-flags .asset-index .flag { width: 34px; height: 24px; }

.sig-asset-symbol { text-align: center; font-size: 1.5rem; font-weight: 900; color: #FFD700; }
.sig-asset-name { text-align: center; font-size: 0.8rem; color: rgba(255, 255, 255, 0.55); margin-top: 3px; }
.sig-payout { text-align: center; font-size: 0.85rem; color: #00e676; margin: 8px 0 16px; }
.sig-payout b { font-weight: 800; }

/* параметры сделки */
.sig-info {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 4px 14px;
    margin-bottom: 12px;
}
.sig-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.sig-info-row:last-child { border-bottom: none; }
.sig-info-row span { color: rgba(255, 255, 255, 0.55); }
.sig-info-row b { color: #fff; font-weight: 700; }
.sig-info-left b { font-size: 1.15rem; color: #FFD700; font-variant-numeric: tabular-nums; }

/* кнопка отмены */
.sig-cancel {
    width: 100%;
    margin-top: 14px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid rgba(255, 70, 70, 0.4);
    background: rgba(255, 70, 70, 0.1);
    color: #ff6b6b;
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s;
}
.sig-cancel:hover { background: rgba(255, 70, 70, 0.18); }

.sig-direction {
    text-align: center;
    border-radius: 18px;
    padding: 22px 16px;
    margin-bottom: 16px;
}
.sig-direction.buy {
    background: rgba(0, 230, 110, 0.12);
    border: 1px solid rgba(0, 230, 110, 0.5);
    box-shadow: 0 0 30px rgba(0, 230, 110, 0.2) inset;
}
.sig-direction.sell {
    background: rgba(255, 70, 70, 0.12);
    border: 1px solid rgba(255, 70, 70, 0.5);
    box-shadow: 0 0 30px rgba(255, 70, 70, 0.2) inset;
}
.sig-arrow { font-size: 2.6rem; line-height: 1; }
.sig-direction.buy .sig-arrow, .sig-direction.buy .sig-dir-text { color: #00e676; }
.sig-direction.sell .sig-arrow, .sig-direction.sell .sig-dir-text { color: #ff4d4d; }
.sig-dir-text { font-size: 1.6rem; font-weight: 900; letter-spacing: 1px; margin-top: 4px; }
.sig-dir-sub { font-size: 0.78rem; color: rgba(255, 255, 255, 0.55); margin-top: 4px; }

.sig-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}
.sig-meta-item {
    flex: 1;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 12px 8px;
}
.sig-meta-label { font-size: 0.7rem; color: rgba(255, 255, 255, 0.5); }
.sig-meta-val { font-size: 1.05rem; font-weight: 800; color: #fff; margin-top: 4px; }

.sig-timer-wrap { text-align: center; margin-bottom: 14px; }
.sig-timer-label { font-size: 0.72rem; color: rgba(255, 255, 255, 0.5); text-transform: uppercase; letter-spacing: 1px; }
.sig-timer { font-size: 2.4rem; font-weight: 900; color: #FFD700; font-variant-numeric: tabular-nums; margin: 4px 0 10px; }
.sig-progress { height: 6px; background: rgba(255, 255, 255, 0.08); border-radius: 6px; overflow: hidden; }
.sig-progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #00e676, #FFD700); transition: width 1s linear; }

.sig-result {
    text-align: center;
    border-radius: 16px;
    padding: 18px;
    margin-top: 8px;
    animation: pop 0.4s ease;
}
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sig-result.pending { background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.12); }
.sig-result.pending .sig-result-text { color: rgba(255, 255, 255, 0.7); font-size: 1rem; }
.sig-result.win { background: rgba(0, 230, 110, 0.15); border: 1px solid rgba(0, 230, 110, 0.5); }
.sig-result.loss { background: rgba(255, 70, 70, 0.15); border: 1px solid rgba(255, 70, 70, 0.5); }
.sig-result-icon { font-size: 2rem; }
.sig-result-text { font-size: 1.3rem; font-weight: 900; margin-top: 4px; }
.sig-result.win .sig-result-text { color: #00e676; }
.sig-result.loss .sig-result-text { color: #ff4d4d; }
.sig-result-sub { font-size: 0.8rem; color: rgba(255, 255, 255, 0.6); margin-top: 4px; }

.sig-disclaimer {
    font-size: 0.66rem;
    color: rgba(255, 255, 255, 0.4);
    text-align: center;
    margin-top: 16px;
    line-height: 1.4;
}

/* ── Новости (таблица с колонками) ──────────────────────────── */
.news-panel {
    margin-top: 8px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.18);
    background: rgba(255, 255, 255, 0.03);
}
.news-loading { text-align: center; color: rgba(255, 255, 255, 0.5); padding: 24px; font-size: 0.85rem; }

.news-table { display: flex; flex-direction: column; }

.news-row {
    display: grid;
    grid-template-columns: 42px 46px 1fr 44px 44px 58px;
    align-items: center;
    gap: 6px;
    padding: 9px 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.74rem;
}

.news-row-head {
    border-top: none;
    background: rgba(255, 215, 0, 0.08);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 700;
    cursor: default;
    position: sticky;
    top: 0;
}

/* левая цветная полоска по сигналу */
.news-row.buy  { box-shadow: inset 3px 0 0 #00e676; }
.news-row.sell { box-shadow: inset 3px 0 0 #ff4d4d; }

.nc-time { color: rgba(255, 255, 255, 0.7); font-variant-numeric: tabular-nums; }
.nc-cur { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.nc-cur-code { font-size: 0.6rem; color: rgba(255, 255, 255, 0.55); }
.nc-event { min-width: 0; }
.nc-event-name {
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nc-event-imp { font-size: 0.6rem; color: #FFD700; margin-top: 1px; }
.nc-num {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-variant-numeric: tabular-nums;
    font-size: 0.7rem;
}
.news-row-head .nc-num { color: rgba(255, 255, 255, 0.55); }
.nc-sig {
    text-align: center;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 3px 4px;
    border-radius: 7px;
}
.nc-sig.buy  { color: #00e676; background: rgba(0, 230, 110, 0.13); }
.nc-sig.sell { color: #ff4d4d; background: rgba(255, 70, 70, 0.13); }
.news-row-head .nc-sig { background: none; color: rgba(255, 255, 255, 0.55); font-weight: 700; }
