/* Case Track - Основные стили */

/* ===== ИМПОРТ ВНЕШНИХ СТИЛЕЙ ===== */

/* Dashboard Bot Stats */

.dashboard-container {
  padding: 1.5rem;
}

.stats-card {
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-card.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stats-card.success {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.stats-card.info {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.stats-card.positive {
  background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
  color: white;
}

.stats-card.negative {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  color: white;
}

.stats-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
}

.stats-card-content h6 {
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
  margin-bottom: 0.5rem;
}

.stats-card-content h2 {
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

.stats-card-icon {
  font-size: 2.5rem;
  opacity: 0.8;
}

.quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.quick-actions .btn {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.quick-actions .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Bots Table */

.bots-table {
  font-size: 0.95rem;
}

.bots-table thead {
  background-color: #f8f9fa;
  font-weight: 600;
}

.bots-table tbody tr {
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

.bots-table tbody tr:hover {
  background-color: #f8f9fa;
}

.bot-name {
  font-weight: 600;
  color: #333;
}

.bot-symbol-badge {
  display: inline-block;
  padding: 0.35rem 0.6rem;
  background-color: #e9ecef;
  color: #495057;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.85rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  font-weight: 500;
  font-size: 0.85rem;
}

.status-badge.running {
  background-color: #d4edda;
  color: #155724;
}

.status-badge.running::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #28a745;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-badge.stopped {
  background-color: #e2e3e5;
  color: #383d41;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.win-rate-excellent {
  color: #28a745;
  font-weight: 600;
}

.win-rate-good {
  color: #17a2b8;
  font-weight: 600;
}

.win-rate-fair {
  color: #ffc107;
  font-weight: 600;
}

.win-rate-poor {
  color: #dc3545;
  font-weight: 600;
}

.pnl-positive {
  color: #28a745;
  font-weight: 600;
}

.pnl-negative {
  color: #dc3545;
  font-weight: 600;
}

.pnl-neutral {
  color: #6c757d;
  font-weight: 600;
}

/* Cards */

.card-header {
  background-color: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.card-header.dark {
  background-color: #343a40;
  color: white;
  border: none;
}

.card-header h5 {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}

.card {
  border-radius: 8px;
  border: 1px solid #dee2e6;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.loading-spinner {
  text-align: center;
  padding: 2rem;
}

.loading-spinner .spinner-border {
  width: 3rem;
  height: 3rem;
  color: #667eea;
}

.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: #6c757d;
}

.empty-state p {
  margin: 0;
  font-size: 1rem;
}

.empty-state a {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.empty-state a:hover {
  text-decoration: underline;
}

/* Strategy Builder Table */

.strategy-table {
  font-size: 0.95rem;
}

.strategy-table thead {
  background-color: #f8f9fa;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  color: #495057;
}

.strategy-table tbody tr {
  border-bottom: 1px solid #e9ecef;
}

.strategy-name {
  font-weight: 600;
  color: #333;
}

.metric-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  background-color: #e9ecef;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Buttons */

.btn-primary {
  background-color: #667eea;
  border-color: #667eea;
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background-color: #5568d3;
  border-color: #5568d3;
}

.btn-success {
  background-color: #28a745;
  border-color: #28a745;
  border-radius: 6px;
  font-weight: 500;
}

.btn-success:hover {
  background-color: #218838;
  border-color: #218838;
}

.btn-warning {
  background-color: #ffc107;
  border-color: #ffc107;
  border-radius: 6px;
  font-weight: 500;
  color: #333;
}

.btn-warning:hover {
  background-color: #e0a800;
  border-color: #e0a800;
  color: #333;
}

.btn-danger {
  background-color: #dc3545;
  border-color: #dc3545;
  border-radius: 6px;
  font-weight: 500;
}

.btn-danger:hover {
  background-color: #c82333;
  border-color: #c82333;
}

.btn-small {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
}

/* Responsive */

@media (max-width: 768px) {
  .dashboard-container {
    padding: 1rem;
  }

  .stats-card-content h2 {
    font-size: 1.5rem;
  }

  .stats-card-icon {
    font-size: 2rem;
  }

  .quick-actions {
    flex-direction: column;
  }

  .quick-actions .btn {
    width: 100%;
  }

  .bots-table {
    font-size: 0.85rem;
  }

  .btn-small {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
  }
}

/* ===== CSS ПЕРЕМЕННЫЕ ===== */

:root {
    /* Основные цвета Bootstrap */
    --bs-primary: #1e88e5;
    --bs-secondary: #26c6da;
    --bs-success: #4caf50;
    --bs-danger: #f44336;
    --bs-warning: #ff9800;
    --bs-info: #2196f3;
    --bs-dark: #121826;
    --bs-light: #f8fafc;

    /* Торговые цвета */
    --trading-bg-dark: #121826;
    --trading-card-bg: #1e293b;
    --trading-border: #334155;
    --trading-text-secondary: #475569;
    --trading-text-muted: #64748b;

    /* Цвета бирж */
    --exchange-binance: #f0b90b;
    --exchange-bybit: #0e6eff;
    --exchange-bitget: #0c6cf2;
    --exchange-bitmex: #00d4b5;
    --exchange-kucoin: #23af91;
    --exchange-mexc: #002d74;
    --exchange-okx: #000000;

    /* Шрифты */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
}

/* ===== ОСНОВНЫЕ СТИЛИ ===== */

body {
    background: var(--trading-bg-dark);
    color: var(--bs-light);
    font-family: var(--font-primary);
}

/* ===== НАВИГАЦИЯ ===== */

.navbar-brand {
    font-weight: bold;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-dark {
    background: linear-gradient(135deg, #1a1f2e 0%, #2d3748 100%) !important;
}

/* ===== КАРТОЧКИ ===== */

.card {
    background: var(--trading-card-bg);
    border: 1px solid var(--trading-border);
    border-radius: 0.5rem;
}

.card-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--trading-border);
    color: var(--bs-light);
    font-weight: 600;
    padding: 0.75rem 1rem;
}

.card-header.bg-dark {
    background: var(--trading-card-bg) !important;
    border-bottom: 1px solid var(--trading-border);
}

.card-header.bg-dark.text-white {
    color: var(--bs-light) !important;
}

.card-body {
    padding: 1rem;
    color: var(--bs-light) !important;
}

.card, .card-body, .card-title, .card-text {
    color: var(--bs-light) !important;
}

.table,
.table th,
.table td {
    background-color: transparent !important;
    color: var(--bs-light) !important;
    border-color: rgba(255, 255, 255, 0.05) !important;
}

.table th {
    background: rgba(255, 255, 255, 0.05) !important;
    border-bottom: 1px solid var(--trading-border) !important;
    font-weight: 600;
}

.list-group-item {
    background: transparent;
    color: #fff;
    border-color: #2d3748;
}

.card .form-label, .card .form-control, .card .form-check-label {
    color: #fff;
}

/* ===== ФОРМЫ ===== */

.form-control,
.form-select {
    background: var(--trading-bg-dark);
    border: 1px solid var(--trading-border);
    color: var(--bs-light);
    font-family: var(--font-primary);
}

.form-control::placeholder {
    color: rgba(248, 250, 252, 0.5);
    opacity: 1;
}

.form-control:focus,
.form-select:focus {
    background: var(--trading-bg-dark);
    border-color: var(--bs-primary);
    color: var(--bs-light);
    box-shadow: 0 0 0 0.2rem rgba(30, 136, 229, 0.25);
}

.form-control:disabled,
.form-select:disabled {
    background-color: inherit;
    opacity: 0.8;
    cursor: not-allowed;
}

.form-select option {
    background: var(--trading-bg-dark);
    color: var(--bs-light);
}

.form-select option:checked {
    background: var(--bs-primary);
    color: var(--bs-light);
}

/* Для видимости в select на всех браузерах */

.form-select {
    color-scheme: dark;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--trading-text-secondary);
    margin-bottom: 0.5rem;
}

/* ===== TEXT UTILITIES ===== */

.text-muted {
    --bs-text-opacity: 0.8;
    color: inherit !important;
    opacity: var(--bs-text-opacity);
}

/* ===== КНОПКИ ===== */

.btn-primary {
    background: var(--bs-primary);
    border: none;
}

.btn-primary:hover {
    background: #1565c0;
}

.btn-success {
    background: var(--bs-success);
    border: none;
}

.btn-danger {
    background: var(--bs-danger);
    border: none;
}

.btn-warning {
    background: var(--bs-warning);
    border: none;
    color: #000;
}

.btn-info {
    background: var(--bs-info);
    border: none;
}

.btn-outline-primary {
    border-color: var(--bs-primary);
    color: var(--bs-primary);
}

.btn-outline-primary:hover,
.btn-outline-primary.active {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    color: #ffffff;
}

/* ===== БЕЙДЖИ БИРЖ ===== */

.bg-binance {
    background-color: var(--exchange-binance) !important;
    color: #000 !important;
}

.bg-bybit {
    background-color: var(--exchange-bybit) !important;
    color: white !important;
}

.bg-bitget {
    background-color: var(--exchange-bitget) !important;
    color: white !important;
}

.bg-bitmex {
    background-color: var(--exchange-bitmex) !important;
    color: #000 !important;
}

.bg-kucoin {
    background-color: var(--exchange-kucoin) !important;
    color: white !important;
}

.bg-mexc {
    background-color: var(--exchange-mexc) !important;
    color: white !important;
}

.bg-okx {
    background-color: var(--exchange-okx) !important;
    color: white !important;
}

/* ===== ИНДИКАТОРЫ ===== */

.indicator-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    border: 1px solid #2d3748;
}

.indicator-value {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.indicator-label {
    font-size: 12px;
    color: #a0aec0;
}

/* ===== ТОРГОВЫЕ БОТЫ ===== */

.bot-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid #667eea;
}

.status-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.status-active {
    background: #48bb78;
    color: #ffffff;
}

.status-stopped {
    background: #f56565;
    color: #ffffff;
}

.status-paused {
    background: #ed8936;
    color: #ffffff;
}

.profit-positive {
    color: #48bb78;
}

.profit-negative {
    color: #f56565;
}

/* ===== ГРАФИКИ ===== */

.chart-container {
    height: auto; /* Убираем фиксированную высоту */
    min-height: 500px; /* Минимальная высота */
    position: relative;
}

/* ===== ЗАГРУЗКА ===== */

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #a0aec0;
}

/* ===== АДАПТИВНОСТЬ ===== */

@media (max-width: 768px) {
    .chart-container {
        height: 300px;
    }
    
    .indicator-value {
        font-size: 16px;
    }
}

/* ===== ФОРМА АВТОРИЗАЦИИ ===== */

.card.auth-card {
    background: #fff;
    color: #222;
    border-radius: 15px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}

.auth-card .form-label,
.auth-card .form-control,
.auth-card .form-check-label {
    color: #222;
}

.auth-card .form-control {
    background: #f5f6fa;
    color: #222;
    border: 1px solid #cbd5e1;
}

.auth-card .form-control:focus {
    background: #fff;
    color: #222;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102,126,234,.15);
}

.auth-card .btn-primary {
    background: #667eea;
    border-color: #667eea;
}

.auth-card .btn-primary:hover {
    background: #5a67d8;
    border-color: #5a67d8;
}

.auth-card .invalid-feedback {
    color: #e53e3e;
}

/* ===== TRADING VIEW PANEL ===== */

.trading-view-panel {
    background: #1a1f2e;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.controls {
    background: #2d3748;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: #1e222d;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
}

.chart-area {
    height: auto; /* Убираем жестко заданную высоту */
    min-height: 400px; /* Минимальная высота */
    width: 100%;
    position: relative;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected {
    background: #48bb78;
}

.status-dot.disconnected {
    background: #f56565;
}

.symbol-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 5px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.symbol-item {
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
    border-bottom: 1px solid #4a5568;
}

.symbol-item:hover {
    background: #4a5568;
}

.symbol-item:last-child {
    border-bottom: none;
}

.analytics-panels {
    margin-top: 20px;
}

.panel {
    background: #2d3748;
    border-radius: 10px;
    padding: 15px;
    height: 300px;
    overflow-y: auto;
}

.panel h5 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: bold;
}

.indicators-list,
.levels-list,
.patterns-list,
.trades-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.indicator-item,
.level-item,
.pattern-item,
.trade-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    border-left: 3px solid #667eea;
}

.indicator-name,
.level-type,
.pattern-name,
.trade-symbol {
    font-weight: bold;
    color: #fff;
    font-size: 14px;
    margin-bottom: 5px;
}

.indicator-value,
.level-price,
.pattern-direction,
.trade-price {
    font-size: 16px;
    font-weight: bold;
    color: #48bb78;
    margin-bottom: 3px;
}

.indicator-probability,
.level-strength,
.pattern-probability {
    font-size: 12px;
    color: #a0aec0;
}

.trade-side {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    text-transform: uppercase;
}

.trade-side.buy {
    background: #48bb78;
    color: #fff;
}

.trade-side.sell {
    background: #f56565;
    color: #fff;
}

.trade-amount {
    font-size: 12px;
    color: #a0aec0;
}

.trade-profit {
    font-size: 12px;
    font-weight: bold;
}

/* ===== PROBABILITY TOOLTIPS ===== */

.probability-tooltip {
    position: absolute;
    background: rgba(26, 31, 46, 0.95);
    border: 1px solid #4a5568;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 12px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.tooltip-content {
    min-width: 200px;
}

.tooltip-title {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 8px;
    font-size: 14px;
}

.tooltip-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    padding: 2px 0;
}

