/* EMMA18 - OpenRouter Design System Clone */

:root {
    --background: 0 0% 100%;
    --foreground: 0 0% 3.9%;
    --card: 0 0% 100%;
    --card-foreground: 0 0% 3.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 0 0% 3.9%;
    --primary: 0 0% 9%;
    --primary-foreground: 0 0% 98%;
    --secondary: 0 0% 96.1%;
    --secondary-foreground: 0 0% 9%;
    --muted: 0 0% 96.1%;
    --muted-foreground: 0 0% 45.1%;
    --accent: 0 0% 96.1%;
    --accent-foreground: 0 0% 9%;
    --destructive: 0 84.2% 60.2%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 89.8%;
    --input: 0 0% 89.8%;
    --ring: 0 0% 3.9%;
    --radius: 0.5rem;
}

.dark {
    --background: 0 0% 3.9%;
    --foreground: 0 0% 98%;
    --card: 0 0% 5%;
    --card-foreground: 0 0% 98%;
    --popover: 0 0% 5%;
    --popover-foreground: 0 0% 98%;
    --primary: 0 0% 98%;
    --primary-foreground: 0 0% 9%;
    --secondary: 0 0% 14.9%;
    --secondary-foreground: 0 0% 98%;
    --muted: 0 0% 14.9%;
    --muted-foreground: 0 0% 63.9%;
    --accent: 0 0% 14.9%;
    --accent-foreground: 0 0% 98%;
    --destructive: 0 62.8% 30.6%;
    --destructive-foreground: 0 0% 98%;
    --border: 0 0% 14.9%;
    --input: 0 0% 14.9%;
    --ring: 0 0% 83.1%;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.min-h-screen { min-height: 100vh; }
.h-screen { height: 100vh; }
.h-16 { height: 4rem; }
.h-14 { height: 3.5rem; }
.h-9 { height: 2.25rem; }
.h-8 { height: 2rem; }
.h-4 { height: 1rem; }
.w-full { width: 100%; }
.w-64 { width: 16rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-xl { max-width: 36rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-sm { max-width: 24rem; }

.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; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.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; }
.shrink-0 { flex-shrink: 0; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }

/* Grid */
.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-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-full { grid-column: 1 / -1; }

/* Spacing */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.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; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.pt-8 { padding-top: 2rem; }
.pb-2 { padding-bottom: 0.5rem; }
.pr-6 { padding-right: 1.5rem; }
.pl-10 { padding-left: 2.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-4 { margin-left: 1rem; }
.ml-auto { margin-left: auto; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mr-auto { margin-right: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.-translate-y-1\/2 { transform: translateY(-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; }
.text-5xl { font-size: 3rem; line-height: 1; }
.text-6xl { font-size: 3.75rem; line-height: 1; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.uppercase { text-transform: uppercase; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.text-center { text-align: center; }
.whitespace-nowrap { white-space: nowrap; }
.leading-relaxed { line-height: 1.625; }
.inline-block { display: inline-block; }

/* Colors */
.bg-background { background: hsl(var(--background)); }
.bg-card { background: hsl(var(--card)); }
.bg-primary { background: hsl(var(--primary)); }
.bg-secondary { background: hsl(var(--secondary)); }
.bg-muted { background: hsl(var(--muted)); }
.bg-muted\/50 { background: hsl(var(--muted) / 0.5); }
.bg-muted\/20 { background: hsl(var(--muted) / 0.2); }
.bg-muted\/30 { background: hsl(var(--muted) / 0.3); }
.bg-destructive { background: hsl(var(--destructive)); }
.bg-card\/50 { background: hsl(var(--card) / 0.5); }
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.from-\[\#7850fc\] { --tw-gradient-from: #7850fc; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(120, 80, 255, 0)); }
.to-\[\#9b6dff\] { --tw-gradient-to: #9b6dff; }
.to-\[\#c4a0ff\] { --tw-gradient-to: #c4a0ff; }
.bg-purple-500\/10 { background-color: rgba(120, 80, 255, 0.1); }
.bg-purple-500\/20 { background-color: rgba(120, 80, 255, 0.2); }
.bg-green-500\/10 { background-color: rgba(34, 197, 94, 0.1); }
.bg-green-500\/20 { background-color: rgba(34, 197, 94, 0.2); }
.bg-blue-500\/10 { background-color: rgba(59, 130, 246, 0.1); }
.bg-orange-500\/10 { background-color: rgba(251, 146, 60, 0.1); }
.bg-red-500 { background-color: #ef4444; }
.bg-yellow-500 { background-color: #eab308; }
.bg-green-500 { background-color: #22c55e; }

.text-foreground { color: hsl(var(--foreground)); }
.text-card-foreground { color: hsl(var(--card-foreground)); }
.text-primary-foreground { color: hsl(var(--primary-foreground)); }
.text-secondary-foreground { color: hsl(var(--secondary-foreground)); }
.text-muted-foreground { color: hsl(var(--muted-foreground)); }
.text-accent-foreground { color: hsl(var(--accent-foreground)); }
.text-destructive { color: hsl(var(--destructive)); }
.text-destructive-foreground { color: hsl(var(--destructive-foreground)); }
.text-purple-400 { color: #a78bfa; }
.text-purple-300 { color: #c4b5fd; }
.text-green-400 { color: #4ade80; }
.text-blue-400 { color: #60a5fa; }
.text-orange-400 { color: #fb923c; }
.text-gray-300 { color: #d1d5db; }
.text-gray-500 { color: #6b7280; }
.text-yellow-400 { color: #facc15; }
.text-white { color: #ffffff; }
.text-current { color: currentColor; }

/* Border */
.border { border-width: 1px; border-style: solid; }
.border-0 { border-width: 0; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }
.border-border { border-color: hsl(var(--border)); }
.border-border\/40 { border-color: hsl(var(--border) / 0.4); }
.border-border\/50 { border-color: hsl(var(--border) / 0.5); }
.border-purple-500\/20 { border-color: rgba(120, 80, 255, 0.2); }
.border-purple-500\/30 { border-color: rgba(120, 80, 255, 0.3); }
.border-purple-500\/50 { border-color: rgba(120, 80, 255, 0.5); }

/* Shadow */
.shadow-lg { box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.sticky { position: sticky; }
.fixed { position: fixed; }
.top-0 { top: 0; }
.top-24 { top: 6rem; }
.right-3 { right: 0.75rem; }
.right-4 { right: 1rem; }
.bottom-4 { bottom: 1rem; }
.left-3 { left: 0.75rem; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Opacity */
.opacity-50 { opacity: 0.5; }
.opacity-70 { opacity: 0.7; }
.opacity-100 { opacity: 1; }

/* Transitions */
.transition-all { transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-colors { transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; transition-duration: 150ms; }
.duration-300 { transition-duration: 300ms; }

/* Focus */
.focus\:outline-none:focus { outline: none; }
.focus\:border-purple-500\/50:focus { border-color: rgba(120, 80, 255, 0.5); }
.focus\:ring-2:focus { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }
.focus\:ring-purple-500\/20:focus { --tw-ring-color: rgba(120, 80, 255, 0.2); }
.focus-within\:ring-2:focus-within { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); }

/* Hover */
.hover\:bg-muted:hover { background: hsl(var(--muted)); }
.hover\:bg-secondary:hover { background: hsl(var(--secondary)); }
.hover\:text-foreground:hover { color: hsl(var(--foreground)); }
.hover\:text-purple-300:hover { color: #c4b5fd; }
.hover\:text-purple-400:hover { color: #a78bfa; }
.hover\:opacity-90:hover { opacity: 0.9; }
.hover\:underline:hover { text-decoration: underline; }

/* Border Radius */
.rounded-sm { border-radius: 0.125rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-full { border-radius: 9999px; }
.rounded-t-lg { border-top-left-radius: 0.5rem; border-top-right-radius: 0.5rem; }
.rounded-b-lg { border-bottom-left-radius: 0.5rem; border-bottom-right-radius: 0.5rem; }
.rounded-t-xl { border-top-left-radius: 0.75rem; border-top-right-radius: 0.75rem; }
.rounded-b-xl { border-bottom-left-radius: 0.75rem; border-bottom-right-radius: 0.75rem; }
.rounded-l-full { border-top-left-radius: 9999px; border-bottom-left-radius: 9999px; }
.rounded-r-full { border-top-right-radius: 9999px; border-bottom-right-radius: 9999px; }

/* Backdrop */
.backdrop-blur-xl { backdrop-filter: blur(24px); }

/* Navigation */
nav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: hsl(var(--background));
    border-bottom: 1px solid hsl(var(--border) / 0.4);
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    text-decoration: none;
    transition: all 0.15s;
}

.nav-btn:hover {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    text-decoration: none;
}

.nav-btn.active {
    color: hsl(var(--foreground));
    background: hsl(var(--secondary));
}

/* Filter Chips */
.filter-chip {
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
    cursor: pointer;
    transition: all 0.15s;
}

.filter-chip:hover {
    background: hsl(var(--accent));
}

.filter-chip.active {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
    border-color: hsl(var(--primary));
}

/* Checkbox */
input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #7850fc;
}

/* Range */
input[type="range"] {
    accent-color: #7850fc;
}

/* Select */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Textarea */
textarea {
    font-family: inherit;
}

/* Loading Animation */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Toast */
#toast {
    transform: translateY(5rem);
    opacity: 0;
}

#toast.show {
    transform: translateY(0);
    opacity: 1;
}

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--border));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground));
}

/* Stat number gradient */
.stat-number {
    background: linear-gradient(135deg, #7850fc 0%, #c4a0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Responsive breakpoints */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:inline-flex { display: inline-flex; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:w-auto { width: auto; }
    .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:flex-row { flex-direction: row; }
    .md\:text-base { font-size: 1rem; line-height: 1.5rem; }
    .md\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
    .md\:text-xl { font-size: 1.25rem; line-height: 1.75rem; }
}

@media (min-width: 1024px) {
    .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)); }
    .lg\:flex { display: flex; }
    .lg\:hidden { display: none; }
    .lg\:block { display: block; }
    .lg\:gap-1 { gap: 0.25rem; }
    .lg\:py-32 { padding-top: 8rem; padding-bottom: 8rem; }
    .lg\:text-6xl { font-size: 3.75rem; line-height: 1; }
    .lg\:text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
}

@media (min-width: 1280px) {
    .xl\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
    .hidden\/lg { display: none; }
}

@media (max-width: 767px) {
    .hide-mobile { display: none; }
}
