/* ========================================
   MEMORIAL SYSTEM - DESIGN SYSTEM
   Foundation for consistent theming and styling
   ======================================== */

:root {
    /* ===== Color Palette ===== */
    /* Primary Colors - Memorial Theme */
    --color-primary: #2c3e50;
    --color-primary-light: #34495e;
    --color-primary-dark: #1a252f;
    --color-primary-rgb: 44, 62, 80;

    /* Secondary Colors - Accent */
    --color-secondary: #16a085;
    --color-secondary-light: #1abc9c;
    --color-secondary-dark: #138f76;
    --color-secondary-rgb: 22, 160, 133;

    /* Neutral Colors */
    --color-white: #ffffff;
    --color-gray-50: #f8f9fa;
    --color-gray-100: #f1f3f5;
    --color-gray-200: #e9ecef;
    --color-gray-300: #dee2e6;
    --color-gray-400: #ced4da;
    --color-gray-500: #adb5bd;
    --color-gray-600: #6c757d;
    --color-gray-700: #495057;
    --color-gray-800: #343a40;
    --color-gray-900: #212529;
    --color-black: #000000;

    /* Semantic Colors */
    --color-success: #28a745;
    --color-success-light: #48bb62;
    --color-success-dark: #1e7e34;
    --color-info: #17a2b8;
    --color-info-light: #3ab4c5;
    --color-info-dark: #117a8b;
    --color-warning: #ffc107;
    --color-warning-light: #ffcd39;
    --color-warning-dark: #d39e00;
    --color-danger: #dc3545;
    --color-danger-light: #e4606d;
    --color-danger-dark: #bd2130;

    /* Surface Colors */
    --surface-background: #ffffff;
    --surface-foreground: #f8f9fa;
    --surface-card: #ffffff;
    --surface-elevated: #ffffff;
    --surface-overlay: rgba(0, 0, 0, 0.5);

    /* Text Colors */
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --text-tertiary: #adb5bd;
    --text-inverse: #ffffff;
    --text-link: #16a085;
    --text-link-hover: #138f76;

    /* Border Colors */
    --border-color: #dee2e6;
    --border-color-light: #e9ecef;
    --border-color-dark: #ced4da;
    --border-color-focus: #16a085;

    /* ===== Typography ===== */
    --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-heading: "Segoe UI Semibold", -apple-system, sans-serif;
    --font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", 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-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* ===== Spacing System ===== */
    --space-0: 0;
    --space-1: 0.25rem;   /* 4px */
    --space-2: 0.5rem;    /* 8px */
    --space-3: 0.75rem;   /* 12px */
    --space-4: 1rem;      /* 16px */
    --space-5: 1.25rem;   /* 20px */
    --space-6: 1.5rem;    /* 24px */
    --space-8: 2rem;      /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */

    /* ===== Border Radius ===== */
    --radius-none: 0;
    --radius-sm: 0.25rem;     /* 4px */
    --radius-base: 0.375rem;  /* 6px */
    --radius-md: 0.5rem;      /* 8px */
    --radius-lg: 0.75rem;     /* 12px */
    --radius-xl: 1rem;        /* 16px */
    --radius-full: 9999px;

    /* ===== Shadows ===== */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-base: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.25);

    /* ===== Transitions ===== */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;

    /* ===== Z-Index Layers ===== */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* ========================================
   DARK MODE THEME
   ======================================== */

[data-theme="dark"] {
    /* Primary Colors - Adjusted for dark mode */
    --color-primary: #3498db;
    --color-primary-light: #5dade2;
    --color-primary-dark: #2980b9;

    /* Secondary Colors */
    --color-secondary: #1abc9c;
    --color-secondary-light: #48c9b0;
    --color-secondary-dark: #16a085;

    /* Neutral Colors - Inverted */
    --color-gray-50: #1a1d23;
    --color-gray-100: #25282e;
    --color-gray-200: #2d3139;
    --color-gray-300: #3a3e47;
    --color-gray-400: #4a4f5a;
    --color-gray-500: #6c757d;
    --color-gray-600: #adb5bd;
    --color-gray-700: #ced4da;
    --color-gray-800: #dee2e6;
    --color-gray-900: #f8f9fa;

    /* Surface Colors - Better contrast */
    --surface-background: #0d1117;
    --surface-foreground: #161b22;
    --surface-card: #21262d;
    --surface-elevated: #2d333b;
    --surface-overlay: rgba(0, 0, 0, 0.7);

    /* Text Colors - Better visibility */
    --text-primary: #e6edf3;
    --text-secondary: #7d8590;
    --text-tertiary: #57606a;
    --text-inverse: #0d1117;
    --text-link: #58a6ff;
    --text-link-hover: #79c0ff;

    /* Border Colors */
    --border-color: #30363d;
    --border-color-light: #21262d;
    --border-color-dark: #484f58;
    --border-color-focus: #1abc9c;

    /* Semantic Colors - Adjusted for better visibility */
    --color-success: #3fb950;
    --color-info: #58a6ff;
    --color-warning: #f0883e;
    --color-danger: #f85149;

    /* Shadows - Softer for dark mode */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-base: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.6), 0 4px 6px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.7), 0 10px 10px rgba(0, 0, 0, 0.5);
    --shadow-2xl: 0 25px 50px rgba(0, 0, 0, 0.8);
}

/* ========================================
   BASE STYLES
   ======================================== */

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--surface-background);
    transition: background-color var(--transition-base), color var(--transition-base);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Surface Utilities */
.surface-background { background-color: var(--surface-background); }
.surface-foreground { background-color: var(--surface-foreground); }
.surface-card { background-color: var(--surface-card); }
.surface-elevated { background-color: var(--surface-elevated); }

/* Text Utilities */
.text-primary { color: var(--text-primary) !important; }
.text-secondary { color: var(--text-secondary) !important; }
.text-tertiary { color: var(--text-tertiary) !important; }
.text-inverse { color: var(--text-inverse) !important; }

/* Border Utilities */
.border-default { border-color: var(--border-color) !important; }
.border-light { border-color: var(--border-color-light) !important; }
.border-dark { border-color: var(--border-color-dark) !important; }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-base); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }

/* Transition Utilities */
.transition-fast { transition: all var(--transition-fast); }
.transition { transition: all var(--transition-base); }
.transition-slow { transition: all var(--transition-slow); }
