/*
 * Retro-Modern Design System inspired by PostHog
 * Warm, playful, professional - with excellent contrast
 */

/* Reset and base styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Layout utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.h-screen { height: 100vh; }
.h-full { height: 100%; }
.w-full { width: 100%; }
.w-96 { width: 24rem; }
.w-80 { width: 20rem; }
.w-32 { width: 8rem; }
.w-8 { width: 2rem; }
.h-64 { height: 16rem; }
.h-8 { height: 2rem; }
.h-4 { height: 1rem; }
.max-h-96 { max-height: 24rem; }
.max-h-full { max-height: 100%; }
.max-w-full { max-width: 100%; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }

/* Spacing */
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-5 { padding-top: 1.25rem; }
.py-6 { padding-bottom: 1.5rem; }
.py-0\.5 { padding-top: 0.125rem; padding-bottom: 0.125rem; }
.pt-5 { padding-top: 1.25rem; }
.pb-6 { padding-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-10 { margin-top: 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; }
.ml-2 { margin-left: 0.5rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.self-end { align-self: flex-end; }

/* Position & alignment */
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.text-center { text-align: center; }
.self-start { align-self: flex-start; }
.relative { position: relative; }
.cursor-pointer { cursor: pointer; }
.object-contain { object-fit: contain; }

/* Max width utilities */
.max-w-\[80\%\] { max-width: 80%; }
.max-w-2xl { max-width: 42rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-lg { max-width: 32rem; }

/* Borders */
.border { border-width: 1px; border-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-l { border-left-width: 1px; border-left-style: solid; }
.border-r { border-right-width: 1px; border-right-style: solid; }
.border-solid { border-style: solid; }
.border-dashed { border-style: dashed; }
.rounded { border-radius: 0.5rem; }
.rounded-lg { border-radius: 0.75rem; }
.rounded-bl-none { border-bottom-left-radius: 0; }
.rounded-br-none { border-bottom-right-radius: 0; }

/* Typography */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-\[0\.4rem\] { font-size: 0.4rem; }
.font-mono { font-family: 'SF Mono', 'Monaco', 'Courier New', monospace; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.leading-none { line-height: 1; }
.whitespace-pre { white-space: pre; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Shadows - softer, more subtle */
.shadow-md { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.shadow-2xl { box-shadow: 0 10px 40px rgba(0,0,0,0.12); }

/* Container */
.container { width: 100%; max-width: 1280px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Color Palette - PostHog Inspired */
/* Light Mode - Warm, Retro Colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #FAF9F6; } /* Warm off-white */
.bg-gray-100 { background-color: #F5F3EE; } /* Cream/beige */
.bg-gray-200 { background-color: #E8E5DD; }
.bg-gray-300 { background-color: #D4CFBF; }
.bg-gray-900 { background-color: #1D1F20; } /* Near black for dark mode */
.bg-blue-100 { background-color: #E0E7FF; }

/* Primary Action Color - Vibrant orange (PostHog style) */
.bg-orange-600 { background-color: #F54E00; }
.bg-orange-500 { background-color: #FF6B35; }

/* Blue accent - less saturated, more professional */
.bg-blue-500 { background-color: #5375E2; }
.bg-blue-600 { background-color: #4A5FCC; }
.bg-blue-900 { background-color: #1E3A5F; }

/* Text Colors */
.text-white { color: #FAFAFA; }
.text-gray-500 { color: #6B7280; }
.text-gray-600 { color: #4B5563; }
.text-gray-900 { color: #1A1A1A; }
.text-orange-500 { color: #F54E00; }
.text-blue-500 { color: #5375E2; }
.text-blue-800 { color: #1E3A5F; }

/* Border Colors */
.border-gray-200 { border-color: #E8E5DD; }
.border-gray-300 { border-color: #D4CFBF; }
.border-gray-600 { border-color: #6B7280; }

/* Hover states - Light Mode */
.hover\:text-gray-700:hover { color: #4A4A4A; }
.hover\:bg-gray-100:hover { background-color: #F5F3EE; }
.hover\:bg-gray-200:hover { background-color: #E8E5DD; }
.hover\:bg-blue-600:hover { background-color: #4A5FCC; }
.hover\:bg-blue-700:hover { background-color: #3D4FA8; }
.hover\:bg-orange-700:hover { background-color: #D94400; }
.hover\:underline:hover { text-decoration: underline; }
.hover\:opacity-75:hover { opacity: 0.75; }

/* Focus states - warmer focus ring */
.focus\:ring-blue-500:focus {
    box-shadow: 0 0 0 3px rgba(83, 117, 226, 0.3);
    outline: none;
}
.focus\:border-blue-500:focus { border-color: #5375E2; }

/* Transition */
.transition-opacity { transition-property: opacity; }
.transition-all { transition-property: all; }
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* Dark Mode - True black with warm accents */
.dark body {
    background-color: #0D0D0D !important;
}

.dark .dark\:bg-gray-900 {
    background-color: #0D0D0D !important;
}

.dark aside,
.dark .dark\:bg-gray-800 {
    background-color: #1A1A1A !important;
}

.dark .dark\:bg-gray-700 {
    background-color: #252525 !important;
}

.dark .dark\:bg-gray-600 {
    background-color: #2F2F2F !important;
}

.dark .dark\:hover\:bg-gray-700:hover {
    background-color: #2A2A2A !important;
}

.dark .dark\:hover\:bg-gray-600:hover {
    background-color: #333333 !important;
}

.dark .dark\:hover\:bg-bray-800:hover {
    background-color: #1A1A1A !important;
}

.dark .dark\:hover\:bg-gray-500:hover {
    background-color: #3A3A3A !important;
}

/* Dark mode borders - softer */
.dark .dark\:border-gray-700,
.dark .border-gray-700 {
    border-color: #2A2A2A !important;
}

.dark .dark\:border-gray-600,
.dark .border-gray-600 {
    border-color: #3A3A3A !important;
}

.dark .dark\:hover\:border-gray-500:hover {
    border-color: #4A4A4A !important;
}

/* Dark mode text - better contrast */
.dark .dark\:text-gray-100 {
    color: #F5F5F5 !important;
}

.dark .dark\:text-gray-400 {
    color: #ADADAD !important;
}

.dark .dark\:text-gray-300 {
    color: #D1D1D1 !important;
}

.dark .dark\:text-blue-400 {
    color: #6B8EF5 !important;
}

.dark .dark\:text-blue-300 {
    color: #93B0FF !important;
}

.dark .dark\:hover\:text-gray-200:hover {
    color: #E5E5E5 !important;
}

/* Dark mode specific */
.dark .dark\:bg-blue-900 {
    background-color: #1E3A5F !important;
}

/* Input and Button styling */
input, textarea, select {
    outline: none;
    font-family: inherit;
}

button {
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

button:active {
    transform: translateY(0);
}

/* Form inputs - warmer styling */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
textarea,
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 2px solid #E8E5DD;
    border-radius: 0.5rem;
    background-color: #FFFFFF;
    font-size: 0.9375rem;
    transition: all 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
    border-color: #5375E2;
    box-shadow: 0 0 0 3px rgba(83, 117, 226, 0.1);
}

.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="file"],
.dark textarea,
.dark select {
    background-color: #1A1A1A;
    border-color: #3A3A3A;
    color: #F5F5F5;
}

.dark input[type="text"]:focus,
.dark input[type="email"]:focus,
.dark input[type="password"]:focus,
.dark textarea:focus,
.dark select:focus {
    border-color: #6B8EF5;
    box-shadow: 0 0 0 3px rgba(107, 142, 245, 0.15);
}

/* File input */
input[type="file"] {
    border: none;
    padding: 0;
}

label {
    display: inline-block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: #4A4A4A;
}

.dark label {
    color: #ADADAD;
}

/* Button disabled state */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Icon button styling */
button i {
    font-size: inherit;
}

/* SVG icons */
svg {
    display: inline-block;
}

/* Links */
a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: #5375E2;
}

.dark a:hover {
    color: #6B8EF5;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

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

::-webkit-scrollbar-thumb {
    background: #D4CFBF;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #C4BFAF;
}

.dark ::-webkit-scrollbar-thumb {
    background: #3A3A3A;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #4A4A4A;
}

/* Model items - retro card style */
.model-item {
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.model-item:hover {
    background-color: #FFF9F5 !important;
    border-color: #FFD4B8;
    transform: translateX(4px);
}

.dark .model-item:hover {
    background-color: #252525 !important;
    border-color: #3A3A3A;
}

/* Make sure body fills viewport */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

/* Utility: gap */
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }

/* Additional utility classes found in usage */
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
textarea { resize: vertical; }

/* Hidden utility class */
.hidden { display: none; }

/* Additional classes for sliders */
.appearance-none {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.cursor-pointer { cursor: pointer; }

/* Peer selector support */
.peer { }
.peer:checked ~ .peer-checked\:bg-orange-600 {
    background-color: #F54E00;
}

.peer-focus\:outline-none:focus {
    outline: none;
}

.peer-focus\:ring-2:focus {
    box-shadow: 0 0 0 2px rgba(83, 117, 226, 0.5);
}

.peer-focus\:ring-blue-500:focus {
    box-shadow: 0 0 0 2px rgba(83, 117, 226, 0.5);
}

/* After pseudo element for toggle */
.after\:content-\[\'\'\]::after {
    content: '';
}

.after\:absolute::after {
    position: absolute;
}

.after\:top-\[2px\]::after {
    top: 2px;
}

.after\:left-\[2px\]::after {
    left: 2px;
}

.after\:bg-white::after {
    background-color: white;
}

.after\:border-gray-300::after {
    border-color: #D4CFBF;
}

.after\:border::after {
    border-width: 1px;
    border-style: solid;
}

.after\:rounded-full::after {
    border-radius: 9999px;
}

.after\:h-5::after {
    height: 1.25rem;
}

.after\:w-5::after {
    width: 1.25rem;
}

.after\:transition-all::after {
    transition: all 0.2s;
}

.peer-checked\:after\:translate-x-full:checked::after {
    transform: translateX(100%);
}

.peer-checked\:after\:border-white:checked::after {
    border-color: white;
}