@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    /* KMC Brand Colors */
    --kmc-navy: #141240;
    --kmc-blue: #1D7AD9;
    --kmc-red: #D71920;
    --kmc-neutral: #F3F3F3;
    
    /* Semantic Colors */
    --background: 210 40% 98%;
    --foreground: 222.2 84% 4.9%;
    --card: 0 0% 100%;
    --card-foreground: 222.2 84% 4.9%;
    --popover: 0 0% 100%;
    --popover-foreground: 222.2 84% 4.9%;
    --primary: 240 75% 16%;
    --primary-foreground: 210 40% 98%;
    --secondary: 210 40% 96.1%;
    --secondary-foreground: 222.2 47.4% 11.2%;
    --muted: 210 40% 96.1%;
    --muted-foreground: 215.4 16.3% 46.9%;
    --accent: 210 40% 96.1%;
    --accent-foreground: 222.2 47.4% 11.2%;
    --destructive: 355 78% 47%;
    --destructive-foreground: 210 40% 98%;
    --border: 214.3 31.8% 91.4%;
    --input: 214.3 31.8% 91.4%;
    --ring: 211 70% 49%;
    --radius: 0.5rem;
    
    /* Chart Colors */
    --chart-1: 240 75% 16%;
    --chart-2: 211 70% 49%;
    --chart-3: 199 89% 48%;
    --chart-4: 38 92% 50%;
    --chart-5: 355 78% 47%;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #F8FAFC;
    color: #0F172A;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

code, .mono {
    font-family: 'JetBrains Mono', monospace;
}

@layer base {
    * {
        @apply border-border;
    }
    body {
        @apply bg-background text-foreground;
    }
}

@layer utilities {
    .text-balance {
        text-wrap: balance;
    }
}

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

::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #94A3B8;
}

/* KMC Specific Styles */
.kmc-gradient {
    background: linear-gradient(135deg, var(--kmc-navy) 0%, #1e1b5e 100%);
}

.kmc-card {
    @apply bg-white rounded-lg border border-slate-200 shadow-sm;
}

.kmc-card-hover {
    @apply transition-all duration-200 hover:shadow-md hover:border-slate-300;
}

/* Status Badge Styles */
.status-draft {
    @apply bg-slate-100 text-slate-700 border border-slate-200;
}

.status-submitted {
    @apply bg-blue-50 text-blue-700 border border-blue-200;
}

.status-posted {
    @apply bg-emerald-50 text-emerald-700 border border-emerald-200;
}

.status-returned {
    @apply bg-red-50 text-red-700 border border-red-200;
}

/* Stock Status */
.stock-available {
    @apply bg-emerald-500;
}

.stock-low {
    @apply bg-amber-500;
}

.stock-out {
    @apply bg-red-500;
}

/* Sidebar Styles */
.sidebar-link {
    @apply flex items-center gap-3 px-4 py-2.5 text-slate-300 rounded-lg transition-colors duration-150;
}

.sidebar-link:hover {
    @apply bg-white/10 text-white;
}

.sidebar-link.active {
    @apply bg-blue-600/20 text-blue-400 border-r-2 border-blue-500;
}

/* Table Styles */
.kmc-table-header {
    @apply bg-slate-50 text-xs uppercase tracking-wider text-slate-500 font-semibold;
}

.kmc-table-row {
    @apply border-b border-slate-100 hover:bg-slate-50/50 transition-colors;
}

.kmc-table-cell {
    @apply text-sm text-slate-700 px-4 py-3;
}

/* Button Animations */
.btn-kmc {
    @apply transition-all duration-150 active:scale-[0.98];
}

/* KPI Card Animation */
.kpi-card {
    @apply transition-transform duration-200 hover:scale-[1.01];
}

/* Chart Container */
.chart-container {
    @apply bg-white rounded-lg border border-slate-200 p-4;
}

/* Form Styles */
.form-input-kmc {
    @apply bg-white border-slate-300 focus:ring-2 focus:ring-[#1D7AD9]/20 focus:border-[#1D7AD9] rounded-md h-10;
}

/* Loading Animation */
@keyframes pulse-kmc {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Heatmap Cell */
.heatmap-cell {
    @apply w-full h-8 rounded flex items-center justify-center text-xs font-medium text-white;
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    .print-only {
        display: block !important;
    }
}

/* Debug Wrapper */
@layer base {
    [data-debug-wrapper="true"] {
        display: contents !important;
    }
}
