/* src/styles/theme.css */

/* Base Variables (Dark Mode Default) */
:root {
  --bg-primary: #0f1219;
  --bg-secondary: #161a24;
  --bg-tertiary: #1e2330;
  --bg-code: #1a1e2a;
  --text-primary: #e2e8f0;
  --text-secondary: #a0aec0;
  --text-tertiary: #718096;
  --accent-primary: #06b6d4; /* Cyan */
  --accent-secondary: #3b82f6; /* Blue */
  --accent-tertiary: #8b5cf6; /* Violet */
  --glow-primary: rgba(6, 182, 212, 0.2);
  --glow-secondary: rgba(59, 130, 246, 0.2);
  --glow-tertiary: rgba(139, 92, 246, 0.2);
  --border-primary: rgba(255, 255, 255, 0.1);
  --border-secondary: rgba(255, 255, 255, 0.05);
  --card-bg: rgba(24, 28, 44, 0.5);
  --card-border: rgba(56, 189, 248, 0.2); /* Cyan border */
  --ui-element: #1e293b;
  --ui-element-hover: #334155;
  --container-padding: clamp(1rem, 5vw, 3rem);
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-md: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-mono: 'JetBrains Mono', monospace;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --bg-primary-rgb: 15, 18, 25; /* Added RGB for gradients */
  --bg-secondary-rgb: 22, 26, 36; /* Added RGB for gradients */
}

/* Light Mode Variables */
:root.light-mode {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc; /* Lighter secondary */
  --bg-tertiary: #f1f5f9; /* Even lighter tertiary */
  --bg-code: #f1f5f9;
  --text-primary: #1e293b; /* Darker primary text */
  --text-secondary: #475569; /* Darker secondary text */
  --text-tertiary: #64748b; /* Darker tertiary text */
  --accent-primary: #0891b2; /* Slightly darker cyan */
  --accent-secondary: #2563eb; /* Slightly darker blue */
  --accent-tertiary: #7c3aed; /* Slightly darker violet */
  --glow-primary: rgba(8, 145, 178, 0.15);
  --glow-secondary: rgba(37, 99, 235, 0.15);
  --glow-tertiary: rgba(124, 58, 237, 0.15);
  --border-primary: rgba(0, 0, 0, 0.1); /* Darker borders */
  --border-secondary: rgba(0, 0, 0, 0.05);
  --card-bg: rgba(255, 255, 255, 0.8); /* White card with opacity */
  --card-border: rgba(37, 99, 235, 0.3); /* Blue border */
  --ui-element: #e2e8f0; /* Lighter UI elements */
  --ui-element-hover: #cbd5e1;
  --bg-primary-rgb: 255, 255, 255; /* Added RGB for gradients */
  --bg-secondary-rgb: 248, 250, 252; /* Added RGB for gradients */
}

/* Ensure transitions for smooth theme changes */
body, .site-header, .site-footer, .post-card, input, select, button, pre, code {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Apply base styles using variables */
/* (Keep existing base styles from BaseLayout.astro's <style is:global> here if they are not theme-dependent) */

/* Example: Ensure header background uses variables */
.site-header {
  /* Use RGB variables for background gradients with opacity */
  background: linear-gradient(180deg, rgba(var(--bg-secondary-rgb), 0.9), rgba(var(--bg-primary-rgb), 0.8));
  border-bottom-color: var(--border-primary);
  /* Other header styles */
}

.site-header.scrolled {
  background: rgba(var(--bg-primary-rgb), 0.95);
  /* Other scrolled styles */
}

/* Example: Ensure card styles use variables */
.post-card {
  background: var(--card-bg);
  border-color: var(--card-border);
  /* Other card styles */
}

/* Ensure code blocks adapt */
pre, code {
  background-color: var(--bg-code);
  color: var(--text-secondary); /* Or adjust as needed */
}

/* Ensure inputs/selects adapt */
input, select {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--border-primary);
}

/* Add any other theme-dependent styles here */