/* ============================================================================
   RESIQO DESIGN SYSTEM
   Color palette, typography, and CSS custom properties
   ============================================================================ */

:root {
    /* ========== Colors ========== */
    --color-primary: #3b82f6;
    --color-primary-dark: #2563eb;
    --color-primary-light: #60a5fa;

    --color-success: #10b981;
    --color-success-dark: #059669;
    --color-success-light: #34d399;

    --color-warning: #f97316;
    --color-warning-dark: #ea580c;
    --color-warning-light: #fb923c;

    --color-danger: #ef4444;
    --color-danger-dark: #dc2626;
    --color-danger-light: #f87171;

    --color-info: #06b6d4;

    /* Neutrals */
    --color-dark: #1e293b;        /* Dark slate - sidebar, headers */
    --color-dark-light: #334155;  /* Slate-700 - hover states */
    --color-slate: #475569;       /* Slate-600 - secondary text */
    --color-slate-light: #64748b; /* Slate-500 - labels, hints */
    --color-gray: #cbd5e1;        /* Slate-300 - borders */
    --color-gray-light: #e2e8f0;  /* Slate-200 - subtle backgrounds */
    --color-bg: #f1f5f9;          /* Slate-100 - main bg */
    --color-white: #ffffff;       /* White - cards, surfaces */

    /* ========== Typography ========== */
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", 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-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;

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

    /* ========== Spacing ========== */
    --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: 2.5rem;   /* 40px */
    --spacing-3xl: 3rem;     /* 48px */

    /* ========== Border Radius ========== */
    --radius-sm: 0.375rem;   /* 6px */
    --radius-md: 0.5rem;     /* 8px */
    --radius-lg: 0.75rem;    /* 12px */
    --radius-full: 9999px;   /* Full circle */

    /* ========== Shadows ========== */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);

    /* ========== Z-index ========== */
    --z-dropdown: 1000;
    --z-sticky: 1050;
    --z-fixed: 1060;
    --z-modal-backdrop: 1070;
    --z-modal: 1080;
    --z-popover: 1090;
    --z-tooltip: 1100;

    /* ========== Transitions ========== */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 200ms ease-in-out;
    --transition-slow: 300ms ease-in-out;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-slate);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--spacing-md) 0;
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    color: var(--color-dark);
}

h1 {
    font-size: var(--font-size-3xl);
}

h2 {
    font-size: var(--font-size-2xl);
}

h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
}

h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
}

h5 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-semibold);
}

h6 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

p {
    margin: 0 0 var(--spacing-md) 0;
}

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

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

/* ============================================================================
   UTILITY CLASSES
   ============================================================================ */

.text-muted {
    color: var(--color-slate-light);
}

.text-dark {
    color: var(--color-dark);
}

.text-primary {
    color: var(--color-primary);
}

.text-success {
    color: var(--color-success);
}

.text-warning {
    color: var(--color-warning);
}

.text-danger {
    color: var(--color-danger);
}

.text-info {
    color: var(--color-info);
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

/* Display utilities */
.d-none {
    display: none;
}

.d-block {
    display: block;
}

.d-inline {
    display: inline;
}

.d-inline-block {
    display: inline-block;
}

.d-flex {
    display: flex;
}

.d-grid {
    display: grid;
}

.gap-1 { gap: var(--spacing-sm); }
.gap-2 { gap: var(--spacing-md); }
.gap-3 { gap: var(--spacing-lg); }
.gap-4 { gap: var(--spacing-xl); }

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    flex-direction: column;
}

.flex-wrap {
    flex-wrap: wrap;
}

.flex-1 {
    flex: 1;
}

/* Alignment utilities */
.align-items-center {
    align-items: center;
}

.align-items-start {
    align-items: flex-start;
}

.align-items-end {
    align-items: flex-end;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-end {
    justify-content: flex-end;
}

/* Margin utilities */
.m-0 { margin: 0; }
.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }

.ml-1 { margin-left: var(--spacing-sm); }
.ml-2 { margin-left: var(--spacing-md); }
.ml-3 { margin-left: var(--spacing-lg); }

.mr-1 { margin-right: var(--spacing-sm); }
.mr-2 { margin-right: var(--spacing-md); }
.mr-3 { margin-right: var(--spacing-lg); }

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Padding utilities */
.p-0 { padding: 0; }
.p-1 { padding: var(--spacing-sm); }
.p-2 { padding: var(--spacing-md); }
.p-3 { padding: var(--spacing-lg); }
.p-4 { padding: var(--spacing-xl); }

.px-1 { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-2 { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.px-3 { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }

.py-1 { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-2 { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-3 { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }

/* Width utilities */
.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

/* Height utilities */
.h-full {
    height: 100%;
}

.h-auto {
    height: auto;
}

/* Max width utilities */
.max-w-sm {
    max-width: 24rem;
}

.max-w-md {
    max-width: 28rem;
}

.max-w-lg {
    max-width: 32rem;
}

.max-w-xl {
    max-width: 36rem;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.max-w-6xl {
    max-width: 72rem;
}

.max-w-7xl {
    max-width: 80rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

/* Overflow utilities */
.overflow-auto {
    overflow: auto;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

/* Border utilities */
.border {
    border: 1px solid var(--color-gray);
}

.border-t {
    border-top: 1px solid var(--color-gray);
}

.border-b {
    border-bottom: 1px solid var(--color-gray);
}

.border-l {
    border-left: 1px solid var(--color-gray);
}

.border-r {
    border-right: 1px solid var(--color-gray);
}

.border-primary {
    border-color: var(--color-primary);
}

.border-danger {
    border-color: var(--color-danger);
}

/* Rounded utilities */
.rounded {
    border-radius: var(--radius-md);
}

.rounded-sm {
    border-radius: var(--radius-sm);
}

.rounded-lg {
    border-radius: var(--radius-lg);
}

.rounded-full {
    border-radius: var(--radius-full);
}

/* Shadow utilities */
.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow-md {
    box-shadow: var(--shadow-md);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

/* Background utilities */
.bg-white {
    background-color: var(--color-white);
}

.bg-light {
    background-color: var(--color-bg);
}

.bg-primary {
    background-color: var(--color-primary);
}

.bg-success {
    background-color: var(--color-success);
}

.bg-warning {
    background-color: var(--color-warning);
}

.bg-danger {
    background-color: var(--color-danger);
}

/* ============================================================================
   RESPONSIVE UTILITIES
   ============================================================================ */

@media (max-width: 640px) {
    .sm\:hidden {
        display: none;
    }

    .sm\:block {
        display: block;
    }

    .sm\:flex {
        display: flex;
    }

    .sm\:w-full {
        width: 100%;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .md\:w-1\/2 {
        width: 50%;
    }

    .md\:flex {
        display: flex;
    }
}

@media (min-width: 1025px) {
    .lg\:w-1\/3 {
        width: 33.333%;
    }

    .lg\:w-1\/2 {
        width: 50%;
    }

    .lg\:flex {
        display: flex;
    }
}

/* ============================================================================
   ACCESSIBILITY
   ============================================================================ */

/* Focus visible styles */
*:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

/* Skip to main content link (for screen readers) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.sr-only:focus-visible {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    padding: var(--spacing-md);
    background-color: var(--color-primary);
    color: var(--color-white);
}
