/* Base CSS - Variables, Reset, Typography, Utilities */

/* ============================================
   CSS Variables (Theme)
   ============================================ */
:root {
    /* Colors - Light Theme (HSL values) */
    --background: 0 0% 100%;
    --foreground: 222.2 84% 4.9%;
    --background-alt: 210 40% 98%;

    --muted: 210 40% 96.1%;
    --muted-foreground: 220 16% 50%;

    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;

    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;

    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;

    --primary: 256 88% 65%;
    --primary-foreground: 263 100% 96%;

    --secondary: 21 100% 50%;
    --secondary-foreground: 14 40% 92%;

    --accent: 256 88% 65%;
    --accent-foreground: 263 100% 96%;

    --destructive: 0 62.9% 34.9%;
    --destructive-foreground: 0 93.3% 94.1%;

    --warning: 22.2 78.4% 29%;
    --warning-foreground: 27.7 76.5% 93.3%;

    --success: 120 100% 26.1%;
    --success-foreground: 135.7 92% 95.1%;

    --info: 225.9 70.7% 40.2%;
    --info-foreground: 214.3 94.6% 92.7%;

    --ring: 220 3% 78%;
    --radius: 0.5rem;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Font sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;

    /* Transitions */
    --transition-fast: 150ms;
    --transition-normal: 200ms;
    --transition-slow: 300ms;
}

/* Dark Theme */
.dark {
    --background: 222.2 84% 4.9%;
    --foreground: 210 40% 98%;
    --background-alt: 217.2 32.6% 12%;

    --muted: 217.2 32.6% 17.5%;
    --muted-foreground: 215 20.2% 65.1%;

    --popover: 222.2 84% 4.9%;
    --popover-foreground: 210 40% 98%;

    --card: 222.2 84% 4.9%;
    --card-foreground: 210 40% 98%;

    --border: 217.2 32.6% 17.5%;
    --input: 217.2 32.6% 17.5%;

    --primary: 261 98% 66%;
    --primary-foreground: 251 46% 93%;

    --secondary: 21 100% 50%;
    --secondary-foreground: 14 40% 92%;

    --accent: 261 98% 66%;
    --accent-foreground: 263 100% 96%;

    --ring: 212.7 26.8% 83.9%;
}

/* ============================================
   CSS Reset
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: var(--text-sm);
    line-height: 1.5;
    background-color: hsl(var(--background-alt));
    color: hsl(var(--foreground));
}

img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

button, input, select, textarea {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

ul, ol {
    list-style: none;
}

/* ============================================
   Typography
   ============================================ */
h1 {
    font-size: var(--text-2xl);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: hsl(var(--foreground));
}

h2 {
    font-size: var(--text-xl);
    font-weight: 400;
    color: hsl(220 16% 35%);
}

h3 {
    font-size: var(--text-lg);
    font-weight: 500;
    color: hsl(var(--foreground));
}

h4 {
    font-size: var(--text-base);
    font-weight: 500;
    color: hsl(var(--foreground));
}

p {
    margin-bottom: var(--spacing-md);
}

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }

.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-muted { color: hsl(var(--muted-foreground)); }
.text-primary { color: hsl(var(--primary)); }
.text-secondary { color: hsl(var(--secondary)); }
.text-success { color: hsl(var(--success)); }
.text-warning { color: hsl(var(--warning)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-info { color: hsl(var(--info)); }

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* ============================================
   Utility Classes
   ============================================ */

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Flexbox */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.flex-1 { flex: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* 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)); }

/* Spacing */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-4 { margin: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-4 { margin-right: 1rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-4 { margin-top: 1rem; margin-bottom: 1rem; }

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.pt-4 { padding-top: 1rem; }
.pb-4 { padding-bottom: 1rem; }

/* Width & Height */
.w-full { width: 100%; }
.w-auto { width: auto; }
.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; }
.min-h-screen { min-height: 100vh; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }

/* Border Radius */
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: calc(var(--radius) - 4px); }
.rounded-md { border-radius: calc(var(--radius) - 2px); }
.rounded-lg { border-radius: var(--radius); }
.rounded-xl { border-radius: calc(var(--radius) + 4px); }
.rounded-2xl { border-radius: calc(var(--radius) + 8px); }
.rounded-full { border-radius: 9999px; }

/* Borders */
.border { border: 1px solid hsl(var(--border)); }
.border-0 { border: none; }
.border-t { border-top: 1px solid hsl(var(--border)); }
.border-b { border-bottom: 1px solid hsl(var(--border)); }
.border-l { border-left: 1px solid hsl(var(--border)); }
.border-r { border-right: 1px solid hsl(var(--border)); }

/* Backgrounds */
.bg-background { background-color: hsl(var(--background)); }
.bg-background-alt { background-color: hsl(var(--background-alt)); }
.bg-muted { background-color: hsl(var(--muted)); }
.bg-card { background-color: hsl(var(--card)); }
.bg-primary { background-color: hsl(var(--primary)); }
.bg-primary-10 { background-color: hsl(var(--primary) / 0.1); }
.bg-secondary { background-color: hsl(var(--secondary)); }
.bg-secondary-10 { background-color: hsl(var(--secondary) / 0.1); }
.bg-success { background-color: hsl(var(--success)); }
.bg-success-10 { background-color: hsl(var(--success) / 0.1); }
.bg-warning { background-color: hsl(var(--warning)); }
.bg-warning-10 { background-color: hsl(var(--warning) / 0.1); }
.bg-destructive { background-color: hsl(var(--destructive)); }
.bg-info { background-color: hsl(var(--info)); }
.bg-info-10 { background-color: hsl(var(--info) / 0.1); }
.bg-white { background-color: #fff; }
.bg-transparent { background-color: transparent; }

/* Shadows */
.shadow { box-shadow: 0 1px 3px 0 rgba(0,0,0,0.1), 0 1px 2px -1px rgba(0,0,0,0.1); }
.shadow-md { box-shadow: 0 2px 10px 0px rgba(0,0,0,0.1); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1); }
.shadow-none { box-shadow: none; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* Z-index */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-default { cursor: default; }
.cursor-not-allowed { cursor: not-allowed; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.opacity-100 { opacity: 1; }

/* Transitions */
.transition { transition: all var(--transition-fast) ease-in-out; }
.transition-colors { transition: color var(--transition-fast) ease-in-out, background-color var(--transition-fast) ease-in-out, border-color var(--transition-fast) ease-in-out; }
.transition-opacity { transition: opacity var(--transition-fast) ease-in-out; }
.transition-transform { transition: transform var(--transition-fast) ease-in-out; }

/* Transforms */
.rotate-180 { transform: rotate(180deg); }

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus Ring */
.focus-ring:focus {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.focus-visible:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

/* ============================================
   Icons
   ============================================ */
.icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.icon-sm {
    width: 1rem;
    height: 1rem;
}

.icon-lg {
    width: 1.5rem;
    height: 1.5rem;
}

.icon-xl {
    width: 2rem;
    height: 2rem;
}

svg.icon {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============================================
   Responsive Utilities
   ============================================ */
@media (min-width: 640px) {
    .sm\:flex { display: flex; }
    .sm\:hidden { display: none; }
    .sm\:block { display: block; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:block { display: block; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:flex-row { flex-direction: row; }
}

@media (min-width: 1024px) {
    .lg\:flex { display: flex; }
    .lg\:hidden { display: none; }
    .lg\:block { display: block; }
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Print styles */
@media print {
    .print\:hidden { display: none !important; }
}
