/* ============================================================================
   ORION INDUSTRIES - UNIFIED DESIGN SYSTEM
   Professional Web Development Standards
   Mobile-First Responsive Design
   ============================================================================ */

/* ============================================================================
   1. DESIGN TOKENS - CSS Custom Properties
   ============================================================================ */
:root {
    /* --- Color Palette --- */
    /* Primary Colors */
    --color-primary: #8A2BE2;           /* Purple - Main brand */
    --color-primary-light: #a855f7;     /* Lighter purple */
    --color-primary-dark: #6b21a8;      /* Darker purple */
    --color-secondary: #00D1C5;         /* Cyan/Teal - Accent */
    --color-secondary-light: #00ffdd;   /* Lighter cyan */
    --color-secondary-dark: #00a89e;    /* Darker cyan */
    
    /* Background Colors */
    --color-bg-primary: #0d0f1a;        /* Main dark background */
    --color-bg-secondary: #1a1c2a;      /* Card/panel background */
    --color-bg-tertiary: #141621;       /* Darker variant */
    --color-bg-elevated: #1f2233;       /* Elevated surfaces */
    
    /* Text Colors */
    --color-text-primary: #ffffff;      /* Primary text (headings) */
    --color-text-secondary: #e0e0e0;    /* Secondary text (body) */
    --color-text-muted: #888da8;        /* Muted text (labels) */
    --color-text-disabled: #5a5e7d;     /* Disabled text */
    
    /* Semantic Colors */
    --color-success: #00ffaa;           /* Success/positive */
    --color-success-glow: rgba(0, 255, 170, 0.5);
    --color-error: #ff4d4d;             /* Error/negative */
    --color-error-glow: rgba(255, 77, 77, 0.5);
    --color-warning: #ffcc00;           /* Warning */
    --color-info: #4a90e2;              /* Info/neutral */
    
    /* Border & Divider Colors */
    --color-border-primary: rgba(138, 43, 226, 0.2);
    --color-border-secondary: rgba(255, 255, 255, 0.1);
    --color-border-focus: rgba(138, 43, 226, 0.6);
    
    /* Glow & Shadow Colors */
    --color-glow-primary: rgba(138, 43, 226, 0.6);
    --color-glow-secondary: rgba(0, 209, 197, 0.6);
    
    /* --- Typography --- */
    /* Font Families */
    --font-primary: 'Orbitron', sans-serif;     /* Headings, brand */
    --font-secondary: 'Roboto', sans-serif;     /* Body, UI */
    --font-mono: 'Courier New', monospace;      /* Code, addresses */
    
    /* Font Sizes - Mobile First (scales up with breakpoints) */
    --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-size-5xl: 3rem;          /* 48px */
    
    /* Line Heights */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;
    
    /* Font Weights */
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-black: 900;
    
    /* Letter Spacing */
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;
    
    /* --- Spacing Scale (8px base) --- */
    --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 */
    --space-20: 5rem;       /* 80px */
    --space-24: 6rem;       /* 96px */
    
    /* --- Border Radius --- */
    --radius-none: 0;
    --radius-sm: 0.25rem;   /* 4px */
    --radius-base: 0.5rem;  /* 8px */
    --radius-md: 0.75rem;   /* 12px */
    --radius-lg: 1rem;      /* 16px */
    --radius-xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;  /* Fully rounded */
    
    /* --- Shadows --- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-base: 0 4px 15px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px var(--color-glow-primary);
    --shadow-glow-secondary: 0 0 20px var(--color-glow-secondary);
    --shadow-inner: inset 0 0 5px rgba(138, 43, 226, 0.1);
    
    /* --- Transitions --- */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-medium: 300ms cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-slow: 500ms ease-out;
    
    /* --- Z-Index Scale --- */
    --z-base: 1;
    --z-dropdown: 100;
    --z-sticky: 200;
    --z-fixed: 300;
    --z-modal-backdrop: 999;
    --z-modal: 1000;
    --z-popover: 1100;
    --z-tooltip: 1200;
    --z-cursor: 9999;
    
    /* --- Breakpoints (for reference in media queries) --- */
    --breakpoint-xs: 320px;
    --breakpoint-sm: 480px;
    --breakpoint-md: 768px;
    --breakpoint-lg: 1024px;
    --breakpoint-xl: 1440px;
    
    /* --- Component Specific Tokens --- */
    /* Cards */
    --card-padding-mobile: var(--space-4);      /* 16px */
    --card-padding-tablet: var(--space-5);      /* 20px */
    --card-padding-desktop: var(--space-6);     /* 24px */
    --card-bg: linear-gradient(145deg, var(--color-bg-secondary), var(--color-bg-tertiary));
    --card-border: 1px solid var(--color-border-primary);
    
    /* Buttons */
    --button-padding-sm: var(--space-2) var(--space-3);     /* 8px 12px */
    --button-padding-base: var(--space-3) var(--space-5);   /* 12px 20px */
    --button-padding-lg: var(--space-4) var(--space-6);     /* 16px 24px */
    --button-gradient: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    --button-min-height-mobile: 44px;  /* Touch-friendly */
    --button-min-height-desktop: 40px;
    
    /* Inputs */
    --input-padding: var(--space-3) var(--space-4);
    --input-bg: var(--color-bg-tertiary);
    --input-border: 1px solid var(--color-border-secondary);
    --input-min-height-mobile: 44px;  /* Touch-friendly */
    
    /* Container Max Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1024px;
    --container-xl: 1280px;
    --container-2xl: 1536px;
}

/* ============================================================================
   2. RESET & BASE STYLES
   ============================================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-secondary);
    font-family: var(--font-secondary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================================================
   3. TYPOGRAPHY SYSTEM
   ============================================================================ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: var(--font-weight-bold);
    color: var(--color-text-primary);
    letter-spacing: var(--letter-spacing-wide);
    line-height: var(--line-height-tight);
    margin-bottom: var(--space-4);
}

/* Mobile-first heading sizes */
h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-base); }
h6 { font-size: var(--font-size-sm); }

