/* AI Stock Predictions Dashboard - Mobile-first responsive CSS */

:root {
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-primary: #2563eb;
  --color-success: #16a34a;
  --color-danger: #dc2626;
  --color-warning: #d97706;
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-border: #e2e8f0;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

/* Header */
header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1rem;
  box-shadow: var(--shadow);
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
}

header .subtitle {
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* Navigation */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

nav a {
  color: var(--color-primary);
  text-decoration: none;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  transition: background 0.2s;
}

nav a:hover {
  background: #eff6ff;
}

nav a.active {
  background: var(--color-primary);
  color: #fff;
}

/* Main content */
main {
  padding: 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

/* Alert banner */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.alert-warning {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

/* Section */
section {
  margin-bottom: 1.5rem;
}

section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

/* Card grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card .ticker {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-primary);
}

.card .price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.card .price {
  font-size: 0.9375rem;
}

.card .change {
  font-weight: 600;
  font-size: 0.9375rem;
}

.card .change.positive {
  color: var(--color-success);
}

.card .change.negative {
  color: var(--color-danger);
}

/* Badge */
.badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-hit {
  background: #dcfce7;
  color: #166534;
}

.badge-miss {
  background: #fee2e2;
  color: #991b1b;
}

.badge-pending {
  background: #e0e7ff;
  color: #3730a3;
}

/* Chart container */
.chart-container {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.875rem;
}

thead {
  background: #f8fafc;
}

th, td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}

th {
  font-weight: 600;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Responsive table wrapper */
.table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Last updated */
#last-updated {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* Loading state */
.loading {
  text-align: center;
  padding: 2rem;
  color: var(--color-text-muted);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-text-muted);
}

/* Cumulative stat card */
.stat-card {
  text-align: center;
  padding: 1.5rem;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}

.stat-card .stat-label {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .card-grid {
    grid-template-columns: 1fr;
  }

  header h1 {
    font-size: 1.125rem;
  }

  main {
    padding: 0.75rem;
  }
}
