/**
 * ==========================================================================
 * CSS VARIABLES - DESIGN TOKENS
 * ==========================================================================
 *
 * Central configuration file for all design tokens used throughout Teoriklar.
 * All colors, spacing, typography, and other visual properties are defined here.
 *
 * THEMING:
 * - Light theme is the default (defined in :root)
 * - Dark theme is activated via data-theme="dark" attribute on <html>
 * - Theme is toggled via js/utils/theme.js
 *
 * PHP INTEGRATION:
 * - These values are static CSS; no PHP conversion needed
 * - Theme preference is stored in localStorage and applied via JavaScript
 * - School-specific branding (accent colors) could be injected via PHP
 *   by outputting custom CSS variables in a <style> block
 *
 * USAGE:
 * - Always use var(--variable-name) instead of hardcoded values
 * - This ensures consistent theming and easy global updates
 *
 * ==========================================================================
 */

:root {
    /* Primary/Accent Color - Darker green for light theme */
    --color-accent: #008932;
    --color-accent-hover: #006d28;
    --color-accent-light: rgba(0, 137, 50, 0.1);
    --color-accent-medium: rgba(0, 137, 50, 0.2);

    /* Light Theme (Default) */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f8f9fa;
    --color-bg-tertiary: #f1f3f4;
    --color-bg-card: #ffffff;
    --color-bg-hover: #f1f3f4;

    --color-text-primary: #1a1a1a;
    --color-text-secondary: #5f6368;
    --color-text-tertiary: #80868b;
    --color-text-inverse: #ffffff;

    --color-border: #e0e0e0;
    --color-border-light: #f0f0f0;

    /* Use accent color for success states too */
    --color-success: #008932;
    --color-success-light: rgba(0, 137, 50, 0.1);
    --color-error: #ff383c;
    --color-warning: #fbbc04;

    /* Selection state - plain black on light theme */
    --color-selection: #000000;
    --color-selection-bg: rgba(0, 0, 0, 0.06);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.06);

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 350ms ease;

    /* Layout */
    --header-height: 64px;
    --content-max-width: 1200px;
    --sidebar-width: 280px;
}

/**
 * DARK THEME OVERRIDES
 * Applied when <html data-theme="dark"> is set
 * All variables are redefined to provide dark mode colors
 */
[data-theme="dark"] {
    /* Brighter green accent for dark theme */
    --color-accent: #30d158;
    --color-accent-hover: #28b84c;
    --color-accent-light: rgba(48, 209, 88, 0.1);
    --color-accent-medium: rgba(48, 209, 88, 0.2);
    --color-success: #30d158;
    --color-success-light: rgba(48, 209, 88, 0.1);

    --color-bg-primary: #1a1a1a;
    --color-bg-secondary: #242424;
    --color-bg-tertiary: #2d2d2d;
    --color-bg-card: #242424;
    --color-bg-hover: #333333;

    --color-text-primary: #f5f5f5;
    --color-text-secondary: #a0a0a0;
    --color-text-tertiary: #707070;
    --color-text-inverse: #1a1a1a;

    --color-error: #ff4245;

    --color-border: #3d3d3d;
    --color-border-light: #2d2d2d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.25);

    /* Selection state - plain white on dark theme */
    --color-selection: #ffffff;
    --color-selection-bg: rgba(255, 255, 255, 0.1);
}
