/* ===================================
   SkyRent Design System
   Premium UI without Bootstrap
   ================================== */

/* ===================================
   1. CSS Custom Properties (Design Tokens)
   ================================== */
:root {
    /* Brand Colors - Raw Values */
    --color-brand-navy: #0F2A44;    /* Main Brand Color */
    --color-brand-gray: #4A4F55;    /* Secondary / Text */
    --color-brand-beige: #E6D8C3;   /* Surface / Warmth */
    --color-brand-sage: #5F7D6E;    /* Auxiliary */
    --color-brand-orange: #D97A2B;  /* Accent */

    /* Primary Colors (Branded Navy Scale)
       Generated from #0F2A44 base
    */
    --color-primary-50: #eef3f9;
    --color-primary-100: #d5e0ec;
    --color-primary-200: #aec5db;
    --color-primary-300: #7da2c4;
    --color-primary-400: #5582ab;
    --color-primary-500: #38648f;
    --color-primary-600: #2b5075;
    --color-primary-700: #22405e;
    --color-primary-800: #1b354e;
    --color-primary-900: #0F2A44; /* Brand Navy used as darkest primary */

    /* Accent Palette (Orange) for specialized buttons/CTAs */
    --color-accent-50: #fdf5ec;
    --color-accent-100: #fae7cf;
    --color-accent-200: #f5d0a0;
    --color-accent-300: #efb16e;
    --color-accent-400: #e99041;
    --color-accent-500: #D97A2B; /* Brand Orange */
    --color-accent-600: #b95d1f;
    --color-accent-700: #95451a;
    --color-accent-800: #783819;
    --color-accent-900: #422112;

    /* Secondary Colors (Neutral / Warm Gray Scale from #4A4F55) */
    --color-secondary-50: #f7f7f6;
    --color-secondary-100: #edeceb;
    --color-secondary-200: #dcdbd9;
    --color-secondary-300: #c1c0bd;
    --color-secondary-400: #9e9d99;
    --color-secondary-500: #787774;
    --color-secondary-600: #5e5d5a;
    --color-secondary-700: #4A4F55; /* Brand Gray */
    --color-secondary-800: #3a3d40;
    --color-secondary-900: #27292b;
    --color-secondary-950: #1a1b1c;
    
    /* Semantic Colors Refined */
    --color-surface: #ffffff;
    --color-surface-alt: #fdfaf5; /* Very light beige tint */
    --color-surface-secondary: #f4f4f5;
    --color-surface-tertiary: var(--color-brand-beige); /* The Beige Brand Color */
    
    --color-text: var(--color-secondary-900);
    --color-text-primary: var(--color-secondary-900); /* Dark Gray/Black */
    --color-text-secondary: var(--color-secondary-700); /* Brand Gray */
    --color-text-tertiary: var(--color-brand-sage); /* Using Sage for muted/tertiary text can be nice */
    --color-text-muted: var(--color-secondary-500);
    --color-text-inverted: #ffffff;
    
    --color-border: var(--color-secondary-200);
    --color-border-light: var(--color-secondary-100);
    --color-border-hover: var(--color-secondary-300);
    --color-border-focus: var(--color-brand-orange); /* Focus ring is orange accent */

    /* Overriding Primary Action Colors to be Orange based on "Accent" usage */
    /* This changes buttons, links, etc to use the Orange scale instead of Navy scale, which is common for "Primary Action" */
    
    /* Re-mapping 'primary' for components if we want Orange Buttons */
    /* If you prefer Navy Buttons, keep the mapping above. 
       If you prefer Orange Buttons as "Primary", we should swap variables below */
    
    /* STRATEGY: 
       Headings/Text/Hero BG -> Navy (Brand)
       Buttons/Links/Active -> Orange (Accent)
    */
    
    /* Status Colors */
    --color-success-50: #ecfdf5;
    --color-success-100: #d1fae5;
    --color-success-200: #a7f3d0;
    --color-success-300: #6ee7b7;
    --color-success-400: #34d399;
    --color-success-500: #10b981;
    --color-success-600: #059669;
    --color-success-700: #047857;
    
    --color-warning-50: #fffbeb;
    --color-warning-100: #fef3c7;
    --color-warning-200: #fde68a;
    --color-warning-300: #fcd34d;
    --color-warning-400: #fbbf24;
    --color-warning-500: #f59e0b;
    --color-warning-600: #d97706;
    --color-warning-700: #b45309;
    
    --color-error-50: #fef2f2;
    --color-error-100: #fee2e2;
    --color-error-500: #ef4444;
    --color-error-600: #dc2626;
    --color-error-700: #b91c1c;
    
    --color-info-50: #eff6ff;
    --color-info-100: #dbeafe;
    --color-info-500: #3b82f6;
    --color-info-600: #2563eb;
    
    /* Accent / Brand */
    --color-accent: var(--color-brand-orange);
    --color-accent-light: var(--color-accent-400);
    --color-accent-dark: var(--color-accent-600);
    --color-sage: var(--color-brand-sage);
    
    /* Spacing Scale */
    --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 */
    
    /* Typography Scale */
    --font-family-base: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    --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 */
    --font-size-6xl: 3.75rem;   /* 60px */
    
    --line-height-none: 1;
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;
    
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    
    --letter-spacing-tighter: -0.05em;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    
    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-xl: 1rem;       /* 16px */
    --radius-2xl: 1.25rem;   /* 20px */
    --radius-3xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;   /* Pills */
    
    /* Shadows (Modern, Soft) */
    --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.03);
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.04), 0 1px 2px -1px rgb(0 0 0 / 0.03);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.03);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.05), 0 4px 6px -4px rgb(0 0 0 / 0.03);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.05), 0 8px 10px -6px rgb(0 0 0 / 0.02);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.15);
    --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.03);
    
    /* Colored Shadows */
    --shadow-primary-sm: 0 2px 8px 0 rgb(37 99 235 / 0.15);
    --shadow-primary-md: 0 4px 14px 0 rgb(37 99 235 / 0.25);
    --shadow-primary: 0 4px 14px 0 rgb(37 99 235 / 0.25);
    --shadow-success: 0 4px 14px 0 rgb(16 185 129 / 0.25);
    --shadow-error: 0 4px 14px 0 rgb(239 68 68 / 0.25);
    
    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slower: 500ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-overlay: 1040;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* Container Widths */
    --container-sm: 640px;
    --container-md: 768px;
    --container-lg: 1140px;
    --container-xl: 1320px;
    --container-2xl: 1600px;
    
    /* Layout */
    --header-height: 72px;
}

