/**
 * IBL AI Base Styles
 *
 * Design system CSS variables and utility classes for consistent theming
 * across all IBL AI SPAs (mentor, skills, and custom apps).
 *
 * Usage:
 * ```tsx
 * import '@iblai/web-containers/styles/base.css';
 * ```
 */

:root {
  /* ============================================
     PRIMARY COLORS
     ============================================ */
  --primary-color: #0058cc;
  --accent-color: #f6f8fe;

  /* ============================================
     GRADIENT COLORS
     ============================================ */
  --gradient-start: #00b0ef;
  --gradient-end: #0058cc;
  --gradient-bg: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));

  /* ============================================
     DERIVED COLORS
     ============================================ */
  --primary-light: #00b0ef;
  --primary-dark: #004499;

  /* ============================================
     UI COLORS
     ============================================ */
  --background: #ffffff;
  --sidebar-bg: #fafbfc;
  --border-color: #e5e7eb;

  /* Text Colors */
  --text-primary: #616a76;
  --text-secondary: #717985;
  --text-muted: #9ca3af;

  /* Accent Colors */
  --accent-color-2: #f5f8ff;

  /* ============================================
     INTERACTIVE STATES
     ============================================ */
  --hover-bg: #f3f4f6;
  --active-bg: var(--accent-color);
  --button-hover: var(--primary-light);

  /* ============================================
     COMPONENT-SPECIFIC COLORS
     ============================================ */

  /* Form Elements */
  --input-bg: #f9fafb;
  --input-border: #e5e7eb;
  --input-text: #374151;
  --input-placeholder: #9ca3af;

  /* Cards & Containers */
  --card-bg: #ffffff;
  --card-border: var(--border-color);

  /* Avatars */
  --avatar-bg: #0ea5e9;

  /* Links */
  --link-color: #0058cc;
  --link-hover: #004499;

  /* Separators */
  --separator-color: #d1d5db;

  /* ============================================
     STATUS COLORS
     ============================================ */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --notification-color: #ef4444;
  --info-color: #3b82f6;

  /* ============================================
     CHAT INTERFACE COLORS
     ============================================ */
  --chat-primary: #3b82f6;
  --chat-primary-hover: #2563eb;
  --chat-secondary: #6b7280;
  --chat-secondary-hover: #4b5563;
  --chat-input-bg: #f9fafb;
  --chat-input-border: #e5e7eb;
  --chat-input-text: #374151;
  --chat-input-placeholder: #9ca3af;
  --chat-tab-active: #3b82f6;
  --chat-tab-inactive: #9ca3af;
  --chat-icon-bg: #dbeafe;
  --chat-icon-color: #3b82f6;
  --chat-hover-bg: #f3f4f6;

  /* ============================================
     TOOL & SIDEBAR COLORS
     ============================================ */
  --tool-button-bg: #ffffff;
  --tool-button-border: #e5e7eb;
  --stroke: var(--border-color);
  --accent-blue: var(--accent-color-2);
  --brand-primary: var(--primary-color);

  /* ============================================
     SPACING & SIZING (Optional)
     ============================================ */
  --spacing-xs: 0.25rem; /* 4px */
  --spacing-sm: 0.5rem; /* 8px */
  --spacing-md: 1rem; /* 16px */
  --spacing-lg: 1.5rem; /* 24px */
  --spacing-xl: 2rem; /* 32px */
  --spacing-2xl: 3rem; /* 48px */

  /* Border Radius */
  --radius-sm: 0.25rem; /* 4px */
  --radius-md: 0.375rem; /* 6px */
  --radius-lg: 0.5rem; /* 8px */
  --radius-xl: 0.75rem; /* 12px */
  --radius-2xl: 1rem; /* 16px */
  --radius-full: 9999px; /* Fully rounded */

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

/* ============================================
   UTILITY CLASSES - BACKGROUNDS
   ============================================ */

.bg-primary {
  background-color: var(--primary-color);
}

.bg-primary-light {
  background-color: var(--primary-light);
}

.bg-primary-dark {
  background-color: var(--primary-dark);
}

.bg-accent {
  background-color: var(--accent-color);
}

.bg-accent-blue {
  background-color: var(--accent-blue);
}

.bg-sidebar {
  background-color: var(--sidebar-bg);
}

.bg-card {
  background-color: var(--card-bg);
}

.bg-input {
  background-color: var(--input-bg);
}

.bg-hover {
  background-color: var(--hover-bg);
}

.bg-avatar {
  background-color: var(--avatar-bg);
}

.bg-stroke {
  background-color: var(--stroke);
}

/* Status Backgrounds */
.bg-success {
  background-color: var(--success-color);
}

.bg-warning {
  background-color: var(--warning-color);
}

.bg-error {
  background-color: var(--error-color);
}

.bg-info {
  background-color: var(--info-color);
}

/* ============================================
   UTILITY CLASSES - GRADIENTS
   ============================================ */

