:root {
  --primary-color: #f7931a;
  --primary-light: #ffb347;
  --primary-dark: #e8831a;
  --secondary-color: #2d3142;
  --background-dark: #1a1d29;
  --background-card: #252a3a;
  --text-primary: #ffffff;
  --text-secondary: #b8bcc8;
  --text-muted: #9ca3af;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --border: #374151;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, var(--background-dark) 0%, #1e2235 100%);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem;
}

@media (max-width: 768px) {
  .container {
    padding: 0.75rem;
  }
  
  .header-content {
    padding: 1rem 1.5rem;
    gap: 1rem;
  }
  
  .telegram-link {
    padding: 0.5rem 1rem;
  }
  
  .telegram-link span {
    font-size: 0.8rem;
  }
  
  .subscriber-count {
    font-size: 0.7rem;
  }
}

/* Header */
.header {
  margin-bottom: 2rem;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--background-card);
  padding: 1.5rem 2rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.logo {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo i {
  color: var(--primary-color);
  font-size: 2rem;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.telegram-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  background: linear-gradient(135deg, #0088cc, #229ed9);
  border-radius: 12px;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.telegram-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(34, 158, 217, 0.3);
  background: linear-gradient(135deg, #229ed9, #0088cc);
}

.telegram-link i {
  font-size: 1.2rem;
  margin-bottom: 0.25rem;
}

.telegram-link span {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.125rem;
}

.subscriber-count {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 400;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--success);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

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

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
}

/* Mobile-first: Single column layout */
.price-card { grid-area: price; }
.signal-card { grid-area: signal; }
.chart-card { grid-area: chart; }
.indicators-card { grid-area: indicators; }
.signals-history-card { grid-area: history; }

/* Tablet Layout (768px+) */
@media (min-width: 768px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 
      "price signal"
      "chart chart"
      "indicators history";
  }
  
  .price-card { grid-area: price; }
  .signal-card { grid-area: signal; }
  .chart-card { 
    grid-area: chart; 
    grid-column: 1 / -1;
  }
  .indicators-card { grid-area: indicators; }
  .signals-history-card { grid-area: history; }
}

/* Desktop Layout (1200px+) - Chart spans full width */
@media (min-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 
      "price signal"
      "chart chart"
      "indicators history";
  }
  
  .price-card { 
    grid-area: price;
    min-height: 200px;
  }
  .signal-card { 
    grid-area: signal;
    min-height: 200px;
  }
  .chart-card { 
    grid-area: chart;
    grid-column: 1 / -1;
    min-height: 450px;
  }
  .indicators-card { 
    grid-area: indicators;
    min-height: 250px;
  }
  .signals-history-card { 
    grid-area: history;
    min-height: 250px;
    max-height: 400px;
    overflow-y: auto;
  }
}

/* Cards */
.card {
  background: var(--background-card);
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card-header i {
  color: var(--primary-color);
}

/* Price Card */
.price-display {
  padding: 1.5rem 2rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.price {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
  margin-bottom: 1rem;
  text-align: center;
}

@media (min-width: 1200px) {
  .price {
    font-size: 2rem;
  }
}

.price-change {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.price-change.positive {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.price-change.negative {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.price-info {
  display: grid;
  gap: 0.75rem;
}

.info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.info-item .label {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.info-item .value {
  font-weight: 600;
}

/* ATH Styles */
.ath-current {
  color: var(--primary-color);
  font-weight: 700;
}

.ath-distance {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
}

/* Signal Card */
.signal-display {
  padding: 1.5rem 2rem 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.signal-type {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  padding: 1rem;
  border-radius: 12px;
  margin-bottom: 1.5rem;
}

.signal-type.BUY {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.signal-type.SELL {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.signal-type.HOLD {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}

.signal-confidence {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--primary-color);
  color: white;
}

.signal-reasoning ul {
  list-style: none;
  padding: 0;
}

.signal-reasoning li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.signal-reasoning li:last-child {
  border-bottom: none;
}

/* Chart Card */
.chart-container {
  padding: 1rem 2rem 2rem;
  height: 100%;
  min-height: 350px;
  position: relative;
  flex: 1;
}

.chart-controls {
  display: flex;
  gap: 0.5rem;
}

.chart-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chart-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.chart-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* Indicators */
.indicators-grid {
  padding: 1.5rem 2rem 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  height: 100%;
  align-content: start;
}

@media (min-width: 768px) {
  .indicators-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .indicators-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.indicator-item {
  text-align: center;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.indicator-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.indicator-name {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.indicator-value {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.indicator-status {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-weight: 600;
}

.indicator-status.bullish {
  background: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

.indicator-status.bearish {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.indicator-status.neutral {
  background: rgba(156, 163, 175, 0.2);
  color: var(--text-muted);
}

/* Signal History */
.signals-list {
  padding: 1.5rem 2rem 2rem;
  height: 100%;
  overflow-y: auto;
}

.signals-list::-webkit-scrollbar {
  width: 6px;
}

.signals-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.signals-list::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 3px;
}

.signals-list::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

.signal-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.signal-history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.signal-history-item:last-child {
  margin-bottom: 0;
}

.signal-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.signal-type-small {
  font-weight: 600;
  font-size: 0.875rem;
}

.signal-type-small.BUY { color: var(--success); }
.signal-type-small.SELL { color: var(--danger); }
.signal-type-small.HOLD { color: var(--warning); }

.signal-price {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.signal-time {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.signal-confidence-small {
  background: var(--primary-color);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.loading {
  text-align: center;
  color: var(--text-secondary);
  padding: 2rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .dashboard-grid {
    grid-template-areas: 
      "price"
      "signal"
      "chart"
      "indicators"
      "history";
    grid-template-columns: 1fr;
  }
  
  .chart-card {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0.5rem;
  }
  
  .header-content {
    padding: 1rem;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .price {
    font-size: 2rem !important;
  }
  
  .chart-container {
    height: 300px;
    padding: 1rem;
  }
  
  .indicators-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }
}