.level-type {
    color: #a0aec0;
    text-transform: capitalize;
}

.probability {
    font-weight: bold;
    color: #48bb78;
}

/* ===== CHART ENHANCEMENTS ===== */

.chart-area {
    position: relative;
}

.chart-container {
    position: relative;
}

/* Стили для индикаторов на графике */

.chart-indicator {
    position: absolute;
    background: rgba(26, 31, 46, 0.9);
    border: 1px solid #4a5568;
    border-radius: 4px;
    padding: 8px;
    font-size: 11px;
    color: #fff;
    z-index: 100;
}

/* Цвета для индикаторов */

.text-success {
    color: #48bb78 !important;
}

.text-danger {
    color: #f56565 !important;
}

.text-warning {
    color: #ed8936 !important;
}

.text-info {
    color: #4299e1 !important;
}

.no-data {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 20px;
}

/* ===== УЛУЧШЕННЫЕ СТИЛИ ДЛЯ АНАЛИТИКИ ===== */

/* Индикаторы */

.indicator-item {
    border-bottom: 1px solid #2d3748;
    padding: 10px 0;
}

.indicator-item:last-child {
    border-bottom: none;
}

.indicator-probability.bullish {
    color: #48bb78;
    font-weight: bold;
}

.indicator-probability.bearish {
    color: #f56565;
    font-weight: bold;
}

