/* 今彩539智能分析系統 - 主題變數系統 */

/* Light Theme (Default) */
:root {
    /* Color Palette - 黃白紅黑配色 */
    --color-primary: #AA0000;
    --color-primary-light: #dc2626;
    --color-primary-dark: #880000;
    --color-secondary: #FFE001;
    --color-accent: #FFC107;

    /* Text Colors */
    --color-text-primary: #000000;
    --color-text-secondary: #000000;
    --color-text-tertiary: #333333;
    --color-white: #ffffff;
    --color-black: #000000;

    /* Text Color aliases for backward compatibility */
    --color-text: var(--color-text-primary);
    --color-text-light: var(--color-text-tertiary);

    /* Background Colors */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #FFDBCE;
    --color-bg-tertiary: #FFE001;
    --color-bg-hover: #FFC107;

    /* Background aliases for backward compatibility */
    --color-bg: var(--color-bg-primary);
    --color-bg-alt: var(--color-bg-secondary);

    /* Border Colors */
    --color-border: #CCCCCC;
    --color-border-light: #e0e0e0;
    --color-border-dark: #999999;

    /* Status Colors */
    --color-success: #AA0000;
    --color-success-bg: #ffe5e5;
    --color-warning: #FFE001;
    --color-warning-bg: #fff8e1;
    --color-error: #AA0000;
    --color-error-bg: #ffcccb;
    --color-info: #AA0000;
    --color-info-bg: #ffe5e5;

    /* Focus and Interactive */
    --color-focus: #AA0000;
    --color-focus-ring: rgba(170, 0, 0, 0.2);
    
    /* Typography */
    --font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
    --font-family-mono: 'SF Mono', Monaco, Inconsolata, 'Roboto Mono', 'Source Code Pro', monospace;
    
    /* Font Sizes */
    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.875rem;   /* 14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-lg: 1.125rem;   /* 18px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-2xl: 1.5rem;    /* 24px */
    --font-size-3xl: 1.875rem;  /* 30px */
    --font-size-4xl: 2.25rem;   /* 36px */
    
    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-base: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Spacing Scale */
    --spacing-xs: 0.25rem;   /* 4px */
    --spacing-sm: 0.5rem;    /* 8px */
    --spacing-md: 1rem;      /* 16px */
    --spacing-lg: 1.5rem;    /* 24px */
    --spacing-xl: 2rem;      /* 32px */
    --spacing-2xl: 3rem;     /* 48px */
    --spacing-3xl: 4rem;     /* 64px */

    /* Spacing aliases for backward compatibility */
    --space-xs: var(--spacing-xs);
    --space-sm: var(--spacing-sm);
    --space-md: var(--spacing-md);
    --space-lg: var(--spacing-lg);
    --space-xl: var(--spacing-xl);

    /* Border Radius */
    --border-radius-sm: 0.25rem;  /* 4px */
    --border-radius-md: 0.375rem; /* 6px */
    --border-radius-lg: 0.5rem;   /* 8px */
    --border-radius-xl: 0.75rem;  /* 12px */
    --border-radius-full: 9999px;

    /* Border Radius aliases for backward compatibility */
    --radius-sm: var(--border-radius-sm);
    --radius-md: var(--border-radius-md);
    --radius-lg: var(--border-radius-lg);
    --radius-xl: var(--border-radius-xl);
    --radius-full: var(--border-radius-full);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Layout */
    --container-max-width: 1200px;
    --sidebar-width: 280px;
    --header-height: 64px;
    
    /* Transitions */
    --transition-duration: 0.2s;
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Dark Theme - Restored original readable colors */
[data-theme="dark"] {
    /* Text Colors - Light text on dark background */
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-text-tertiary: #9ca3af;
    --color-white: #ffffff;
    --color-black: #000000;

    /* Text Color aliases */
    --color-text: var(--color-text-primary);
    --color-text-light: var(--color-text-tertiary);

    /* Background Colors - True dark backgrounds */
    --color-bg-primary: #111827;
    --color-bg-secondary: #1f2937;
    --color-bg-tertiary: #374151;
    --color-bg-hover: #4b5563;

    /* Background aliases */
    --color-bg: var(--color-bg-primary);
    --color-bg-alt: var(--color-bg-secondary);

    /* Border Colors - Visible on dark */
    --color-border: #374151;
    --color-border-light: #4b5563;
    --color-border-dark: #6b7280;

    /* Status Colors - Adjusted for dark theme */
    --color-success: #34d399;
    --color-success-bg: rgba(16, 185, 129, 0.1);
    --color-warning: #fbbf24;
    --color-warning-bg: rgba(245, 158, 11, 0.1);
    --color-error: #f87171;
    --color-error-bg: rgba(239, 68, 68, 0.1);
    --color-info: #60a5fa;
    --color-info-bg: rgba(59, 130, 246, 0.1);

    /* Primary colors - Blue for better contrast on dark */
    --color-primary: #3b82f6;
    --color-primary-light: #60a5fa;
    --color-primary-dark: #2563eb;
    --color-secondary: #fbbf24;
    --color-accent: #f59e0b;

    /* Focus colors */
    --color-focus: #3b82f6;
    --color-focus-ring: rgba(59, 130, 246, 0.3);

    /* Shadows - adjusted for dark theme */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* High Contrast Theme */
[data-theme="high-contrast"] {
    --color-text-primary: #000000;
    --color-text-secondary: #000000;
    --color-text-tertiary: #000000;
    --color-white: #ffffff;
    --color-black: #000000;

    /* Text Color aliases */
    --color-text: var(--color-text-primary);
    --color-text-light: var(--color-text-primary);

    --color-bg-primary: #ffffff;
    --color-bg-secondary: #ffffff;
    --color-bg-tertiary: #ffffff;
    --color-bg-hover: #f0f0f0;

    /* Background aliases */
    --color-bg: var(--color-bg-primary);
    --color-bg-alt: var(--color-bg-secondary);
    
    --color-border: #000000;
    --color-border-light: #000000;
    --color-border-dark: #000000;
    
    --color-primary: #0000ff;
    --color-primary-light: #0000ff;
    --color-primary-dark: #000080;
    
    --color-focus: #ff0000;
    --color-focus-ring: rgba(255, 0, 0, 0.3);
    
    --color-success: #008000;
    --color-success-bg: #ffffff;
    --color-warning: #ff8000;
    --color-warning-bg: #ffffff;
    --color-error: #ff0000;
    --color-error-bg: #ffffff;
    --color-info: #0000ff;
    --color-info-bg: #ffffff;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.8);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.8), 0 2px 4px -1px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.8), 0 4px 6px -2px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.9), 0 10px 10px -5px rgba(0, 0, 0, 0.7);
}

/* System Theme Preference Detection removed - users must explicitly choose theme */

/* Theme Transition Animation */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-duration: var(--transition-duration);
    transition-timing-function: var(--transition-timing);
}

/* Disable transitions when switching themes to prevent flash */
.theme-transitioning * {
    transition: none !important;
}

/* Custom Properties for Lottery-Specific Colors */
:root {
    /* Lottery Number Colors */
    --color-number-hot: #ef4444;      /* Red for hot numbers */
    --color-number-warm: #f59e0b;     /* Orange for warm numbers */
    --color-number-cool: #3b82f6;     /* Blue for cool numbers */
    --color-number-cold: #6b7280;     /* Gray for cold numbers */
    
    /* Lucky Number Colors */
    --color-lucky-primary: #7c3aed;   /* Purple for primary lucky numbers */
    --color-lucky-secondary: #ec4899; /* Pink for secondary lucky numbers */

    /* Interactive Colors */
    --color-hover: #8b5cf6;           /* Purple for hover states */
    
    /* Chart Colors */
    --color-chart-1: #3b82f6;
    --color-chart-2: #ef4444;
    --color-chart-3: #10b981;
    --color-chart-4: #f59e0b;
    --color-chart-5: #8b5cf6;
    --color-chart-6: #06b6d4;
    --color-chart-7: #84cc16;
    --color-chart-8: #f97316;
}

[data-theme="dark"] {
    /* Adjust lottery colors for dark theme */
    --color-number-hot: #f87171;
    --color-number-warm: #fbbf24;
    --color-number-cool: #60a5fa;
    --color-number-cold: #9ca3af;

    --color-lucky-primary: #a78bfa;
    --color-lucky-secondary: #f472b6;

    /* Interactive Colors */
    --color-hover: #a78bfa;  /* Lighter purple for dark mode */

    /* Adjust chart colors for better visibility in dark mode */
    --color-chart-1: #60a5fa;
    --color-chart-2: #f87171;
    --color-chart-3: #34d399;
    --color-chart-4: #fbbf24;
    --color-chart-5: #a78bfa;
    --color-chart-6: #22d3ee;
    --color-chart-7: #a3e635;
    --color-chart-8: #fb923c;
}

/* Birthday Calculator Section Styles - Applied to all themes */
section:has(#birthday-calculator) {
    background: var(--color-bg-secondary);
}