.bg-gradient-brand {
  background: linear-gradient(135deg, #00b0ef, #0058cc);
}

.bg-brand-gradient {
  background: var(--gradient-bg);
}

.text-brand-gradient {
  background: linear-gradient(135deg, #00b0ef, #0058cc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ============================================
   UTILITY CLASSES - TEXT COLORS
   ============================================ */

.text-primary-color {
  color: var(--primary-color);
}

.text-primary-light {
  color: var(--primary-light);
}

.text-primary-dark {
  color: var(--primary-dark);
}

.text-text-primary {
  color: var(--text-primary);
}

.text-text-secondary {
  color: var(--text-secondary);
}

.text-text-muted {
  color: var(--text-muted);
}

.text-brand-primary {
  color: var(--brand-primary);
}

.text-link {
  color: var(--link-color);
}

/* Status Text Colors */
.text-success {
  color: var(--success-color);
}

.text-warning {
  color: var(--warning-color);
}

.text-error {
  color: var(--error-color);
}

.text-info {
  color: var(--info-color);
}

/* ============================================
   UTILITY CLASSES - BORDERS
   ============================================ */

.border-color {
  border-color: var(--border-color);
}

.border-stroke {
  border-color: var(--stroke);
}

.border-input {
  border-color: var(--input-border);
}

.border-card {
  border-color: var(--card-border);
}

.border-primary {
  border-color: var(--primary-color);
}

/* ============================================
   UTILITY CLASSES - HOVER STATES
   ============================================ */

.hover\:bg-primary:hover {
  background-color: var(--primary-color);
}

.hover\:bg-primary-light:hover {
  background-color: var(--primary-light);
}

.hover\:bg-accent-blue:hover {
  background-color: var(--accent-blue);
}

.hover\:bg-hover:hover {
  background-color: var(--hover-bg);
}

.hover\:text-link:hover {
  color: var(--link-hover);
}

.hover\:text-primary:hover {
  color: var(--primary-color);
}

.hover\:border-primary:hover {
  border-color: var(--primary-color);
}

/* ============================================
   UTILITY CLASSES - CHAT COMPONENTS
   ============================================ */

.chat-input {
  background-color: var(--chat-input-bg);
  border-color: var(--chat-input-border);
  color: var(--chat-input-text);
}

.chat-input::placeholder {
  color: var(--chat-input-placeholder);
}

.chat-button-primary {
  background-color: var(--chat-primary);
  color: white;
}

.chat-button-primary:hover {
  background-color: var(--chat-primary-hover);
}

.chat-button-secondary {
  background-color: var(--chat-secondary);
  color: white;
}

.chat-button-secondary:hover {
  background-color: var(--chat-secondary-hover);
}

.chat-tab-active {
  color: var(--chat-tab-active);
}

.chat-tab-inactive {
  color: var(--chat-tab-inactive);
}

/* ============================================
   UTILITY CLASSES - SHADOWS
   ============================================ */

.shadow-sm {
  box-shadow: var(--shadow-sm);
}

.shadow-md {
  box-shadow: var(--shadow-md);
}

.shadow-lg {
  box-shadow: var(--shadow-lg);
}

.shadow-xl {
  box-shadow: var(--shadow-xl);
}

/* ============================================
   UTILITY CLASSES - BORDER RADIUS
   ============================================ */

.rounded-sm {
  border-radius: var(--radius-sm);
}

.rounded-md {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-2xl {
  border-radius: var(--radius-2xl);
}

.rounded-full {
  border-radius: var(--radius-full);
}

/* ============================================
   COMPONENT CLASSES
   ============================================ */

/* Button Base */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Button Variants */
.btn-primary {
  background-color: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--button-hover);
}

.btn-secondary {
  background-color: transparent;
  color: var(--text-primary);
  border-color: var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--hover-bg);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-primary);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--hover-bg);
}

/* Input Base */
.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--input-text);
  transition: all 0.2s ease;
}

.input::placeholder {
  color: var(--input-placeholder);
}

.input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 88, 204, 0.1);
}

.input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Card Base */
.card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

/* Link Base */
.link {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.link:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Separator */
.separator {
  height: 1px;
  background-color: var(--separator-color);
  border: none;
}

.separator-vertical {
  width: 1px;
  background-color: var(--separator-color);
  border: none;
}

/* Avatar */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--avatar-bg);
  border-radius: var(--radius-full);
  color: white;
  font-weight: 600;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--radius-md);
}

.badge-primary {
  background-color: var(--primary-color);
  color: white;
}

.badge-success {
  background-color: var(--success-color);
  color: white;
}

.badge-warning {
  background-color: var(--warning-color);
  color: white;
}

.badge-error {
  background-color: var(--error-color);
  color: white;
}

.badge-info {
  background-color: var(--info-color);
  color: white;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 640px) {
  :root {
    --spacing-lg: 1rem;
    --spacing-xl: 1.5rem;
  }
}

/* ============================================
   DARK MODE SUPPORT (Optional)
   ============================================ */

@media (prefers-color-scheme: dark) {
  .dark-mode {
    --background: #1f2937;
    --sidebar-bg: #111827;
    --border-color: #374151;
    --text-primary: #e5e7eb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --hover-bg: #374151;
    --card-bg: #1f2937;
    --input-bg: #374151;
    --separator-color: #4b5563;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .no-print {
    display: none !important;
  }

  .btn,
  .link {
    color: inherit;
    text-decoration: none;
  }

  .card {
    border: 1px solid #000;
    box-shadow: none;
  }
}
