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

:root {
  --bg-primary: #0d0d0d;
  --bg-secondary: #1a1a1a;
  --bg-card: #1f1f1f;
  --bg-hover: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --accent: #5856d6;
  --green: #34c759;
  --red: #ff3b30;
  --border: #2a2a2a;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Container - Responsive */
.app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  padding-bottom: 100px;
}

@media (max-width: 768px) {
  .app {
    padding: 16px;
    padding-bottom: 80px;
  }
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  margin-bottom: 24px;
}

.logo {
  font-size: 28px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .logo {
    font-size: 22px;
  }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.market-status {
  font-size: 10px;
}

.market-status.open { color: var(--green); }
.market-status.closed { color: var(--red); }

/* Summary Card */
.summary-card {
  background: linear-gradient(135deg, var(--accent) 0%, #7c3aed 100%);
  border-radius: 20px;
  padding: 40px 32px;
  margin-bottom: 24px;
}

@media (max-width: 768px) {
  .summary-card {
    padding: 28px 20px;
    border-radius: 16px;
  }
}

.summary-label {
  font-size: 16px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -2px;
}

@media (max-width: 768px) {
  .summary-value {
    font-size: 36px;
    letter-spacing: -1px;
  }
}

.summary-change {
  font-size: 18px;
  font-weight: 500;
}

.summary-change .positive { color: #90ee90; }
.summary-change .negative { color: #ffcccb; }

/* Stats Row - Desktop: 4 columns, Mobile: 2 columns */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 1024px) {
  .stats-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .stats-row {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
}

@media (max-width: 768px) {
  .stat-value {
    font-size: 18px;
  }
}

.stat-value.positive { color: var(--green); }
.stat-value.negative { color: var(--red); }

/* Section Title */
.section-title {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 768px) {
  .section-title {
    font-size: 18px;
    margin-bottom: 12px;
  }
}

/* Positions List - Desktop: Grid, Mobile: Stack */
.positions-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .positions-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Position Card - Enhanced */
.position-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.position-card:hover {
  background: var(--bg-hover);
  border-color: var(--border);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.position-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.position-symbol {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.position-name {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.position-value {
  font-size: 22px;
  font-weight: 700;
}

.position-grid, .position-details {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .position-grid, .position-details {
    grid-template-columns: repeat(2, 1fr);
  }
}

.position-stat {
  text-align: center;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.position-stat-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.position-stat-value {
  font-size: 15px;
  font-weight: 600;
}

.position-notes {
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.positive { color: var(--green); }
.negative { color: var(--red); }

/* Footer */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state p {
  font-size: 16px;
}

/* Loading */
.loading {
  text-align: center;
  padding: 60px;
  color: var(--text-secondary);
}

.skeleton {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Buttons */
button {
  cursor: pointer;
  border: none;
  font-family: inherit;
}

/* Links */
a {
  color: inherit;
  text-decoration: none;
}

/* Responsive text */
@media (max-width: 480px) {
  .summary-label { font-size: 14px; }
  .summary-change { font-size: 15px; }
  .position-symbol { font-size: 17px; }
  .position-value { font-size: 18px; }
}

/* Two Column Layout for Desktop */
@media (min-width: 1200px) {
  .main-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
  }
  
  .main-content {
    min-width: 0;
  }
  
  .sidebar {
    position: sticky;
    top: 24px;
  }
}

/* Card Utilities */
.card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 20px;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
