/**
 * Apple-Inspired Theme System
 * Clean, elegant design with excellent light/dark mode support
 */

:root {
  /* Light Theme (Default) */
  --bg: #ffffff;
  --panel: #f9f9f9;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #86868b;
  --accent: #007aff;
  --accent-hover: #0051d5;
  --border: #d2d2d7;
  --success: #30d158;
  --warning: #ff9500;
  --error: #ff3b30;
  --info: #007aff;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --space-2xl: 32px;
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50px;
  
  /* Typography */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg: #000000;
  --panel: #1c1c1e;
  --card: #2c2c2e;
  --text: #ffffff;
  --muted: #8e8e93;
  --accent: #0a84ff;
  --accent-hover: #409cff;
  --border: #38383a;
  --success: #32d74b;
  --warning: #ff9f0a;
  --error: #ff453a;
  --info: #64d2ff;
  
  /* Dark shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* Base styles */
* {
  box-sizing: border-box;
}

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

/* Common interactive elements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: var(--text-base);
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}

.btn-ghost:hover {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border);
}

/* Form elements */
input, textarea, select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  font-family: inherit;
  font-size: var(--text-base);
  transition: all 0.3s ease;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Card component */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

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

/* Utility classes */
.text-muted {
  color: var(--muted);
}

.text-accent {
  color: var(--accent);
}

.text-success {
  color: var(--success);
}

.text-warning {
  color: var(--warning);
}

.text-error {
  color: var(--error);
}

.bg-panel {
  background: var(--panel);
}

.bg-card {
  background: var(--card);
}

.border {
  border: 1px solid var(--border);
}

.rounded {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

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

/* Responsive utilities */
@media (max-width: 768px) {
  :root {
    --space-xl: 16px;
    --space-2xl: 24px;
  }
}

/* Smooth transitions for theme switching */
* {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}
