/* Design Tokens - Light Mode (default) */
:root {
  --background: #fafafa;
  --foreground: #0f172a;
  --card: #ffffff;
  --muted: #f1f5f9;
  --muted-foreground: #64748b;
  --border: #e2e8f0;
  --primary: #3b82f6;
  --primary-foreground: #ffffff;
  --accent: #8b5cf6;
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
}

/* Dark Mode */
.dark {
  --background: #0f172a;
  --foreground: #f8fafc;
  --card: #1e293b;
  --muted: #334155;
  --muted-foreground: #94a3b8;
  --border: #334155;
  --primary: #3b82f6;
  --primary-foreground: #ffffff;
  --accent: #8b5cf6;
  --accent-foreground: #ffffff;
  --destructive: #ef4444;
}

/* Apply design tokens */
.bg-background {
  background-color: var(--background) !important;
}
.text-foreground {
  color: var(--foreground) !important;
}
.bg-card {
  background-color: var(--card) !important;
}
.bg-muted {
  background-color: var(--muted) !important;
}
.bg-muted\/50 {
  background-color: color-mix(in srgb, var(--muted) 50%, transparent) !important;
}
.hover\:bg-muted\/50:hover {
  background-color: color-mix(in srgb, var(--muted) 50%, transparent) !important;
}
.text-muted-foreground {
  color: var(--muted-foreground) !important;
}
.border-border {
  border-color: var(--border) !important;
}
.bg-primary {
  background-color: var(--primary) !important;
}
.bg-primary\/90 {
  background-color: color-mix(in srgb, var(--primary) 90%, transparent) !important;
}
.hover\:bg-primary\/90:hover {
  background-color: color-mix(in srgb, var(--primary) 90%, transparent) !important;
}
.bg-primary\/10 {
  background-color: color-mix(in srgb, var(--primary) 10%, transparent) !important;
}
.bg-primary\/20 {
  background-color: color-mix(in srgb, var(--primary) 20%, transparent) !important;
}
.text-primary {
  color: var(--primary) !important;
}
.text-primary-foreground {
  color: var(--primary-foreground) !important;
}
.bg-accent {
  background-color: var(--accent) !important;
}
.bg-accent\/10 {
  background-color: color-mix(in srgb, var(--accent) 10%, transparent) !important;
}
.bg-accent\/20 {
  background-color: color-mix(in srgb, var(--accent) 20%, transparent) !important;
}
.hover\:bg-accent\/90:hover {
  background-color: color-mix(in srgb, var(--accent) 90%, transparent) !important;
}
.text-accent {
  color: var(--accent) !important;
}
.text-accent-foreground {
  color: var(--accent-foreground) !important;
}
.bg-destructive {
  background-color: var(--destructive) !important;
}
.bg-destructive\/10 {
  background-color: color-mix(in srgb, var(--destructive) 10%, transparent) !important;
}
.text-destructive {
  color: var(--destructive) !important;
}
.border-destructive\/20 {
  border-color: color-mix(in srgb, var(--destructive) 20%, transparent) !important;
}
.focus\:border-primary:focus {
  border-color: var(--primary) !important;
}
.hover\:bg-muted:hover {
  background-color: var(--muted) !important;
}
.hover\:text-foreground:hover {
  color: var(--foreground) !important;
}

/* Utility classes */
.transition-colors {
  transition-property: color, background-color, border-color;
  transition-duration: 200ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animation for task details */
@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    max-height: 5000px;
    transform: translateY(0);
  }
}

.animate-slideDown {
  animation: slideDown 0.3s ease-out forwards;
}

.task-details {
  overflow: hidden;
}

.task-details.hidden {
  display: none;
}

/* Line clamp utility */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   AI Dashboard Styles
   ========================================================================== */

/* AI Command Bar Container */
.ai-command-bar {
  position: relative;
  z-index: 20;
}

/* Glassmorphism effect for command bar */
.ai-command-bar-glass {
  background: color-mix(in srgb, var(--card) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.dark .ai-command-bar-glass {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Animated gradient border */
.ai-gradient-border {
  position: relative;
  border-radius: 1rem;
}

.ai-gradient-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: calc(1rem + 2px);
  background: linear-gradient(135deg, var(--primary), var(--accent), var(--primary));
  background-size: 200% 200%;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.ai-gradient-border:focus-within::before {
  opacity: 1;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* AI Card (Briefing Card) */
.ai-card {
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary) 5%, var(--card)),
    color-mix(in srgb, var(--accent) 5%, var(--card))
  );
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  position: relative;
  overflow: hidden;
}

.ai-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* AI Insight Row */
.ai-insight {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.5rem;
  background: color-mix(in srgb, var(--muted) 50%, transparent);
  transition: background 0.2s ease;
}

.ai-insight:hover {
  background: var(--muted);
}

/* AI Insight Icon */
.ai-insight-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
}

