/* ===== CSS VARIABLES - THEMES ===== */
:root {
  /* Light Theme */
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f5f5f5;
  --border-color: #e5e5e5;
  --text-primary: #171717;
  --text-secondary: #525252;
  --text-tertiary: #737373;
  --hover-bg: #f5f5f5;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

[data-theme="dark"] {
  /* Dark Theme */
  --bg-primary: #000000;
  --bg-secondary: #171717;
  --bg-tertiary: #262626;
  --border-color: #262626;
  --text-primary: #fafafa;
  --text-secondary: #a3a3a3;
  --text-tertiary: #737373;
  --hover-bg: #262626;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3);
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
  min-height: 100vh;
}

/* ===== NAVIGATION ===== */
#mainNav {
  background-color: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 40;
  transition: all 0.2s ease;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.nav-brand svg {
  color: var(--text-secondary);
}

#navLinks {
  display: flex;
  gap: 2rem;
  list-style: none;
  align-items: center;
}

#navLinks li a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
  transition: color 0.2s ease;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
}

#navLinks li a:hover {
  color: var(--text-primary);
  background-color: var(--hover-bg);
}

#navLinks li a.active {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

/* ===== MAIN CONTENT ===== */
#content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ===== CARDS ===== */
.card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.summary-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.summary-card:hover {
  box-shadow: var(--shadow-md);
}

.summary-card h4 {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.summary-card p {
  font-size: 1.875rem;
  font-weight: 600;
  margin: 0;
}

/* ===== CHART CONTAINER ===== */
.chart-container {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.chart-container h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

/* ===== DRAGGABLE CARDS ===== */
.draggable-card {
  cursor: grab;
  position: relative;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

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

.draggable-card:active {
  cursor: grabbing;
}

/* ===== BUTTONS ===== */
button {
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

button:hover {
  opacity: 0.9;
}

button:active {
  transform: scale(0.98);
}

/* ===== FORMS ===== */
input, select, textarea {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.75rem;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--text-secondary);
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background-color: var(--bg-tertiary);
}

th {
  padding: 0.75rem;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
}

td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
  background-color: var(--hover-bg);
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.notification {
  animation: slideIn 0.3s ease;
}

/* ===== UTILITIES ===== */
.text-green {
  color: #16a34a;
}

.text-red {
  color: #dc2626;
}

.text-neutral {
  color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .nav-container {
    padding: 0 0.75rem;
  }
  
  #navLinks {
    gap: 1rem;
  }
  
  #content {
    padding: 1rem 0.75rem;
  }
}

/* ===== SCROLLBAR (Optional) ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--text-tertiary);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}