/* Burnball - Main CSS */
/* Modern vanilla CSS with dark theme */

@layer reset, base, components, utilities;

/* ==============================================================================
   CSS Custom Properties (Design Tokens)
   ============================================================================== */

:root {
    /* Dark theme colors */
    --color-primary: oklch(65% 0.2 30);
    --color-primary-light: oklch(75% 0.15 30);
    --color-primary-dark: oklch(55% 0.25 30);
    
    --color-surface: oklch(15% 0.01 260);
    --color-surface-elevated: oklch(20% 0.01 260);
    --color-surface-hover: oklch(25% 0.01 260);
    
    --color-text: oklch(95% 0.01 260);
    --color-text-muted: oklch(75% 0.01 260);
    --color-text-faint: oklch(55% 0.01 260);
    
    --color-border: oklch(30% 0.01 260);
    --color-border-strong: oklch(40% 0.01 260);
    
    --color-success: oklch(65% 0.2 140);
    --color-success-bg: oklch(25% 0.08 140);
    --color-success-text: oklch(80% 0.12 140);
    
    --color-warning: oklch(70% 0.2 80);
    --color-warning-bg: oklch(25% 0.08 80);
    --color-warning-text: oklch(80% 0.12 80);
    
    --color-error: oklch(60% 0.25 25);
    --color-error-bg: oklch(25% 0.08 25);
    --color-error-text: oklch(80% 0.15 25);
    
    --color-info-bg: oklch(25% 0.04 250);
    --color-info-text: oklch(80% 0.08 250);
    
    /* Gray scale (dark theme) */
    --color-gray-50: oklch(98% 0.005 260);
    --color-gray-100: oklch(95% 0.005 260);
    --color-gray-200: oklch(90% 0.005 260);
    --color-gray-300: oklch(80% 0.005 260);
    --color-gray-400: oklch(65% 0.01 260);
    --color-gray-500: oklch(50% 0.01 260);
    --color-gray-600: oklch(40% 0.01 260);
    --color-gray-700: oklch(30% 0.015 260);
    --color-gray-800: oklch(20% 0.015 260);
    --color-gray-900: oklch(12% 0.015 260);
    
    /* Orange/primary for accent */
    --color-orange-500: oklch(70% 0.18 45);
    --color-orange-600: oklch(65% 0.2 45);
    --color-orange-700: oklch(55% 0.22 45);
    
    /* Typography */
    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
    
    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    
    /* Border radius */
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-2xl: 1rem;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.3);
    --shadow-md: 0 4px 6px oklch(0% 0 0 / 0.4), 0 2px 4px oklch(0% 0 0 / 0.3);
    --shadow-lg: 0 10px 15px oklch(0% 0 0 / 0.5), 0 4px 6px oklch(0% 0 0 / 0.3);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 200ms ease;
    --transition-slow: 300ms ease;
}

/* ==============================================================================
   Reset Layer
   ============================================================================== */

@layer reset {
    *, *::before, *::after {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
    }
    
    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    body {
        min-height: 100vh;
        line-height: 1.5;
    }
    
    img, picture, video, canvas, svg {
        display: block;
        max-width: 100%;
    }
    
    input, button, textarea, select {
        font: inherit;
        color: inherit;
        background-color: transparent;
    }
    
    p, h1, h2, h3, h4, h5, h6, span, div, label, a {
        color: inherit;
    }
    
    p, h1, h2, h3, h4, h5, h6 {
        overflow-wrap: break-word;
    }
    
    a {
        color: inherit;
        text-decoration: none;
    }
    
    button {
        background: none;
        border: none;
        cursor: pointer;
        color: inherit;
    }
    
    ul, ol {
        list-style: none;
    }
    
    svg {
        color: inherit;
    }
}

/* ==============================================================================
   Base Layer
   ============================================================================== */

@layer base {
    body {
        font-family: var(--font-sans);
        color: var(--color-text);
        background-color: var(--color-gray-900);
    }
    
    h1, h2, h3, h4, h5, h6 {
        font-weight: 700;
        line-height: 1.25;
    }
    
    h1 { font-size: 2.25rem; }
    h2 { font-size: 1.875rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    
    a {
        transition: color var(--transition-fast);
    }
    
    ::selection {
        background-color: var(--color-primary);
        color: white;
    }
    
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
        }
    }
}

/* ==============================================================================
   Component Layer
   ============================================================================== */

