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

:root {
    --font-size: 16px;
    --background: #ffffff;
    --foreground: #1a1a1a;
    --card: #ffffff;
    --card-foreground: #1a1a1a;
    --primary: #030213;
    --primary-foreground: #ffffff;
    --secondary: #f1f5f9;
    --secondary-foreground: #030213;
    --muted: #ececf0;
    --muted-foreground: #717182;
    --accent: #e9ebef;
    --accent-foreground: #030213;
    --destructive: #d4183d;
    --destructive-foreground: #ffffff;
    --border: rgba(0, 0, 0, 0.1);
    --ring: #708090;
    --radius: 0.625rem;
}

.dark {
    --background: #0f172a;
    --foreground: #f8fafc;
    --card: #1e293b;
    --card-foreground: #f8fafc;
    --primary: #f8fafc;
    --primary-foreground: #1e293b;
    --secondary: #334155;
    --secondary-foreground: #f8fafc;
    --muted: #334155;
    --muted-foreground: #94a3b8;
    --accent: #334155;
    --accent-foreground: #f8fafc;
    --destructive: #dc2626;
    --destructive-foreground: #f8fafc;
    --border: #334155;
    --ring: #64748b;
}

html {
    font-size: var(--font-size);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.5;
}

/* Utility classes */
.min-h-screen { min-height: 100vh; }
.h-16 { height: 4rem; }
.w-64 { width: 16rem; }
.w-96 { width: 24rem; }
.h-96 { height: 24rem; }
.w-64 { width: 16rem; }
.h-64 { height: 16rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-3 { width: 0.75rem; }
.h-3 { height: 0.75rem; }
.w-2 { width: 0.5rem; }
.h-2 { height: 0.5rem; }
.w-20 { width: 5rem; }
.w-full { width: 100%; }
.w-64 { width: 16rem; }

.flex-1 { flex: 1; }

/* Positioning */
.fixed { position: fixed; }
.absolute { position: absolute; }
.relative { position: relative; }
.sticky { position: sticky; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.top-1\/4 { top: 25%; }
.top-1\/2 { top: 50%; }
.bottom-1\/4 { bottom: 25%; }
.bottom-4 { bottom: 1rem; }
.left-1\/4 { left: 25%; }
.left-1\/2 { left: 50%; }
.left-4 { left: 1rem; }
.right-1\/4 { right: 25%; }
.right-4 { right: 1rem; }
.right-2 { right: 0.5rem; }
.-top-1 { top: -0.25rem; }
.-left-1 { left: -0.25rem; }
.-top-2 { top: -0.5rem; }
.-left-2 { left: -0.5rem; }
.-translate-x-1\/2 { transform: translateX(-50%); }
.-translate-y-1\/2 { transform: translateY(-50%); }
.z-50 { z-index: 50; }

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

/* Flexbox */
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

/* 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 */
.space-x-1 > * + * { margin-left: 0.25rem; }
.space-x-2 > * + * { margin-left: 0.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Margin */
.m-0 { margin: 0; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-4 { margin-top: 1rem; }

/* Padding */
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.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; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* Gap */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }

/* Background */
.bg-gradient-to-br { background-image: linear-gradient(to bottom right, var(--tw-gradient-stops)); }
.bg-gradient-to-r { background-image: linear-gradient(to right, var(--tw-gradient-stops)); }
.bg-gradient-to-b { background-image: linear-gradient(to bottom, var(--tw-gradient-stops)); }
.from-slate-900 { --tw-gradient-from: #0f172a; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(15 23 42 / 0)); }
.via-slate-800 { --tw-gradient-stops: var(--tw-gradient-from), #1e293b, var(--tw-gradient-to, rgb(30 41 59 / 0)); }
.to-slate-900 { --tw-gradient-to: #0f172a; }
.from-cyan-400 { --tw-gradient-from: #22d3ee; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(34 211 238 / 0)); }
.to-blue-400 { --tw-gradient-to: #60a5fa; }
.from-purple-400 { --tw-gradient-from: #c084fc; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(192 132 252 / 0)); }
.to-pink-400 { --tw-gradient-to: #f472b6; }
.from-green-400 { --tw-gradient-from: #4ade80; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgb(74 222 128 / 0)); }
.to-emerald-400 { --tw-gradient-to: #34d399; }
.bg-clip-text { background-clip: text; }

/* Colors */
.text-transparent { color: transparent; }
.text-white { color: #ffffff; }
.text-slate-400 { color: #94a3b8; }
.text-slate-300 { color: #cbd5e1; }
.text-cyan-400 { color: #22d3ee; }
.text-blue-400 { color: #60a5fa; }
.text-purple-400 { color: #c084fc; }
.text-green-400 { color: #4ade80; }
.text-emerald-400 { color: #34d399; }
.text-orange-400 { color: #fb923c; }
.text-red-400 { color: #f87171; }
.text-yellow-400 { color: #facc15; }

/* Background colors */
.bg-slate-800\/50 { background-color: rgb(30 41 59 / 0.5); }
.bg-slate-700\/50 { background-color: rgb(51 65 85 / 0.5); }
.bg-slate-900\/30 { background-color: rgb(15 23 42 / 0.3); }
.bg-slate-900\/80 { background-color: rgb(15 23 42 / 0.8); }
.bg-slate-800\/80 { background-color: rgb(30 41 59 / 0.8); }
.bg-green-500\/10 { background-color: rgb(34 197 94 / 0.1); }
.bg-green-500\/20 { background-color: rgb(34 197 94 / 0.2); }
.bg-red-500\/10 { background-color: rgb(239 68 68 / 0.1); }
.bg-red-500\/20 { background-color: rgb(239 68 68 / 0.2); }
.bg-blue-500\/10 { background-color: rgb(59 130 246 / 0.1); }
.bg-blue-500\/20 { background-color: rgb(59 130 246 / 0.2); }
.bg-yellow-500\/10 { background-color: rgb(234 179 8 / 0.1); }
.bg-yellow-500\/20 { background-color: rgb(234 179 8 / 0.2); }
.bg-orange-950\/20 { background-color: rgb(124 45 18 / 0.2); }
.bg-green-950\/20 { background-color: rgb(20 83 45 / 0.2); }
.bg-slate-700 { background-color: #334155; }
.bg-green-600 { background-color: #16a34a; }
.bg-blue-600 { background-color: #2563eb; }
.bg-purple-600 { background-color: #9333ea; }
.bg-orange-600 { background-color: #ea580c; }
.bg-red-600 { background-color: #dc2626; }
.bg-gray-900 { background-color: #111827; }

/* Border */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-r { border-right-width: 1px; }
.border-t { border-top-width: 1px; }
.border-slate-700 { border-color: #334155; }
.border-slate-700\/50 { border-color: rgb(51 65 85 / 0.5); }
.border-slate-600 { border-color: #475569; }
.border-green-500\/20 { border-color: rgb(34 197 94 / 0.2); }
.border-red-500\/20 { border-color: rgb(239 68 68 / 0.2); }
.border-blue-500\/20 { border-color: rgb(59 130 246 / 0.2); }
.border-orange-800 { border-color: #9a3412; }
.border-green-800 { border-color: #166534; }

/* Border radius */
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* Font */
.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-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace; }

/* Effects */
.backdrop-blur-md { backdrop-filter: blur(12px); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.blur-xl { filter: blur(24px); }
.blur-3xl { filter: blur(64px); }
.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-2xl { box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25); }
.shadow-md { box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); }
.shadow-slate-900\/50 { box-shadow: 0 10px 15px -3px rgb(15 23 42 / 0.5), 0 4px 6px -4px rgb(15 23 42 / 0.5); }

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

/* Pointer events */
.pointer-events-none { pointer-events: none; }

/* Transform */
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }
.rotate-12 { transform: rotate(12deg); }

/* Transitions */
.transition-all { transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-transform { transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
.transition-opacity { transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1); }
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }
.duration-1000 { transition-duration: 1000ms; }

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

@keyframes bounce {
    0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
    50% { transform: none; animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
}

@keyframes ping {
    0% { transform: scale(1); opacity: 1; }
    75%, 100% { transform: scale(2); opacity: 0; }
}

.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-bounce { animation: bounce 1s infinite; }
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }

.delay-1000 { animation-delay: 1000ms; }
.delay-2000 { animation-delay: 2000ms; }

/* Responsive design */
@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:w-48 { width: 12rem; }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .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)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

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

/* Custom components */
.nav-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background-color: rgb(51 65 85 / 0.5);
    transform: scale(1.05);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.nav-btn.active {
    background: linear-gradient(to right, #2563eb, #0891b2);
    color: white;
    box-shadow: 0 10px 15px -3px rgb(15 23 42 / 0.5);
    transform: scale(1.05);
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* Dark mode styles */
.dark {
    color-scheme: dark;
}

.dark .bg-gray-900 {
    background-color: #111827;
}

/* Height calculations */
.h-\[calc\(100vh-4rem\)\] {
    height: calc(100vh - 4rem);
}

/* Input styles */
input, select {
    background-color: rgb(30 41 59 / 0.5);
    border: 1px solid #475569;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: white;
    outline: none;
}

input:focus, select:focus {
    border-color: #22d3ee;
}

/* Button styles */
button {
    border: none;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    background: transparent;
    color: inherit;
}

button:hover {
    transform: scale(1.05);
}

/* Canvas styles */
canvas {
    border: 1px solid #475569;
    border-radius: 0.5rem;
}

/* Max height for scrollable areas */
.max-h-96 {
    max-height: 24rem;
}

/* Progress bar container */
.progress-container {
    width: 100%;
    background-color: #334155;
    border-radius: 9999px;
    height: 0.5rem;
}

.progress-bar {
    background-color: #9333ea;
    height: 0.5rem;
    border-radius: 9999px;
    transition: width 0.3s ease;
}

/* Additional responsive grid classes */
@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* Hover effects for cards */
.kpi-card:hover {
    transform: scale(1.05);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* Language-specific styles */
.nav-text {
    transition: all 0.3s ease;
}

/* Additional utility classes for specific elements */
.train-card {
    background-color: rgb(30 41 59 / 0.5);
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.5s ease;
    cursor: pointer;
}

.train-card:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.issue-card {
    background-color: rgb(30 41 59 / 0.5);
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.issue-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.recommendation-card {
    background-color: rgb(30 41 59 / 0.5);
    border: 1px solid #334155;
    border-radius: 0.5rem;
    padding: 1rem;
    transition: all 0.5s ease;
    cursor: pointer;
}

.recommendation-card:hover {
    transform: scale(1.02);
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* Badge styles */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid;
}

.badge-green {
    background-color: rgb(34 197 94 / 0.2);
    color: #4ade80;
    border-color: rgb(34 197 94 / 0.3);
}

.badge-red {
    background-color: rgb(239 68 68 / 0.2);
    color: #f87171;
    border-color: rgb(239 68 68 / 0.3);
}

.badge-blue {
    background-color: rgb(59 130 246 / 0.2);
    color: #60a5fa;
    border-color: rgb(59 130 246 / 0.3);
}

.badge-yellow {
    background-color: rgb(234 179 8 / 0.2);
    color: #facc15;
    border-color: rgb(234 179 8 / 0.3);
}

.badge-purple {
    background-color: rgb(147 51 234 / 0.2);
    color: #c084fc;
    border-color: rgb(147 51 234 / 0.3);
}

.badge-orange {
    background-color: rgb(234 88 12 / 0.2);
    color: #fb923c;
    border-color: rgb(234 88 12 / 0.3);
}

/* Progress bar styles */
.progress-bg {
    width: 100%;
    background-color: #334155;
    border-radius: 0.25rem;
    height: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 0.25rem;
    transition: width 1s ease;
}

.progress-green {
    background: linear-gradient(to right, #4ade80, #34d399);
}

.progress-red {
    background: linear-gradient(to right, #f87171, #fb923c);
}

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

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}