.indicator-probability.neutral {
    color: #a0aec0;
}

.indicator-probability.volatile {
    color: #ed8936;
    font-weight: bold;
}

.indicator-probability.consolidation {
    color: #a0aec0;
}

.indicator-probability.high {
    color: #48bb78;
    font-weight: bold;
}

.indicator-probability.normal {
    color: #a0aec0;
}

.indicator-probability.stable {
    color: #a0aec0;
}

.overall-analysis {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    margin-top: 10px;
    padding: 15px;
    border: 1px solid #667eea;
}

.indicator-value.bullish {
    color: #48bb78;
}

.indicator-value.bearish {
    color: #f56565;
}

.indicator-value.volatile {
    color: #ed8936;
}

.indicator-value.stable {
    color: #a0aec0;
}

/* Уровни */

.level-item {
    border-bottom: 1px solid #2d3748;
    padding: 10px 0;
}

.level-item:last-child {
    border-bottom: none;
}

.level-type {
    font-weight: bold;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 5px;
}

.level-type.vwap {
    background: #667eea;
    color: #ffffff;
}

.level-type.fibonacci {
    background: #ed8936;
    color: #ffffff;
}

.level-type.order-block {
    background: #48bb78;
    color: #ffffff;
}

.level-type.pivot {
    background: #9f7aea;
    color: #ffffff;
}