@layer components {
    :focus-visible {
        outline: 2px solid var(--color-primary);
        outline-offset: 2px;
    }
    
    :focus:not(:focus-visible) {
        outline: none;
    }
    
    /* Buttons */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-4);
        font-weight: 500;
        border-radius: var(--radius-md);
        transition: all var(--transition-fast);
    }
    
    .btn-primary {
        background-color: var(--color-orange-600);
        color: white;
        
        &:hover {
            background-color: var(--color-orange-700);
        }
    }
    
    .btn-secondary {
        background-color: var(--color-gray-700);
        color: var(--color-gray-100);
        
        &:hover {
            background-color: var(--color-gray-600);
        }
    }
    
    /* Nav links */
    .nav-link {
        color: var(--color-gray-300);
        font-weight: 500;
        transition: color var(--transition-fast);
        
        &:hover {
            color: white;
        }
    }
    
    .nav-link-active {
        color: white;
    }
    
    /* Cards */
    .card {
        background-color: var(--color-gray-800);
        border-radius: var(--radius-lg);
        padding: var(--space-6);
    }
    
    /* Form inputs */
    .form-input {
        width: 100%;
        padding: var(--space-2) var(--space-3);
        border: 1px solid var(--color-gray-600);
        border-radius: var(--radius-md);
        background-color: var(--color-gray-700);
        color: var(--color-text);
        transition: border-color var(--transition-fast);
        
        &:focus {
            outline: none;
            border-color: var(--color-primary);
            box-shadow: 0 0 0 2px oklch(from var(--color-primary) l c h / 0.2);
        }
        
        &::placeholder {
            color: var(--color-gray-400);
        }
    }
    
    /* Alerts */
    .alert {
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-md);
        font-size: 0.875rem;
    }
    
    .alert-success {
        background-color: var(--color-success-bg);
        color: var(--color-success-text);
    }
    
    .alert-error {
        background-color: var(--color-error-bg);
        color: var(--color-error-text);
    }
    
    .alert-warning {
        background-color: var(--color-warning-bg);
        color: var(--color-warning-text);
    }
    
    .alert-info {
        background-color: var(--color-info-bg);
        color: var(--color-info-text);
    }
}

/* ==============================================================================
   Utility Layer
   ============================================================================== */

