:root {
  /* Light theme variables */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --border-color: #dee2e6;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --accent-color: #007bff;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --error-color: #dc3545;
  --chart-bg: rgba(255, 255, 255, 0.9);
  --notification-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
  /* Dark theme variables */
  --bg-primary: #212529;
  --bg-secondary: #343a40;
  --text-primary: #f8f9fa;
  --text-secondary: #adb5bd;
  --border-color: #495057;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --chart-bg: rgba(45, 45, 45, 0.9);
  --notification-bg: rgba(45, 45, 45, 0.95);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  transition: background-color 0.3s, color 0.3s;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.controls {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 2rem;
}

button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  background-color: var(--accent-color);
  color: white;
  cursor: pointer;
  transition: opacity 0.2s;
}

button:hover {
  opacity: 0.9;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.data-display {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.card {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

#liveData {
  font-family: monospace;
  white-space: pre-wrap;
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

#debugLog {
  font-family: monospace;
  white-space: pre-wrap;
  height: 200px;
  overflow-y: auto;
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.charts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

canvas {
  width: 100% !important;
  height: 300px !important;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 1rem;
}

.sessions {
  background-color: var(--bg-secondary);
  border-radius: 8px;
  padding: 1rem;
}

.sessions-list {
  list-style: none;
  margin-top: 1rem;
}

.session-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

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

.session-info {
  flex-grow: 1;
}

.session-actions {
  display: flex;
  gap: 0.5rem;
}

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

  h1 {
    font-size: 2rem;
  }

  .controls {
    flex-direction: column;
  }

  .charts {
    grid-template-columns: 1fr;
  }
}

/* GazeCloud API specific styles */
#gaze {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid red;
  background-color: rgba(255, 0, 0, 0.2);
  pointer-events: none;
  z-index: 999999;
}

#face_video {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 200px;
  height: 150px;
  border-radius: 8px;
  z-index: 999998;
  background-color: var(--bg-secondary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.calibration-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 999997;
}

.calibration-overlay.show {
  display: flex;
}

.calibration-message {
  color: white;
  font-size: 1.5rem;
  text-align: center;
  padding: 2rem;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
}

.error-message {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--error-color);
  color: white;
  text-align: center;
  padding: 1rem;
  z-index: 999999;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.init-status {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background-color: var(--bg-secondary);
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 999996;
  display: none;
}

.init-status.show {
  display: block;
} 