.level-type.support {
    background: #48bb78;
    color: #ffffff;
}

.level-type.resistance {
    background: #f56565;
    color: #ffffff;
}

.level-type.unknown {
    background: #a0aec0;
    color: #ffffff;
}

.strength-label {
    color: #a0aec0;
    font-size: 12px;
}

.strength-value {
    font-weight: bold;
    margin-left: 5px;
}

.strength-value.very-strong {
    color: #48bb78;
}

.strength-value.strong {
    color: #9f7aea;
}

.strength-value.medium {
    color: #ed8936;
}

.strength-value.weak {
    color: #a0aec0;
}

.strength-value.neutral {
    color: #a0aec0;
}

.level-confirmed {
    color: #48bb78;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
}

.level-touches {
    color: #a0aec0;
    font-size: 12px;
    margin-top: 2px;
}

/* Паттерны */

.pattern-item {
    border-bottom: 1px solid #2d3748;
    padding: 10px 0;
}

.pattern-item:last-child {
    border-bottom: none;
}

.pattern-name {
    font-weight: bold;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 5px;
}

.pattern-name.pivot-high,
.pattern-name.missed-pivot-high {
    background: #f56565;
    color: #ffffff;
}

.pattern-name.pivot-low,
.pattern-name.missed-pivot-low {
    background: #48bb78;
    color: #ffffff;
}