@layer utilities {
    /* Display */
    .block { display: block; }
    .inline-block { display: inline-block; }
    .flex { display: flex; }
    .inline-flex { display: inline-flex; }
    .grid { display: grid; }
    .hidden { display: none; }
    
    /* Flex */
    .flex-col { flex-direction: column; }
    .flex-row { flex-direction: row; }
    .flex-wrap { flex-wrap: wrap; }
    .flex-1 { flex: 1 1 0%; }
    .flex-shrink-0 { flex-shrink: 0; }
    .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 */
    .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); }
    
    /* Spacing */
    .p-2 { padding: var(--space-2); }
    .p-3 { padding: var(--space-3); }
    .p-4 { padding: var(--space-4); }
    .p-6 { padding: var(--space-6); }
    .p-8 { padding: var(--space-8); }
    .px-2 { padding-inline: var(--space-2); }
    .px-3 { padding-inline: var(--space-3); }
    .px-4 { padding-inline: var(--space-4); }
    .px-6 { padding-inline: var(--space-6); }
    .px-8 { padding-inline: var(--space-8); }
    .py-1 { padding-block: var(--space-1); }
    .py-2 { padding-block: var(--space-2); }
    .py-3 { padding-block: var(--space-3); }
    .py-4 { padding-block: var(--space-4); }
    .py-6 { padding-block: var(--space-6); }
    .py-8 { padding-block: var(--space-8); }
    .py-12 { padding-block: var(--space-12); }
    .pt-16 { padding-top: var(--space-16); }
    
    .m-0 { margin: 0; }
    .mx-auto { margin-inline: auto; }
    .my-1 { margin-block: var(--space-1); }
    .my-2 { margin-block: var(--space-2); }
    .mt-1 { margin-top: var(--space-1); }
    .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-1 { margin-bottom: var(--space-1); }
    .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); }
    .mr-2 { margin-right: var(--space-2); }
    .ml-2 { margin-left: var(--space-2); }
    
    .space-y-2 > * + * { margin-top: var(--space-2); }
    .space-y-3 > * + * { margin-top: var(--space-3); }
    .space-y-4 > * + * { margin-top: var(--space-4); }
    .space-y-6 > * + * { margin-top: var(--space-6); }
    .space-x-2 > * + * { margin-left: var(--space-2); }
    .space-x-4 > * + * { margin-left: var(--space-4); }
    
    /* Width */
    .w-4 { width: 1rem; }
    .w-5 { width: 1.25rem; }
    .w-6 { width: 1.5rem; }
    .w-8 { width: 2rem; }
    .w-12 { width: 3rem; }
    .w-16 { width: 4rem; }
    .w-48 { width: 12rem; }
    .w-full { width: 100%; }
    .w-auto { width: auto; }
    .min-w-0 { min-width: 0; }
    .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-3xl { max-width: 48rem; }
    .max-w-4xl { max-width: 56rem; }
    .max-w-5xl { max-width: 64rem; }
    .max-w-6xl { max-width: 72rem; }
    .max-w-7xl { max-width: 80rem; }
    
    /* Height */
    .h-4 { height: 1rem; }
    .h-5 { height: 1.25rem; }
    .h-6 { height: 1.5rem; }
    .h-8 { height: 2rem; }
    .h-10 { height: 2.5rem; }
    .h-12 { height: 3rem; }
    .h-16 { height: 4rem; }
    .h-full { height: 100%; }
    .h-screen { height: 100vh; }
    .min-h-screen { min-height: 100vh; }
    
    /* Position */
    .relative { position: relative; }
    .absolute { position: absolute; }
    .fixed { position: fixed; }
    .sticky { position: sticky; }
    .inset-0 { inset: 0; }
    .top-0 { top: 0; }
    .top-4 { top: 1rem; }
    .top-16 { top: 4rem; }
    .right-0 { right: 0; }
    .right-4 { right: 1rem; }
    .bottom-0 { bottom: 0; }
    .bottom-4 { bottom: 1rem; }
    .left-0 { left: 0; }
    .left-1\/2 { left: 50%; }
    .-translate-x-1\/2 { transform: translateX(-50%); }
    .-translate-y-1\/2 { transform: translateY(-50%); }
    
    /* 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; }
    
    /* Typography */
    .text-xs { font-size: 0.75rem; line-height: 1rem; }
    .text-sm { font-size: 0.875rem; line-height: 1.25rem; }
    .text-base { font-size: 1rem; line-height: 1.5rem; }
    .text-lg { font-size: 1.125rem; line-height: 1.75rem; }
    .text-xl { font-size: 1.25rem; line-height: 1.75rem; }
    .text-2xl { font-size: 1.5rem; line-height: 2rem; }
    .text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
    .text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    
    .font-normal { font-weight: 400; }
    .font-medium { font-weight: 500; }
    .font-semibold { font-weight: 600; }
    .font-bold { font-weight: 700; }
    
    .text-left { text-align: left; }
    .text-center { text-align: center; }
    .text-right { text-align: right; }
    
    .leading-tight { line-height: 1.25; }
    .leading-normal { line-height: 1.5; }
    .leading-relaxed { line-height: 1.625; }
    
    .tracking-tight { letter-spacing: -0.025em; }
    .tracking-wide { letter-spacing: 0.025em; }
    
    .truncate {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .whitespace-nowrap { white-space: nowrap; }
    .whitespace-pre-wrap { white-space: pre-wrap; }
    
    /* Colors - Gray */
    .text-white { color: white; }
    .text-gray-50 { color: var(--color-gray-50); }
    .text-gray-100 { color: var(--color-gray-100); }
    .text-gray-200 { color: var(--color-gray-200); }
    .text-gray-300 { color: var(--color-gray-300); }
    .text-gray-400 { color: var(--color-gray-400); }
    .text-gray-500 { color: var(--color-gray-500); }
    .text-gray-600 { color: var(--color-gray-600); }
    
    .bg-white { background-color: white; }
    .bg-gray-700 { background-color: var(--color-gray-700); }
    .bg-gray-800 { background-color: var(--color-gray-800); }
    .bg-gray-900 { background-color: var(--color-gray-900); }
    
    /* Colors - Primary/Orange */
    .text-orange-500 { color: var(--color-orange-500); }
    .text-orange-600 { color: var(--color-orange-600); }
    .bg-orange-500 { background-color: var(--color-orange-500); }
    .bg-orange-600 { background-color: var(--color-orange-600); }
    .bg-orange-700 { background-color: var(--color-orange-700); }
    
    /* Colors - Status */
    .text-green-400 { color: oklch(75% 0.18 140); }
    .text-green-500 { color: var(--color-success); }
    .text-red-400 { color: oklch(70% 0.2 25); }
    .text-red-500 { color: var(--color-error); }
    .text-yellow-400 { color: oklch(80% 0.18 90); }
    .text-yellow-500 { color: var(--color-warning); }
    .text-blue-400 { color: oklch(70% 0.15 250); }
    .text-blue-500 { color: oklch(60% 0.2 250); }
    
    .bg-green-500 { background-color: var(--color-success); }
    .bg-green-600 { background-color: oklch(55% 0.2 140); }
    .bg-red-500 { background-color: var(--color-error); }
    .bg-red-600 { background-color: oklch(50% 0.25 25); }
    
    /* Borders */
    .border { border: 1px solid var(--color-border); }
    .border-0 { border: 0; }
    .border-t { border-top: 1px solid var(--color-border); }
    .border-b { border-bottom: 1px solid var(--color-border); }
    .border-l { border-left: 1px solid var(--color-border); }
    .border-r { border-right: 1px solid var(--color-border); }
    .border-gray-600 { border-color: var(--color-gray-600); }
    .border-gray-700 { border-color: var(--color-gray-700); }
    
    .rounded { border-radius: var(--radius-sm); }
    .rounded-md { border-radius: var(--radius-md); }
    .rounded-lg { border-radius: var(--radius-lg); }
    .rounded-xl { border-radius: var(--radius-xl); }
    .rounded-2xl { border-radius: var(--radius-2xl); }
    .rounded-full { border-radius: var(--radius-full); }
    
    /* Shadows */
    .shadow { box-shadow: var(--shadow-md); }
    .shadow-sm { box-shadow: var(--shadow-sm); }
    .shadow-lg { box-shadow: var(--shadow-lg); }
    
    /* Overflow */
    .overflow-hidden { overflow: hidden; }
    .overflow-auto { overflow: auto; }
    .overflow-y-auto { overflow-y: auto; }
    .overflow-x-hidden { overflow-x: hidden; }
    
    /* Opacity */
    .opacity-0 { opacity: 0; }
    .opacity-50 { opacity: 0.5; }
    .opacity-75 { opacity: 0.75; }
    .opacity-100 { opacity: 1; }
    
    /* Transitions */
    .transition { transition: all var(--transition-normal); }
    .transition-colors { 
        transition-property: color, background-color, border-color;
        transition-duration: 150ms;
    }
    .transition-opacity { transition: opacity var(--transition-normal); }
    .transition-transform { transition: transform var(--transition-normal); }
    .duration-150 { transition-duration: 150ms; }
    .duration-200 { transition-duration: 200ms; }
    .duration-300 { transition-duration: 300ms; }
    
    /* Transforms */
    .transform { transform: translateX(0); }
    .scale-95 { transform: scale(0.95); }
    .scale-100 { transform: scale(1); }
    
    /* Cursor */
    .cursor-pointer { cursor: pointer; }
    .cursor-not-allowed { cursor: not-allowed; }
    
    /* Pointer events */
    .pointer-events-none { pointer-events: none; }
    .pointer-events-auto { pointer-events: auto; }
    
    /* Select */
    .select-none { user-select: none; }
    
    /* Object fit */
    .object-cover { object-fit: cover; }
    .object-contain { object-fit: contain; }
    
    /* Screen reader */
    .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;
    }
    
    /* Antialiased */
    .antialiased {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Focus */
    .focus\:outline-none:focus { outline: none; }
    .focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--color-primary); }
    
    /* Hover states */
    .hover\:text-white:hover { color: white; }
    .hover\:text-gray-100:hover { color: var(--color-gray-100); }
    .hover\:bg-gray-600:hover { background-color: var(--color-gray-600); }
    .hover\:bg-gray-700:hover { background-color: var(--color-gray-700); }
    .hover\:bg-gray-800:hover { background-color: var(--color-gray-800); }
    .hover\:bg-orange-700:hover { background-color: var(--color-orange-700); }
    
    /* 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)); }
    
    /* Animations */
    .animate-spin {
        animation: spin 1s linear infinite;
    }
    
    .animate-pulse {
        animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    }
    
    @keyframes spin {
        from { transform: rotate(0deg); }
        to { transform: rotate(360deg); }
    }
    
    @keyframes pulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.5; }
    }
}

/* ==============================================================================
   Responsive Variants
   ============================================================================== */

@media (min-width: 640px) {
    .sm\:px-6 { padding-inline: var(--space-6); }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\:hidden { display: none; }
    .md\:flex { display: flex; }
    .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\:px-8 { padding-inline: var(--space-8); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