.ai-insight-icon.warning {
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  color: #f59e0b;
}

.ai-insight-icon.danger {
  background: color-mix(in srgb, var(--destructive) 15%, transparent);
  color: var(--destructive);
}

.ai-insight-icon.info {
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
}

.ai-insight-icon.success {
  background: color-mix(in srgb, #22c55e 15%, transparent);
  color: #22c55e;
}

/* AI Suggestion Pills */
.ai-suggestion-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-suggestion-pill:hover {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 5%, var(--card));
  transform: translateY(-1px);
}

.ai-suggestion-pill.primary {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.ai-suggestion-pill.primary:hover {
  background: color-mix(in srgb, var(--primary) 90%, black);
}

/* Pulse Animation for Primary Suggestion */
.ai-pulse {
  animation: aiPulse 2s ease-in-out infinite;
}

@keyframes aiPulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 40%, transparent); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

/* AI Sparkle Animation */
@keyframes sparkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
  50% { transform: scale(1.1) rotate(5deg); opacity: 0.8; }
}

.ai-sparkle {
  animation: sparkle 2s ease-in-out infinite;
}

/* AI Powered Badge */
.ai-powered-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* AI Confidence Indicator */
.ai-confidence {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Keyboard Shortcut Badge */
kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-family: inherit;
  border-radius: 0.25rem;
  background: var(--muted);
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--border);
  color: var(--muted-foreground);
}

/* Stat Card with AI Prediction */
.stat-card {
  position: relative;
}

.stat-card-prediction {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(0.5rem);
  padding: 0.5rem 0.75rem;
  background: var(--foreground);
  color: var(--background);
  font-size: 0.75rem;
  border-radius: 0.5rem;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  z-index: 50;
}

.stat-card-prediction::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--foreground);
}

.stat-card:hover .stat-card-prediction {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-0.25rem);
}

/* AI Feedback Buttons */
.ai-feedback-btn {
  padding: 0.375rem;
  border-radius: 0.375rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.2s ease;
}

.ai-feedback-btn:hover {
  background: var(--muted);
  color: var(--foreground);
}

.ai-feedback-btn.active-positive {
  background: color-mix(in srgb, #22c55e 15%, transparent);
  border-color: #22c55e;
  color: #22c55e;
}

.ai-feedback-btn.active-negative {
  background: color-mix(in srgb, var(--destructive) 15%, transparent);
  border-color: var(--destructive);
  color: var(--destructive);
}

/* AI Loading State */
.ai-loading {
  position: relative;
  overflow: hidden;
}

.ai-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
    transparent,
    color-mix(in srgb, var(--primary) 10%, transparent),
    transparent
  );
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ============================================
   TEAM WORKLOAD VISUALIZATION
   ============================================ */

/* Avatar Colors */
.avatar-blue {
  background-color: #3b82f6;
}
.avatar-purple {
  background-color: #8b5cf6;
}
.avatar-green {
  background-color: #22c55e;
}
.avatar-orange {
  background-color: #f97316;
}
.avatar-pink {
  background-color: #ec4899;
}
.avatar-gray {
  background-color: #64748b;
}

/* Health Dot Indicators */
.health-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}

.health-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.3;
}

.health-dot-green {
  background: #22c55e;
  color: #22c55e;
}
.health-dot-yellow {
  background: #eab308;
  color: #eab308;
}
.health-dot-red {
  background: #ef4444;
  color: #ef4444;
}

/* Workload Progress Bar */
.workload-bar {
  height: 6px;
  background: var(--muted);
  border-radius: 9999px;
  overflow: hidden;
}

.workload-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.workload-fill.low {
  background: #22c55e;
}
.workload-fill.medium {
  background: #eab308;
}
.workload-fill.high {
  background: #ef4444;
}

/* Text Danger Color */
.text-danger {
  color: #ef4444;
}
.text-success {
  color: #22c55e;
}
.text-warning {
  color: #eab308;
}
