/*
 * MotorcycleDealer.com Design System
 *
 * Color Palette inspired by motorcycle culture:
 * - Deep blacks and metallics (frames, engines)
 * - Orange/amber accents (warning lights, sunsets on the road)
 * - Clean whites and grays (chrome, aluminum)
 * - Rich shadows for depth
 */

:root {
    /* Color System - Old School Neutral */
    --color-primary: #2d4a2b; /* Deep forest green - classic, trustworthy */
    --color-primary-dark: #1e3220; /* Darker green for hover states */
    --color-primary-light: #4a6b47; /* Lighter green for backgrounds */
    --color-secondary: #3a3a3a; /* Charcoal - motorcycle frames */
    --color-secondary-dark: #1f1f1f; /* Near black - premium feel */
    --color-secondary-light: #525252; /* Medium gray */
    --color-accent: #8b7355; /* Warm bronze - vintage metallic */
    --color-success: #4a7c59; /* Muted green - available, certified */
    --color-warning: #d4a574; /* Muted amber - attention */
    --color-danger: #a64b3a; /* Muted rust red - urgency */
    --color-text-primary: #2b2b2b; /* Near black for body text */
    --color-text-secondary: #5e5e5e; /* Gray for secondary text */
    --color-text-tertiary: #8a8a8a; /* Light gray for subtle text */
    --color-text-inverse: #f5f5f5; /* Off-white text on dark backgrounds */
    --color-bg-primary: #fafafa; /* Soft white */
    --color-bg-secondary: #f5f5f5; /* Light gray-white */
    --color-bg-tertiary: #ebebeb; /* Light gray */
    --color-bg-dark: #1f1f1f; /* Dark backgrounds */
    --color-border: #d4d4d4; /* Standard borders */
    --color-border-dark: #b8b8b8; /* Darker borders */
    /* Spacing Scale (8px base) */
    --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 */

    /* Typography */
    --font-sans:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, sans-serif;
    --font-mono:
        ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas,
        monospace;

    --text-xs: 0.75rem; /* 12px */
    --text-sm: 0.875rem; /* 14px */
    --text-base: 1rem; /* 16px */
    --text-lg: 1.125rem; /* 18px */
    --text-xl: 1.25rem; /* 20px */
    --text-2xl: 1.5rem; /* 24px */
    --text-3xl: 1.875rem; /* 30px */
    --text-4xl: 2.25rem; /* 36px */
    --text-5xl: 3rem; /* 48px */

    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;

    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.75;

    /* Border Radius */
    --radius-sm: 0.25rem; /* 4px */
    --radius-md: 0.375rem; /* 6px */
    --radius-lg: 0.5rem; /* 8px */
    --radius-xl: 0.75rem; /* 12px */
    --radius-2xl: 1rem; /* 16px */
    --radius-full: 9999px; /* Circular */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md:
        0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg:
        0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl:
        0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

    /* Transitions */
    --transition-fast: 150ms 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);

    /* Z-index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text-primary);
    background-color: var(--color-bg-secondary);
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-text-primary);
}

h1 {
    font-size: var(--text-4xl);
    margin-bottom: var(--space-6);
}

h2 {
    font-size: var(--text-3xl);
    margin-bottom: var(--space-5);
}

h3 {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
}

h4 {
    font-size: var(--text-xl);
    margin-bottom: var(--space-3);
}

p {
    margin-bottom: var(--space-4);
}

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

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

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utility Classes */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--space-5);
}

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

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

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

.font-mono {
    font-family: var(--font-mono);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    line-height: 1;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
}

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

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

.btn-primary:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

.btn-secondary:hover {
    background-color: var(--color-secondary-light);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

/* Cards */
.card {
    background-color: var(--color-bg-primary);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all var(--transition-base);
}

.card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--color-primary-light);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--color-border);
}

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

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--color-border);
    background-color: var(--color-bg-secondary);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-semibold);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

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

.badge-success {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

/* Price Display */
.price {
    font-size: var(--text-2xl);
    font-weight: var(--font-bold);
    color: var(--color-success);
    font-feature-settings: "tnum";
    font-variant-numeric: tabular-nums;
}

.price-large {
    font-size: var(--text-3xl);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: var(--space-6);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Loading States */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-tertiary) 0%,
        var(--color-bg-secondary) 50%,
        var(--color-bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

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

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

@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;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }

    .site-header,
    .site-footer,
    .btn {
        display: none !important;
    }

    a {
        text-decoration: underline;
        color: black;
    }

    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Responsive Typography */
@media (max-width: 768px) {
    :root {
        --text-4xl: 2rem; /* 32px on mobile */
        --text-3xl: 1.5rem; /* 24px on mobile */
        --text-2xl: 1.25rem; /* 20px on mobile */
    }

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

/* Dark Mode Support (future enhancement) */
@media (prefers-color-scheme: dark) {
    /* Uncomment when ready to implement dark mode
  :root {
    --color-bg-primary: #1f2937;
    --color-bg-secondary: #111827;
    --color-text-primary: #f9fafb;
    --color-text-secondary: #d1d5db;
    --color-border: #374151;
  }
  */
}

/* Selection Color */
::selection {
    background-color: var(--color-primary-light);
    color: var(--color-text-primary);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-text-tertiary);
    border-radius: var(--radius-lg);
    border: 2px solid var(--color-bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}