.pattern-name.order-block-bullish {
    background: #48bb78;
    color: #ffffff;
}

.pattern-name.order-block-bearish {
    background: #f56565;
    color: #ffffff;
}

.pattern-name.bos-bullish {
    background: #48bb78;
    color: #ffffff;
}

.pattern-name.bos-bearish {
    background: #f56565;
    color: #ffffff;
}

.pattern-name.choch-bullish {
    background: #48bb78;
    color: #ffffff;
}

.pattern-name.choch-bearish {
    background: #f56565;
    color: #ffffff;
}

.pattern-name.unknown {
    background: #a0aec0;
    color: #ffffff;
}

.pattern-direction {
    font-weight: bold;
    margin-bottom: 5px;
}

.pattern-direction.BULLISH {
    color: #48bb78;
}

.pattern-direction.BEARISH {
    color: #f56565;
}

.pattern-direction.NEUTRAL {
    color: #a0aec0;
}

.probability-label {
    color: #a0aec0;
    font-size: 12px;
}

.probability-value {
    font-weight: bold;
    margin-left: 5px;
}

.pattern-figure {
    color: #ed8936;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
}

.pattern-confirmed {
    color: #48bb78;
    font-size: 12px;
    font-weight: bold;
    margin-top: 5px;
}

.pattern-size {
    color: #a0aec0;
    font-size: 12px;
    margin-top: 2px;
}

/* Responsive adjustments */

@media (max-width: 768px) {
    .trading-view-panel {
        padding: 15px;
    }
    
    .controls {
        padding: 15px;
    }
    
    .chart-area {
        height: auto; /* Убираем жестко заданную высоту */
        min-height: 300px; /* Минимальная высота */
    }
    
    .panel {
        height: 250px;
        margin-bottom: 15px;
    }
}

/* Tracked Pairs Panel Styles */

.tracked-pairs-panel {
    background: #1a202c;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.panel-header h3 {
    margin: 0;
    color: #ffffff;
}

.pairs-list {
    min-height: 200px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #a0aec0;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #a0aec0;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.pairs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.pair-card {
    background: #2d3748;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #4a5568;
    transition: all 0.3s ease;
}

.pair-card:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.pair-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.pair-info h4 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}

.exchange-badge {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.pair-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    background: none;
    border: none;
    color: #a0aec0;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #4a5568;
    color: #ffffff;
}

.btn-icon.btn-danger:hover {
    background: #e53e3e;
    color: #ffffff;
}

.pair-details {
    margin-bottom: 16px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-item .label {
    color: #a0aec0;
}

.detail-item .value {
    color: #ffffff;
    font-weight: 500;
}

.detail-item .value.active {
    color: #48bb78;
}

.detail-item .value.inactive {
    color: #e53e3e;
}

.pair-actions-bottom {
    display: flex;
    gap: 8px;
}

.pair-actions-bottom .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 14px;
}

/* Modal Styles */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #2d3748;
    border-radius: 8px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.modal-header h4 {
    margin: 0;
    color: #ffffff;
}

.btn-close {
    background: none;
    border: none;
    color: #a0aec0;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: #4a5568;
    color: #ffffff;
}

.pair-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #e2e8f0;
    font-weight: 500;
    font-size: 14px;
}

