/**
 * V2 CSS Variables
 * Central Theme Configuration - Easy Theme Switching
 * 
 * Theme: Forest Green + Espresso Brown (Ultra High Contrast)
 * Primary: Bold Forest Green - Actions, Buttons, Links
 * Secondary: Dark Espresso Brown - Headers, Borders, Text
 */

:root {
    /* ======================================
       🌲 PRIMARY: Earth Tone Green (V1 Port)
       ใช้สำหรับ: Buttons, Links, Active states, Icons
       ====================================== */
    --color-primary: #7BA572;
    --color-primary-light: #A8D5BA;
    --color-primary-lighter: #D4E6D8;
    --color-primary-dark: #5A8659;
    --color-primary-darker: #3D5C3C;
    --color-primary-rgb: 123, 165, 114;

    /* ======================================
       ☕ SECONDARY: Warm Beige (V1 Port)
       ใช้สำหรับ: Headers, Borders, Text, Neutral BG
       ====================================== */
    --color-secondary: #B8A98E;
    --color-secondary-light: #D4C5B9;
    --color-secondary-lighter: #E8E4D8;
    --color-secondary-dark: #8A7E6A;
    --color-secondary-darker: #5C5446;
    --color-secondary-rgb: 184, 169, 142;

    /* ======================================
       🎨 ACCENT COLORS (Bold)
       ====================================== */
    --color-accent-warm: #c06030;
    /* Deep Orange */
    --color-accent-cool: #2a6a80;
    /* Deep Teal */
    --color-accent-gold: #a08020;
    /* Dark Gold */

    /* ======================================
       🎨 NEUTRAL COLORS (Standard Palette)
       ====================================== */
    --color-white: #FFFFFF;
    --color-gray-50: #F9FAFB;
    --color-gray-100: #F3F4F6;
    --color-gray-200: #E5E7EB;
    --color-gray-300: #D1D5DB;
    --color-gray-400: #9CA3AF;
    --color-gray-500: #6B7280;
    --color-gray-600: #4B5563;
    --color-gray-700: #374151;
    --color-gray-800: #1F2937;
    --color-gray-900: #111827;

    --color-border: var(--border-color);
    --color-border-light: var(--border-color-light);
    --color-text-primary: var(--text-primary);
    --color-text-secondary: var(--text-secondary);
    --color-text-muted: var(--text-muted);

    /* ======================================
       🎨 THEME GRADIENTS (V1 Style)
       ====================================== */
    --gradient-body: linear-gradient(to bottom, #F9F8F5 0%, #F0EDE4 100%);
    --gradient-primary: linear-gradient(135deg, #7BA572 0%, #5A8659 100%);
    --gradient-primary-hover: linear-gradient(135deg, #5A8659 0%, #3D5C3C 100%);
    --gradient-secondary: linear-gradient(135deg, #B8A98E 0%, #8A7E6A 100%);
    --gradient-card: linear-gradient(to bottom, #FFFFFF 0%, #FAFAFA 100%);
    --gradient-card-hover: linear-gradient(to bottom, #FAFAFA 0%, #F0F0F0 100%);
    --gradient-header: linear-gradient(to right, #FFFFFF 0%, #F9F8F5 100%);
    --gradient-progress: linear-gradient(90deg, var(--color-primary-light), var(--color-primary), var(--color-primary-dark));

    /* ======================================
       🎨 TINTS - Primary (Green) - Bold
       ====================================== */
    --tint-primary-5: rgba(26, 92, 42, 0.15);
    --tint-primary-10: rgba(26, 92, 42, 0.25);
    --tint-primary-15: rgba(26, 92, 42, 0.35);
    --tint-primary-20: rgba(26, 92, 42, 0.45);
    --tint-primary-30: rgba(26, 92, 42, 0.55);

    /* ======================================
       🎨 TINTS - Secondary (Brown) - Bold
       ====================================== */
    --tint-secondary-5: rgba(61, 46, 36, 0.15);
    --tint-secondary-10: rgba(61, 46, 36, 0.25);
    --tint-secondary-15: rgba(61, 46, 36, 0.35);
    --tint-secondary-20: rgba(61, 46, 36, 0.45);

    --tint-white-25: rgba(255, 255, 255, 0.25);
    --tint-white-30: rgba(255, 255, 255, 0.3);
    --tint-white-95: rgba(255, 255, 255, 0.95);
    --tint-white-98: rgba(255, 255, 255, 0.98);

    /* ======================================
       Semantic Colors - Bold
       ====================================== */
    --color-success: #1a6028;
    --color-success-light: #3a9048;
    --color-success-bg: #d0e8d4;
    --color-error: #a02020;
    --color-error-light: #d05050;
    --color-error-bg: #f0d0d0;
    --color-warning: #906010;
    --color-warning-light: #c09030;
    --color-warning-bg: #f0e0c0;
    --color-info: #105080;
    --color-info-light: #4090c0;
    --color-info-bg: #d0e4f0;

    /* ======================================
       Background Colors - V1 Light Theme
       ====================================== */
    --bg-body: #F9F8F5;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F0EDE4;
    --bg-tertiary: #E8E4D8;
    --bg-card: #FFFFFF;
    --bg-card-hover: #FAFAFA;
    --bg-hover: rgba(123, 165, 114, 0.1);
    --bg-hover-secondary: rgba(184, 169, 142, 0.1);
    --bg-active: rgba(123, 165, 114, 0.2);
    --bg-subtle: #F5F5F5;
    --bg-progress: linear-gradient(to right, #E8E4D8, #D4C5B9);

    /* ======================================
       Text Colors - V1 Soft Dark
       ====================================== */
    --text-primary: #3D3D3D;
    --text-secondary: #6B6B6B;
    --text-muted: #9B9B9B;
    --text-light: #B3B3B3;
    --text-white: #FFFFFF;
    --text-link: var(--color-primary);
    --text-link-hover: var(--color-primary-dark);

    /* ======================================
       Border Colors - V1 Soft
       ====================================== */
    --border-color: #D9D3CC;
    --border-color-light: #E8E4D8;
    --border-color-dark: #B8A98E;
    --border-focus: var(--color-primary);

    /* ======================================
       Shadows - Bold & Defined
       ====================================== */
    --shadow-sm: 0 1px 4px rgba(10, 8, 5, 0.20);
    --shadow: 0 2px 12px rgba(10, 8, 5, 0.25);
    --shadow-md: 0 4px 24px rgba(26, 21, 16, 0.2);
    --shadow-lg: 0 8px 48px rgba(26, 21, 16, 0.25);
    --shadow-xl: 0 20px 60px rgba(26, 21, 16, 0.3);
    --shadow-focus: 0 0 0 4px rgba(45, 107, 58, 0.45);
    --shadow-card: 0 3px 16px rgba(90, 74, 64, 0.2), 0 1px 6px rgba(0, 0, 0, 0.1);
    --shadow-btn-primary: 0 4px 16px rgba(45, 107, 58, 0.5);
    --shadow-btn-primary-hover: 0 6px 24px rgba(45, 107, 58, 0.6);
    --shadow-progress: 0 2px 10px rgba(45, 107, 58, 0.5);

    /* ======================================
       Spacing
       ====================================== */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* ======================================
       Border Radius
       ====================================== */
    --radius-sm: 4px;
    --radius: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* ======================================
       Typography (V1 Style)
       ====================================== */
    --font-family: 'Poppins', 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;

    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-md: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;

    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

    --line-height-tight: 1.2;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* ======================================
       Layout
       ====================================== */
    --header-height: 60px;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 60px;
    --content-max-width: 1400px;

    /* ======================================
       Z-Index Scale
       ====================================== */
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-header: 1000;
    --z-modal-backdrop: 1100;
    --z-modal: 1200;
    --z-popover: 1300;
    --z-tooltip: 1400;
    --z-toast: 1500;
    --z-debug: 9999;

    /* ======================================
       Font Size Adjustment (Mobile Only)
       ====================================== */
    --root-font-size: 16px;

    /* ======================================
       Transitions
       ====================================== */
    --transition-fast: 150ms ease;
    --transition: 200ms ease;
    --transition-slow: 300ms ease;

    /* ======================================
       Component Specific
       ====================================== */
    --input-height: 40px;
    --input-height-sm: 32px;
    --input-height-lg: 48px;

    --btn-height: 40px;
    --btn-height-xs: 24px;
    --btn-height-sm: 32px;
    --btn-height-lg: 48px;

    --table-row-height: 48px;
    --table-header-bg: var(--bg-secondary);
    --table-stripe-bg: rgba(0, 0, 0, 0.02);
    --table-hover-bg: var(--bg-hover);
}

/* ======================================
   Dark Mode Theme
   ====================================== */
[data-theme="dark"],
.dark-mode {
    --bg-body: #1a1a2e;
    --bg-primary: #2d2d44;
    --bg-secondary: #3d3d5c;
    --bg-tertiary: #4d4d6a;
    --bg-card: #2d2d44;
    --bg-card-hover: #3d3d5c;
    --bg-hover: rgba(123, 165, 114, 0.15);
    --bg-active: rgba(123, 165, 114, 0.25);

    --gradient-body: linear-gradient(135deg, #1a1a2e 0%, #252540 50%, #1a1a2e 100%);
    --gradient-card: linear-gradient(135deg, #2d2d44 0%, #3d3d5c 100%);

    --text-primary: #e2e8f0;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
    --text-light: #4a5568;

    --border-color: #4d4d6a;
    --border-color-light: #3d3d5c;
    --border-color-dark: #5d5d7a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.3);
}

/* ======================================
   Blue Theme (Example - Future Use)
   ====================================== */
[data-theme="blue"] {
    --color-primary: #5b8dd9;
    --color-primary-light: #8eb3e8;
    --color-primary-lighter: #c4d9f4;
    --color-primary-dark: #3d6bb3;
    --color-primary-darker: #2d5090;
    --color-primary-rgb: 91, 141, 217;

    --gradient-body: linear-gradient(135deg, #f5f7fb 0%, #e6ecf5 50%, #eff3f9 100%);
    --gradient-primary: linear-gradient(135deg, #5b8dd9 0%, #3d6bb3 100%);

    --bg-body: #f5f7fb;
    --bg-secondary: #eff3f9;
    --bg-tertiary: #e3eaf4;

    --text-primary: #2e3a4d;
    --text-secondary: #5a6b7c;
    --text-muted: #8a9aac;
}

/* ======================================
   Service Theme (Blue-Teal)
   ====================================== */
.theme-service {
    --color-primary: #5B8DB3;
    --color-primary-light: #8EB3D4;
    --color-primary-lighter: #C4D9E8;
    --color-primary-dark: #3D6B8A;
    --color-primary-darker: #2D5066;
    --color-primary-rgb: 91, 141, 179;

    --gradient-primary: linear-gradient(135deg, #5B8DB3 0%, #3D6B8A 100%);
    --gradient-primary-hover: linear-gradient(135deg, #3D6B8A 0%, #2D5066 100%);

    --bg-hover: rgba(91, 141, 179, 0.1);
    --bg-active: rgba(91, 141, 179, 0.2);
    --bg-body: #F5F7FA;
    --bg-secondary: #EFF3F9;

    --border-color: #CCD3D9;
    --border-color-light: #D8E4E8;
    --color-border: var(--border-color);
    --color-border-light: var(--border-color-light);

    --shadow-btn-primary: 0 4px 16px rgba(91, 141, 179, 0.5);
    --shadow-btn-primary-hover: 0 6px 24px rgba(91, 141, 179, 0.6);

    /* Breakpoints */
    --breakpoint-xs: 480px;
    --breakpoint-sm: 576px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1200px;
}

/* ======================================
   Responsive Breakpoint Variables
   ====================================== */
/* Use in media queries:
   @media (max-width: 768px) { } (Mobile/Tablet)
   @media (max-width: 480px) { } (Small Mobile)
   @media (min-width: 769px) and (max-width: 1024px) { } (Tablet Landscape)
*/