/* Dark Mode Variables (optional - can enable later) */
@media (prefers-color-scheme: dark) {
    :root.dark-mode {
        --color-surface: var(--color-secondary-900);
        --color-surface-secondary: var(--color-secondary-800);
        --color-surface-tertiary: var(--color-secondary-700);
        --color-text-primary: var(--color-secondary-50);
        --color-text-secondary: var(--color-secondary-300);
        --color-text-tertiary: var(--color-secondary-400);
        --color-border: var(--color-secondary-700);
        --color-border-light: var(--color-secondary-800);
    }
}

/* ===================================
   2. CSS Reset & Base Styles
   ================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-display);
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--color-text-primary);
    letter-spacing: var(--letter-spacing-tight);
}

h1 { font-size: var(--font-size-4xl); font-weight: var(--font-weight-bold); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); font-weight: var(--font-weight-medium); }

p {
    color: var(--color-text-secondary);
    margin-bottom: var(--space-4);
}

p:last-child {
    margin-bottom: 0;
}

small, .text-small {
    font-size: var(--font-size-sm);
}

.text-xs {
    font-size: var(--font-size-xs);
}

.text-lg {
    font-size: var(--font-size-lg);
}

.text-muted {
    color: var(--color-text-muted);
}

.text-secondary {
    color: var(--color-text-secondary);
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-brand-orange);
}

/* Images */
img, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Lists */
ul, ol {
    list-style: none;
}

/* Form Elements Base */
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

/* Focus Visible */
:focus-visible {
    outline: 2px solid var(--color-brand-orange);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background-color: var(--color-accent-100);
    color: var(--color-brand-navy);
}

/* ===================================
   3. Layout Utilities
   ================================== */
.container {
    width: 100%;
    max-width: var(--container-2xl);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-4);
    padding-right: var(--space-4);
}

@media (min-width: 640px) {
    .container {
        padding-left: var(--space-6);
        padding-right: var(--space-6);
    }
}

@media (min-width: 1024px) {
    .container {
        padding-left: var(--space-8);
        padding-right: var(--space-8);
    }
}

.container-sm { max-width: var(--container-sm); }
.container-md { max-width: var(--container-md); }
.container-lg { max-width: var(--container-lg); }

/* Section Spacing */
.section {
    padding-top: var(--space-16);
    padding-bottom: var(--space-16);
}

.section-sm {
    padding-top: var(--space-8);
    padding-bottom: var(--space-8);
}

.section-lg {
    padding-top: var(--space-24);
    padding-bottom: var(--space-24);
}

/* Flexbox Utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.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-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, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Visibility */
.hidden { display: none; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

@media (min-width: 640px) {
    .sm\:hidden { display: none; }
    .sm\:block { display: block; }
    .sm\:flex { display: flex; }
}
@media (min-width: 768px) {
    .md\:hidden { display: none; }
    .md\:block { display: block; }
    .md\:flex { display: flex; }
}
@media (min-width: 1024px) {
    .lg\:hidden { display: none; }
    .lg\:block { display: block; }
    .lg\:flex { display: flex; }
}
