@import "tailwindcss";

@theme {
  /* Brand Colors - Coffee Industry Inspired */
  --color-brand-primary: #6b4423;     /* Rich Coffee Brown */
  --color-brand-secondary: #8b5a2b;   /* Medium Roast */
  --color-brand-accent: #d4840f;      /* Golden Bean */
  --color-brand-background: #f8f4e6;  /* Cream Base */
  --color-brand-neutral: #8b7355;     /* Warm Neutral */

  /* Semantic Colors for Application States */
  --color-success: #10b981;           /* Green-500 */
  --color-warning: #f59e0b;           /* Amber-500 */
  --color-error: #ef4444;             /* Red-500 */
  --color-info: #3b82f6;              /* Blue-500 */

  /* Extended Gray Scale for Interface Elements */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-800: #1f2937;
  --color-gray-900: #111827;

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

  /* Spacing Scale - 8px Grid System */
  --spacing-xs: 0.5rem;         /* 8px */
  --spacing-sm: 1rem;           /* 16px */
  --spacing-md: 1.5rem;         /* 24px */
  --spacing-lg: 2rem;           /* 32px */
  --spacing-xl: 3rem;           /* 48px */
  --spacing-2xl: 4rem;          /* 64px */
  --spacing-3xl: 6rem;          /* 96px */
  --spacing-4xl: 8rem;          /* 128px */

  /* Container Widths for max-width utilities */
  --max-width-sm: 24rem;        /* 384px */
  --max-width-md: 28rem;        /* 448px */
  --max-width-lg: 32rem;        /* 512px */
  --max-width-xl: 36rem;        /* 576px */
  --max-width-2xl: 42rem;       /* 672px */
  --max-width-3xl: 48rem;       /* 768px */
  --max-width-4xl: 56rem;       /* 896px */
  --max-width-5xl: 64rem;       /* 1024px */
  --max-width-6xl: 72rem;       /* 1152px */
  --max-width-7xl: 80rem;       /* 1280px */

  /* Shadow Scale for Component Elevation */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  /* Border Radius Scale */
  --radius-none: 0;
  --radius-sm: 0.125rem;         /* 2px */
  --radius-md: 0.375rem;         /* 6px */
  --radius-lg: 0.5rem;           /* 8px */
  --radius-xl: 0.75rem;          /* 12px */
  --radius-2xl: 1rem;            /* 16px */
  --radius-full: 9999px;

  /* Font Family */
  --font-family-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-family-mono: 'SF Mono', 'Monaco', 'Inconsolata', monospace;

  /* Line Heights for Readability */
  --line-height-tight: 1.25;
  --line-height-snug: 1.375;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
  --line-height-loose: 2;

  /* Font Weights */
  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --font-weight-extrabold: 800;

  /* Breakpoints for Responsive Design */
  --breakpoint-sm: 640px;
  --breakpoint-md: 768px;
  --breakpoint-lg: 1024px;
  --breakpoint-xl: 1280px;
  --breakpoint-2xl: 1536px;
}

/* Custom Utility Classes for Common Patterns */

/* Coffee Industry Inspired Gradients */
.gradient-coffee {
  background: linear-gradient(135deg, var(--color-brand-primary) 0%, var(--color-brand-secondary) 100%);
}