p {
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--color-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary);
}

a:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

strong, b {
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

small {
    font-size: var(--font-size-sm);
}

code, pre {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
}

/* ============================================================================
   4. LAYOUT UTILITIES
   ============================================================================ */
.container {
    width: 100%;
    max-width: var(--container-xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

.page-container {
    flex-grow: 1;
    width: 100%;
    max-width: var(--container-xl);
    margin: 0 auto;
    padding: var(--space-4);
}

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid Utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, 1fr); }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Spacing Utilities */
.m-0 { margin: 0; }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.px-4 { padding-left: var(--space-4); padding-right: var(--space-4); }
.py-4 { padding-top: var(--space-4); padding-bottom: var(--space-4); }

/* Text Utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted { color: var(--color-text-muted); }
.text-success { color: var(--color-success); }
.text-error { color: var(--color-error); }
.text-warning { color: var(--color-warning); }

/* ============================================================================
   5. COMPONENT STYLES
   ============================================================================ */

/* --- Cards --- */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-base);
    border: var(--card-border);
    padding: var(--card-padding-mobile);
    box-shadow: var(--shadow-base), var(--shadow-inner);
    transition: transform var(--transition-medium), 
                box-shadow var(--transition-medium),
                border-color var(--transition-medium);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow), var(--shadow-inner);
    border-color: var(--color-primary);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--color-border-secondary);
}

.card-title {
    font-size: var(--font-size-lg);
    font-family: var(--font-primary);
    color: var(--color-text-primary);
    margin: 0;
}

.card-body {
    padding: var(--space-4) 0;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--button-padding-base);
    min-height: var(--button-min-height-mobile);
    border: none;
    border-radius: var(--radius-base);
    font-family: var(--font-secondary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-primary);
    background: var(--button-gradient);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform var(--transition-fast), 
                box-shadow var(--transition-fast),
                filter var(--transition-fast);
    text-align: center;
    white-space: nowrap;
    user-select: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, 
        rgba(255,255,255,0) 0%, 
        rgba(255,255,255,0.3) 50%, 
        rgba(255,255,255,0) 100%);
    transition: left var(--transition-medium);
    z-index: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(138, 43, 226, 0.4);
    filter: brightness(1.1);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.98);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.btn:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
}

.btn-sm {
    padding: var(--button-padding-sm);
    font-size: var(--font-size-sm);
    min-height: 36px;
}

.btn-lg {
    padding: var(--button-padding-lg);
    font-size: var(--font-size-lg);
    min-height: 48px;
}

.btn-secondary {
    background: var(--color-info);
}

.btn-secondary:hover {
    background: #5a9ee2;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--color-border-secondary);
    color: var(--color-text-muted);
}

.btn-outline:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
    background: rgba(0, 209, 197, 0.1);
}

/* --- Forms & Inputs --- */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    margin-bottom: var(--space-2);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-text-secondary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--input-padding);
    min-height: var(--input-min-height-mobile);
    background: var(--input-bg);
    border: var(--input-border);
    border-radius: var(--radius-base);
    color: var(--color-text-primary);
    font-family: var(--font-secondary);
    font-size: var(--font-size-base);
    transition: border-color var(--transition-fast), 
                box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(138, 43, 226, 0.2);
}

.form-input::placeholder {
    color: var(--color-text-disabled);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* ============================================================================
   6. RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Small phones (320px+) - Base styles above */

/* Medium phones (480px+) */
@media (min-width: 480px) {
    html { font-size: 16px; }
    
    h1 { font-size: var(--font-size-4xl); }
    h2 { font-size: var(--font-size-3xl); }
    h3 { font-size: var(--font-size-2xl); }
    
    .page-container {
        padding: var(--space-6);
    }
    
    .card {
        padding: var(--card-padding-tablet);
    }
}

/* Tablets portrait (768px+) */
@media (min-width: 768px) {
    h1 { font-size: var(--font-size-5xl); }
    h2 { font-size: var(--font-size-4xl); }
    
    .page-container {
        padding: var(--space-8);
    }
    
    .card {
        padding: var(--card-padding-desktop);
    }
    
    .container {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
    
    .btn {
        min-height: var(--button-min-height-desktop);
    }
}

/* Tablets landscape / Small laptops (1024px+) */
@media (min-width: 1024px) {
    .page-container {
        padding: var(--space-10);
    }
}

/* Desktop optimal (1440px+) */
@media (min-width: 1440px) {
    .container {
        max-width: var(--container-2xl);
    }
}

/* ============================================================================
   7. ACCESSIBILITY & TOUCH ENHANCEMENTS
   ============================================================================ */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid var(--color-border-focus);
    outline-offset: 2px;
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Ensure all interactive elements are touch-friendly */
    .btn,
    a,
    button,
    input,
    select,
    textarea {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================================
   END OF DESIGN SYSTEM
   ============================================================================ */