.form-group select,
.form-group input {
    background: #4a5568;
    border: 1px solid #718096;
    border-radius: 4px;
    padding: 10px 12px;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.2s ease;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group select:disabled {
    background: #2d3748;
    color: #718096;
    cursor: not-allowed;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.form-actions .btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
}

/* Notification Styles */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.notification-success {
    background-color: #28a745;
}

.notification-error {
    background-color: #dc3545;
}

.notification-info {
    background-color: #17a2b8;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== УЛУЧШЕННЫЕ WEBSOCKET СТИЛИ ===== */

.connection-id {
    font-size: 0.8em;
    color: #6c757d;
    margin-left: 5px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.connected {
    background-color: #28a745;
    box-shadow: 0 0 6px rgba(40, 167, 69, 0.6);
    animation: pulse-green 2s infinite;
}

.status-dot.disconnected {
    background-color: #dc3545;
    box-shadow: 0 0 6px rgba(220, 53, 69, 0.6);
}

.status-dot.connecting {
    background-color: #ffc107;
    box-shadow: 0 0 6px rgba(255, 193, 7, 0.6);
    animation: pulse-yellow 1s infinite;
}

.status-dot.error {
    background-color: #6f42c1;
    box-shadow: 0 0 6px rgba(111, 66, 193, 0.6);
    animation: pulse-purple 1s infinite;
}

@keyframes pulse-green {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes pulse-yellow {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

@keyframes pulse-purple {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

/* ===== АВТОДОПОЛНЕНИЕ МОНЕТ ===== */

.coin-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.coin-suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    color: #ffffff;
    border-bottom: 1px solid #4a5568;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.coin-suggestion-item:hover {
    background: #4a5568;
    color: #ffffff;
}

.coin-suggestion-item:last-child {
    border-bottom: none;
}

.coin-suggestion-symbol {
    font-weight: bold;
    color: #667eea;
    font-size: 14px;
}

.coin-suggestion-details {
    font-size: 12px;
    color: #a0aec0;
}

.coin-suggestion-exchange {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    margin-left: 8px;
}

.coin-input-loading {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: #667eea;
}

.coin-input-loading .spinner-border-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Улучшенные стили для datalist */

datalist {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #2d3748;
    border: 1px solid #4a5568;
    border-radius: 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

datalist option {
    padding: 12px 16px;
    color: #ffffff;
    background: #2d3748;
    border-bottom: 1px solid #4a5568;
    cursor: pointer;
    transition: all 0.2s ease;
}

datalist option:hover {
    background: #4a5568;
    color: #ffffff;
}

datalist option:last-child {
    border-bottom: none;
}

/* Стили для индикатора загрузки в input */

.input-loading-container {
    position: relative;
}

.input-loading-spinner {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: #667eea;
    z-index: 10;
}

.input-loading-spinner .spinner-border-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

/* Индикатор обратного отсчета */

.countdown-indicator {
    background: #667eea;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1s infinite;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.countdown-text {
    color: #ffffff;
    font-weight: bold;
    font-size: 12px;
    line-height: 1;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    }
}

/* Responsive Design */

@media (max-width: 768px) {
    .pairs-grid {
        grid-template-columns: 1fr;
    }
    
    .panel-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .pair-actions-bottom {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .coin-suggestions {
        max-height: 150px;
    }
    
    .coin-suggestion-item {
        padding: 10px 12px;
    }
}

/* ===== CHART TOOLTIP STYLES ===== */

.chart-container {
    height: 1200px; /* Устанавливаем начальную высоту */
    width: 100%;
    position: relative;
    resize: vertical; /* Позволяем изменять высоту мышью */
    overflow: auto; /* Добавляем скролл при необходимости */
    min-height: 600px; /* Минимальная высота */
    max-height: 2000px; /* Максимальная высота */
}

.chart-preloader {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 24, 38, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
    border-radius: 4px;
}

.chart-preloader .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(38, 166, 154, 0.3);
    border-top: 4px solid var(--bs-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.preloader-text {
    margin-top: 12px;
    color: var(--bs-light);
    font-size: 14px;
}

.chart-tooltip {
    position: absolute;
    background: var(--bs-dark);
    border: 1px solid var(--bs-secondary);
    border-radius: 4px;
    padding: 8px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;
    z-index: 1000;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    min-width: 120px;
    color: var(--bs-light);
}

.tooltip-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: bold;
}

.tooltip-symbol {
    color: var(--bs-light);
    font-weight: bold;
}

.tooltip-time {
    color: var(--bs-secondary);
    font-size: 10px;
    margin-left: 8px;
}

.tooltip-price {
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.price-label {
    color: var(--bs-secondary);
    margin-right: 4px;
}

.price-value {
    font-weight: bold;
    font-size: 14px;
    color: var(--bs-light);
}

.tooltip-indicators {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.indicator-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--bs-light);
    font-size: 11px;
}

.indicator-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.indicator-label {
    color: var(--bs-secondary);
    font-size: 10px;
    min-width: 50px;
}

.indicator-value {
    font-weight: bold;
    font-size: 11px;
    color: var(--bs-light);
}