.gradient-golden {
  background: linear-gradient(135deg, var(--color-brand-accent) 0%, #f6ad55 100%);
}

/* Button Variants */
.btn-primary {
  @apply bg-brand-primary text-white px-4 py-2 rounded-lg font-medium transition-colors duration-200 hover:bg-brand-secondary focus:outline-none focus:ring-2 focus:ring-brand-accent/50;
}

.btn-secondary {
  @apply bg-white text-brand-primary px-4 py-2 rounded-lg font-medium border-2 border-brand-primary transition-colors duration-200 hover:bg-brand-primary hover:text-white focus:outline-none focus:ring-2 focus:ring-brand-accent/50;
}

.btn-accent {
  @apply bg-brand-accent text-white px-4 py-2 rounded-lg font-medium transition-colors duration-200 hover:bg-yellow-600 focus:outline-none focus:ring-2 focus:ring-brand-accent/50;
}

/* Form Input Styles */
.input-field {
  @apply w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-accent focus:border-brand-accent transition-colors duration-200;
}

.input-error {
  @apply border-error focus:ring-error focus:border-error;
}

/* Card Components */
.card {
  @apply bg-white rounded-xl shadow-md border border-gray-200;
}

.card-hover {
  @apply transition-shadow duration-200 hover:shadow-lg;
}

/* Text Utilities */
.text-muted {
  @apply text-gray-600;
}

.text-emphasis {
  @apply text-brand-primary font-medium;
}

/* Layout Utilities */
.container-responsive {
  @apply max-w-7xl mx-auto px-4 sm:px-6 lg:px-8;
}

.page-header {
  @apply bg-white shadow-sm border-b border-gray-200 sticky top-0 z-50;
}

/* Status Indicators */
.status-success {
  @apply bg-success text-white px-2 py-1 rounded-full text-xs font-medium;
}

.status-warning {
  @apply bg-warning text-white px-2 py-1 rounded-full text-xs font-medium;
}

.status-error {
  @apply bg-error text-white px-2 py-1 rounded-full text-xs font-medium;
}

.status-info {
  @apply bg-info text-white px-2 py-1 rounded-full text-xs font-medium;
}

/* Loading States */
.skeleton {
  @apply animate-pulse bg-gray-200 rounded;
}

/* Responsive Tables */
.table-responsive {
  @apply min-w-full divide-y divide-gray-200 shadow overflow-hidden sm:rounded-lg;
}

/* Dashboard Grid */
.dashboard-grid {
  @apply grid grid-cols-1 gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4;
}

/* Semantic Typography Classes */
.heading-primary {
  @apply text-3xl font-bold text-brand-primary;
}

.heading-secondary {
  @apply text-2xl font-semibold text-brand-primary;
}

.heading-tertiary {
  @apply text-xl font-medium text-brand-primary;
}

.heading-quaternary {
  @apply text-lg font-medium text-gray-900;
}

.body-large {
  @apply text-lg text-gray-700;
}

.body-small {
  @apply text-sm text-gray-600;
}

/* Semantic Link Styles */
.link-primary {
  @apply text-brand-primary hover:text-brand-secondary transition-colors duration-200;
}

.link-success {
  @apply text-success hover:text-green-700 transition-colors duration-200;
}

.link-info {
  @apply text-info hover:text-blue-700 transition-colors duration-200;
}

.link-warning {
  @apply text-warning hover:text-amber-700 transition-colors duration-200;
}

/* Stats Card Components */
.stats-card {
  @apply bg-white rounded-xl shadow-md border border-gray-200 p-6;
}

.stats-icon {
  @apply p-3 rounded-full;
}

.stats-icon-info {
  @apply p-3 rounded-full bg-info/10 text-info;
}

.stats-icon-success {
  @apply p-3 rounded-full bg-success/10 text-success;
}

.stats-icon-warning {
  @apply p-3 rounded-full bg-warning/10 text-warning;
}

.stats-value {
  @apply text-2xl font-semibold text-gray-900;
}

.stats-label {
  @apply text-gray-600;
}

/* Action Card Components */
.action-card {
  @apply bg-white rounded-xl shadow-md border border-gray-200 p-6;
}

.action-link {
  @apply block w-full text-left px-3 py-2 text-sm rounded transition-colors duration-200;
}

.action-link-primary {
  @apply block w-full text-left px-3 py-2 text-sm rounded transition-colors duration-200 text-brand-primary hover:bg-brand-primary/5;
}

.action-link-success {
  @apply block w-full text-left px-3 py-2 text-sm rounded transition-colors duration-200 text-success hover:bg-success/5;
}

.action-link-info {
  @apply block w-full text-left px-3 py-2 text-sm rounded transition-colors duration-200 text-info hover:bg-info/5;
}

.action-link-warning {
  @apply block w-full text-left px-3 py-2 text-sm rounded transition-colors duration-200 text-warning hover:bg-warning/5;
}

/* Card Variations */
.card-info {
  @apply bg-info/5 rounded-xl shadow-md border border-info/20;
}

.card-success {
  @apply bg-success/5 rounded-xl shadow-md border border-success/20;
}

.card-warning {
  @apply bg-warning/5 rounded-xl shadow-md border border-warning/20;
}

/* Coffee Roaster Specific Patterns */
.roast-level-light {
  @apply bg-yellow-100 text-yellow-800 border-yellow-200;
}

.roast-level-medium {
  @apply bg-orange-100 text-orange-800 border-orange-200;
}

.roast-level-dark {
  @apply bg-amber-100 text-amber-800 border-amber-200;
}

.inventory-low {
  @apply bg-red-50 text-red-700 border-red-200;
}

.inventory-good {
  @apply bg-green-50 text-green-700 border-green-200;
}

/* Pagy Pagination Styling */
.pagy.series-nav {
  @apply flex items-center justify-center gap-1;
}

.pagy.series-nav a {
  @apply inline-flex items-center justify-center min-w-[2.25rem] h-9 px-3 text-sm font-medium rounded-md transition-colors duration-200;
}

.pagy.series-nav a:not([aria-disabled="true"]):not([aria-current="page"]) {
  @apply text-gray-700 bg-white border border-gray-300 hover:bg-gray-50 hover:border-gray-400;
}

.pagy.series-nav a[aria-current="page"] {
  @apply text-white bg-brand-accent border border-brand-accent cursor-default;
}

.pagy.series-nav a[aria-disabled="true"]:not([aria-current="page"]) {
  @apply text-gray-400 bg-gray-100 border border-gray-200 cursor-not-allowed;
}

.pagy.series-nav a[role="separator"] {
  @apply border-0 bg-transparent text-gray-500 cursor-default px-1 min-w-0;
}
