/* SKYMEL CSS Variables - Clean & Futuristic */
:root {
  /* SKYMEL Electric Blue Palette */
  --primary: 200 95% 60%;          /* Electric Cyan Accent */
  --primary-foreground: 220 15% 7%;
  --primary-hover: 200 95% 65%;

  /* High-Contrast Surfaces (Light Mode) */
  --background: 0 0% 100%;         /* Pure white */
  --surface: 220 14% 96%;          /* Light surface */
  --surface-2: 220 14% 94%;        /* Elevated surface */
  --foreground: 220 87% 6%;        /* High contrast text */

  /* High-Contrast Semantic Colors */
  --success: 142 71% 45%;
  --success-foreground: 355 100% 97%;
  --warning: 38 92% 50%;
  --warning-foreground: 48 96% 53%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 210 20% 98%;

  /* High-Contrast Monochrome System */
  --muted: 220 14% 94%;
  --muted-foreground: 220 9% 46%;
  --border: 220 13% 87%;
  --input: 220 14% 96%;
  --ring: 200 95% 60%;

  /* High-Contrast Cards & Surfaces */
  --card: 0 0% 100%;
  --card-foreground: 220 87% 6%;
  --popover: 0 0% 100%;
  --popover-foreground: 220 87% 6%;

  /* Minimal Spacing System (8pt Grid) */
  --radius: 0.5rem;               /* 8px - clean, minimal */
  --radius-sm: 0.25rem;           /* 4px */
  --radius-lg: 0.75rem;           /* 12px */

  /* Professional Elevation System */
  --elevation-0: none;
  --elevation-1: 0 1px 3px hsl(220 15% 0% / 0.05);
  --elevation-2: 0 4px 12px hsl(220 15% 0% / 0.08);

  /* Clean Spacing (8pt System) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-12: 3rem;    /* 48px */

  /* Additional radius sizes */
  --radius-xl: 1rem;   /* 16px */
}

.dark {
  /* High-Contrast Dark Mode */
  --background: 220 13% 9%;        /* Deep dark */
  --surface: 220 13% 11%;          /* Dark surface */
  --surface-2: 220 13% 15%;        /* Elevated surface */
  --foreground: 220 13% 91%;       /* High contrast light text */

  /* High-Contrast Monochrome System (Dark) */
  --muted: 220 13% 19%;
  --muted-foreground: 220 9% 55%;
  --border: 220 13% 23%;
  --input: 220 13% 11%;
  --ring: 200 95% 60%;

  /* High-Contrast Cards & Surfaces (Dark) */
  --card: 220 13% 11%;
  --card-foreground: 220 13% 91%;
  --popover: 220 13% 11%;
  --popover-foreground: 220 13% 91%;

  /* Professional Elevation System (Dark) */
  --elevation-0: none;
  --elevation-1: 0 1px 3px hsl(220 15% 0% / 0.1);
  --elevation-2: 0 4px 12px hsl(220 15% 0% / 0.15);
}

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

html {
  scroll-behavior: smooth;
}

/* Professional Typography */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9375rem;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  letter-spacing: -0.005em;
  transition: color 0.15s ease-out, background-color 0.15s ease-out;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Display Typography */
h1, h2, .logo-text {
  font-family: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Clean background - no patterns */
body::before {
  display: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Header - Enhanced */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: hsl(var(--background) / 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-0);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  gap: var(--space-4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.auth-section {
  display: flex;
  align-items: center;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(var(--border));
}

.user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

.user-email {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.2;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  min-height: 2.25rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-mark {
  color: hsl(var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.1);
}

.logo-text-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  transition: color 0.15s ease-out;
  line-height: 1;
  margin: 0;
}

/* Removed shimmer animation for clean design */

.logo-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.025em;
  margin-top: -2px;
}

/* Navigation - Enhanced */
.nav {
  display: flex;
  gap: var(--space-2);
}

.nav-link {
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius);
  transition: all 0.15s ease-out;
  font-weight: 500;
  font-size: 0.9375rem;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: hsl(var(--foreground));
  background-color: hsl(var(--surface));
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 1px;
  background: hsl(var(--primary));
  border-radius: 0.5px;
}

/* Theme Toggle - Enhanced */
.theme-toggle {
  padding: var(--space-3);
  background: transparent;
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease-out;
  font-size: 1.125rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: hsl(var(--surface));
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: var(--elevation-1);
}

/* Dashboard Layout */
.quick-stats {
  margin: var(--space-8) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
}

.stat-card {
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--card) / 0.8) 100%);
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  text-align: left;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--primary) / 0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-2);
  border-color: hsl(var(--primary) / 0.2);
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--surface)) 100%);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stat-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.1), hsl(var(--primary) / 0.05));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.1);
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  line-height: 1;
  margin-bottom: var(--space-1);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.stat-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  letter-spacing: 0.025em;
}

.stat-trend {
  font-size: 0.75rem;
  color: hsl(var(--success));
  font-weight: 600;
  opacity: 0.8;
}

/* Enhanced Agent Cards */
.agent-header {
  position: relative;
  margin-bottom: var(--space-3);
}

.agent-status-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
}

.agent-status-badge {
  background: hsl(var(--success));
  color: hsl(var(--success-foreground));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border: 1px solid hsl(var(--success) / 0.2);
}

.agent-personality-tag {
  display: inline-block;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  margin-bottom: var(--space-3);
}

.agent-stats {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: 0.8125rem;
}

.agent-stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.agent-stat-number {
  font-weight: 600;
  color: hsl(var(--primary));
}

.agent-stat-label {
  color: hsl(var(--muted-foreground));
}

.agent-stat-divider {
  color: hsl(var(--muted-foreground));
  font-weight: 300;
}

.btn-full {
  width: 100%;
}

/* Views - Enhanced */
.main {
  min-height: calc(100vh - 4.5rem);
  padding: var(--space-8) 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#agents-view {
  background: hsl(var(--background));
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.view-title {
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}

.view-subtitle {
  color: hsl(var(--muted-foreground));
  margin-top: var(--space-2);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.5;
}

/* Buttons - Enhanced */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease-out;
  white-space: nowrap;
  min-height: 2.5rem;
  letter-spacing: -0.006em;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-primary:hover {
  background-color: hsl(var(--primary-hover));
  box-shadow: var(--elevation-1);
}

.btn-primary:active {
  background-color: hsl(var(--primary));
  opacity: 0.9;
}

.btn-outline {
  background-color: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

.btn-outline:hover {
  background-color: hsl(var(--surface));
  border-color: hsl(var(--primary) / 0.5);
}

.btn-outline:active {
  background-color: hsl(var(--surface-2));
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Cards */
.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--elevation-0);
}

.card-header {
  padding: 1.5rem 1.5rem 0;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
}

.card-content {
  padding: 1.5rem;
}

/* Agent Grid - Enhanced */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.agent-card {
  position: relative;
  padding: var(--space-6);
  text-align: center;
  transition: all 0.15s ease-out;
  cursor: pointer;
  border-radius: var(--radius-lg);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  overflow: hidden;
}

.agent-card:hover {
  box-shadow: var(--elevation-1);
  border-color: hsl(var(--primary) / 0.25);
}

.agent-card:active {
  opacity: 0.95;
  box-shadow: var(--elevation-1);
}

/* Removed gradient overlay - professional hover instead */
.agent-card:hover {
  box-shadow: var(--elevation-1);
  background-color: hsl(var(--surface));
}

/* Personality-based accent colors */
.agent-card[data-personality="helpful"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="professional"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="creative"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="analytical"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="humorous"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="casual"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--surface));
  border-radius: var(--radius-xl);
  border: 2px solid hsl(var(--border) / 0.3);
  transition: all 0.15s ease-out;
  position: relative;
  overflow: hidden;
}

.agent-card:hover .agent-icon {
  background: hsl(var(--surface-2));
  box-shadow: var(--elevation-0);
  border-color: hsl(var(--primary) / 0.4);
}

.agent-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}

.agent-type {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--space-3);
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.025em;
}

.agent-last-used {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground) / 0.8);
  margin-bottom: var(--space-4);
  font-weight: 400;
}

.agent-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.agent-actions .btn {
  font-size: 0.8125rem;
  padding: var(--space-2) var(--space-3);
  min-height: 2.25rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  max-width: 420px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out;
}

.empty-icon-circle {
  width: 96px;
  height: 96px;
  background: hsl(var(--muted));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-size: 2.25rem;
  color: hsl(var(--muted-foreground));
  box-shadow: var(--elevation-0);
  transition: all 0.15s ease-out;
}

.empty-icon-circle:hover {
  color: hsl(var(--primary));
  box-shadow: var(--elevation-1);
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.025em;
}

.empty-state p {
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--space-6);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Forms - Enhanced */
.create-form-container {
  max-width: 520px;
  margin: 0 auto;
}

.create-form {
  background-color: hsl(var(--card));
  padding: var(--space-8);
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius-lg);
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: hsl(var(--foreground));
  letter-spacing: -0.006em;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  font-size: 0.9375rem;
  transition: all 0.15s ease-out;
  box-shadow: var(--elevation-0);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

/* Chat */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid hsl(var(--border));
  gap: 1rem;
  flex-wrap: wrap;
}

.chat-agent-info {
  text-align: center;
  flex: 1;
}

.chat-agent-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.chat-agent-status {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  padding: 0.25rem 0.75rem;
  background-color: hsl(142 76% 36% / 0.1);
  color: hsl(142 76% 36%);
  border-radius: var(--radius);
}

.chat-container {
  height: 600px;
  display: flex;
  flex-direction: column;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  word-wrap: break-word;
}

.chat-message.user {
  align-self: flex-end;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-bottom-right-radius: 0.25rem;
}

.chat-message.agent {
  align-self: flex-start;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-bottom-left-radius: 0.25rem;
}

.chat-input-form {
  border-top: 1px solid hsl(var(--border));
  padding: 1rem;
}

.chat-input-container {
  display: flex;
  gap: 0.75rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
}

.chat-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Recent Activity */
.recent-activity {
  margin-top: 2rem;
  animation: fadeInUp 0.6s ease-out;
  animation-delay: 200ms;
  animation-fill-mode: both;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.activity-dot {
  width: 8px;
  height: 8px;
  background-color: hsl(var(--primary));
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-text {
  font-size: 0.875rem;
}

.activity-date {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* Loading */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsl(var(--background) / 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid hsl(var(--muted));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Enhanced Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px hsl(var(--primary) / 0.5);
  }
  50% {
    box-shadow: 0 0 20px hsl(var(--primary) / 0.8);
  }
}

/* Smooth transitions for all interactive elements */
.btn, .nav-link, .agent-card, .form-input, .form-textarea, .form-select {
  transition: all 0.15s ease-out;
}

/* Add stagger animation for agent grid */
.agents-grid .agent-card:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.1s both; }
.agents-grid .agent-card:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.2s both; }
.agents-grid .agent-card:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.3s both; }
.agents-grid .agent-card:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.4s both; }
.agents-grid .agent-card:nth-child(5) { animation: fadeInUp 0.6s ease-out 0.5s both; }
.agents-grid .agent-card:nth-child(n+6) { animation: fadeInUp 0.6s ease-out 0.6s both; }

/* Loading state improvements */
.loading-spinner {
  animation: spin 1s linear infinite;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--elevation-1);
  animation: slideInRight 0.15s ease-out;
  max-width: 350px;
}

.toast.success {
  border-left: 4px solid hsl(142 76% 36%);
}

.toast.error {
  border-left: 4px solid hsl(var(--destructive));
}

/* Duplicate animations removed - using consolidated set above */

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .agents-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .chat-container {
    height: 500px;
  }

  .chat-header {
    flex-direction: column;
    text-align: center;
  }

  .form-actions {
    flex-direction: column;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Professional agent card styling - no glow */
.agent-card-glow {
  position: relative;
  transition: all 0.2s ease-out;
}

/* ==============================================
   TASK-BASED INTERFACE - NEW DESIGN
   ============================================== */

/* Task View Layout */
.task-view {
  background: hsl(var(--background));
}

.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.task-title-section {
  text-align: center;
  flex: 1;
}

.task-title {
  font-size: 2.25rem;
  font-weight: 600;
  color: hsl(var(--primary));
  margin-bottom: var(--space-2);
  letter-spacing: -0.025em;
}

.task-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 1.0625rem;
  font-weight: 400;
}

.task-workspace {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-8);
  min-height: 600px;
}

/* Agent Profile Card */
.agent-profile-card {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-1);
  padding: var(--space-6);
  height: fit-content;
  position: sticky;
  top: calc(4.5rem + var(--space-4));
}

.agent-profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  position: relative;
}

.agent-profile-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  background: hsl(var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid hsl(var(--border) / 0.3);
  box-shadow: var(--elevation-0);
}

.agent-profile-info {
  flex: 1;
}

.agent-profile-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: hsl(var(--foreground));
}

.agent-profile-personality {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.5);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-transform: capitalize;
}

.agent-status-indicator {
  position: absolute;
  top: -8px;
  right: -8px;
}

.agent-status-badge {
  background: hsl(var(--success));
  color: hsl(var(--success-foreground));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  box-shadow: var(--elevation-0);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: var(--elevation-0), 0 0 0 0 hsl(var(--success) / 0.4);
  }
  50% {
    box-shadow: var(--elevation-0), 0 0 0 4px hsl(var(--success) / 0.1);
  }
}

.agent-profile-description {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  border-left: 3px solid hsl(var(--primary) / 0.5);
}

.agent-profile-description p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: hsl(var(--foreground));
  margin: 0;
}

.capabilities-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.capabilities-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.capability-tag {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid hsl(var(--border) / 0.3);
}

/* Task Interface */
.task-interface {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Task Input Section */
.task-input-section {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-0);
  padding: var(--space-6);
}

.task-input-header {
  margin-bottom: var(--space-4);
}

.task-input-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: hsl(var(--primary));
}

.task-input-header p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}

.task-input-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.task-input {
  width: 100%;
  min-height: 120px;
  padding: var(--space-4);
  background: hsl(var(--background));
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  resize: vertical;
  transition: all 0.15s ease-out;
}

.task-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1), var(--glow-subtle);
}

.task-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Plan Visualization */
.plan-section {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-0);
  padding: var(--space-6);
  animation: fadeInUp 0.5s ease-out;
}

.plan-header {
  margin-bottom: var(--space-4);
}

.plan-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: hsl(var(--primary));
}

.plan-header p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}

.plan-visualization {
  margin-bottom: var(--space-6);
  padding: var(--space-8);
  background: hsl(220 15% 7%);
  border-radius: var(--radius);
  min-height: 400px;
  position: relative;
  overflow: visible;
}

.plan-graph {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.plan-node {
  position: absolute;
  width: 200px;
  min-height: 80px;
  padding: var(--space-4);
  background: hsl(var(--background));
  border-radius: var(--radius-lg);
  border: 2px solid;
  transition: all 0.15s ease-out;
  animation: fadeInScale 0.5s ease-out;
}

.plan-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-1);
}

/* Node type colors */
.plan-node.input {
  border-color: hsl(160 100% 50%);
  box-shadow: 0 0 20px hsl(160 100% 50% / 0.3);
}

.plan-node.processing {
  border-color: hsl(200 95% 60%);
  box-shadow: 0 0 20px hsl(200 95% 60% / 0.3);
}

.plan-node.output {
  border-color: hsl(280 100% 70%);
  box-shadow: 0 0 20px hsl(280 100% 70% / 0.3);
}

.plan-node-content {
  text-align: center;
}

.plan-node-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: hsl(var(--foreground));
  font-size: 0.9375rem;
}

.plan-node-subtitle {
  font-size: 0.75rem;
  color: hsl(var(--primary));
  margin-bottom: var(--space-1);
  font-weight: 500;
}

.plan-node-description {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.3;
}

/* Interactive Node States */
.plan-node.pending {
  opacity: 0.7;
  border-style: dashed;
}

.plan-node.executing {
  border-color: hsl(45 100% 60%);
  box-shadow: 0 0 30px hsl(45 100% 60% / 0.6);
  background: hsl(45 100% 95%);
  animation: pulse 1.5s infinite;
}

.plan-node.completed {
  border-color: hsl(120 100% 40%);
  box-shadow: 0 0 20px hsl(120 100% 40% / 0.4);
  background: hsl(120 100% 95%);
  opacity: 1;
}

.plan-node.completed::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: hsl(120 100% 40%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.75rem;
}

/* Pulse animation for executing nodes */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 30px hsl(45 100% 60% / 0.6);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 40px hsl(45 100% 60% / 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 30px hsl(45 100% 60% / 0.6);
  }
}

/* Cytoscape Container */
#cytoscape-container {
  width: 100% !important;
  height: 500px !important;
  min-height: 500px;
  position: relative;
  border-radius: var(--radius-lg);
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  overflow: hidden;
}

#plan-visualization {
  width: 100%;
  min-height: 500px;
  position: relative;
}

/* Graph connections */
.plan-connection {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.plan-connection-line {
  stroke: hsl(var(--primary));
  stroke-width: 2;
  fill: none;
  opacity: 0.6;
}

.plan-connection-arrow {
  fill: hsl(var(--primary));
  opacity: 0.6;
}

/* Active connection animations */
.plan-connection-line.active-connection {
  stroke: hsl(120 100% 50%);
  stroke-width: 3;
  opacity: 1;
  animation: flowPulse 1.5s ease-in-out infinite;
}

.plan-connection-arrow.active-connection {
  fill: hsl(120 100% 50%);
  opacity: 1;
}

@keyframes flowPulse {
  0%, 100% {
    stroke-dasharray: 0;
  }
  50% {
    stroke-dasharray: 10, 5;
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.plan-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}

/* Progress Section */
.progress-section {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-0);
  padding: var(--space-6);
  animation: fadeInUp 0.5s ease-out;
}

.progress-header {
  margin-bottom: var(--space-4);
}

.progress-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: hsl(var(--primary));
}

.progress-header p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}

.progress-container {
  margin-bottom: var(--space-6);
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: hsl(var(--muted));
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: var(--space-2);
  border: 1px solid hsl(var(--border));
}

.progress-fill {
  height: 100%;
  background: hsl(var(--surface));
  border-radius: 6px;
  transition: width 0.15s ease-out;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, hsl(var(--background) / 0.3) 50%, transparent 100%);
  animation: shimmer-progress 1.5s infinite;
}

@keyframes shimmer-progress {
  0% { opacity: 0.3; }
  50% { opacity: 0.8; }
  100% { opacity: 0.3; }
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-text {
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
  font-weight: 500;
}

.progress-percent {
  font-size: 0.875rem;
  color: hsl(var(--primary));
  font-weight: 600;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius);
  transition: all 0.15s ease-out;
}

.progress-step.active {
  background: hsl(var(--primary) / 0.15);
  border-left: 3px solid hsl(var(--primary));
}

.progress-step.completed {
  background: hsl(var(--success) / 0.1);
}

.progress-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s ease-out;
}

.progress-step-icon.pending {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.progress-step-icon.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  animation: spin-pulse 1s ease-in-out infinite;
}

.progress-step-icon.completed {
  background: hsl(var(--success));
  color: hsl(var(--success-foreground));
}

@keyframes spin-pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.progress-step-text {
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

/* Results Section */
.results-section {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-1);
  padding: var(--space-6);
  animation: fadeInUp 0.5s ease-out;
}

.results-header {
  margin-bottom: var(--space-6);
  text-align: center;
}

.results-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: hsl(var(--primary));
}

.results-header p {
  color: hsl(var(--muted-foreground));
  font-size: 1.0625rem;
}

.results-content {
  background: hsl(var(--muted) / 0.2);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border: 2px dashed hsl(var(--border));
  min-height: 200px;
}

.result-item {
  padding: var(--space-4);
  background: hsl(var(--background));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border) / 0.5);
  margin-bottom: var(--space-3);
  box-shadow: var(--elevation-0);
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: hsl(var(--primary));
}

.result-item p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: hsl(var(--foreground));
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
}

/* Fun Loading States */
.bouncing-dots {
  display: inline-flex;
  gap: 2px;
}

.bouncing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--primary));
  animation: bouncing 1.4s ease-in-out infinite both;
}

.bouncing-dot:nth-child(1) { animation-delay: -0.32s; }
.bouncing-dot:nth-child(2) { animation-delay: -0.16s; }
.bouncing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes bouncing {
  0%, 80%, 100% {
    opacity: 0.5;
  }
  40% {
    opacity: 1;
  }
}

/* Hide old chat elements */
.chat-container,
.chat-messages,
.chat-input-form {
  display: none;
}

/* Responsive Design for Task Interface */
@media (max-width: 768px) {
  .task-workspace {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .agent-profile-card {
    position: static;
  }

  .task-input-actions {
    flex-direction: column;
  }

  .plan-actions,
  .results-actions {
    flex-direction: column;
  }

  /* Remove hero responsive styles */
}/* SKYMEL CSS Variables - Clean & Futuristic */
:root {
  /* SKYMEL Electric Blue Palette */
  --primary: 200 95% 60%;          /* Electric Cyan Accent */
  --primary-foreground: 220 15% 7%;
  --primary-hover: 200 95% 65%;

  /* High-Contrast Surfaces (Light Mode) */
  --background: 0 0% 100%;         /* Pure white */
  --surface: 220 14% 96%;          /* Light surface */
  --surface-2: 220 14% 94%;        /* Elevated surface */
  --foreground: 220 87% 6%;        /* High contrast text */

  /* High-Contrast Semantic Colors */
  --success: 142 71% 45%;
  --success-foreground: 355 100% 97%;
  --warning: 38 92% 50%;
  --warning-foreground: 48 96% 53%;
  --destructive: 0 84% 60%;
  --destructive-foreground: 210 20% 98%;

  /* High-Contrast Monochrome System */
  --muted: 220 14% 94%;
  --muted-foreground: 220 9% 46%;
  --border: 220 13% 87%;
  --input: 220 14% 96%;
  --ring: 200 95% 60%;

  /* High-Contrast Cards & Surfaces */
  --card: 0 0% 100%;
  --card-foreground: 220 87% 6%;
  --popover: 0 0% 100%;
  --popover-foreground: 220 87% 6%;

  /* Minimal Spacing System (8pt Grid) */
  --radius: 0.5rem;               /* 8px - clean, minimal */
  --radius-sm: 0.25rem;           /* 4px */
  --radius-lg: 0.75rem;           /* 12px */

  /* Professional Elevation System */
  --elevation-0: none;
  --elevation-1: 0 1px 3px hsl(220 15% 0% / 0.05);
  --elevation-2: 0 4px 12px hsl(220 15% 0% / 0.08);

  /* Clean Spacing (8pt System) */
  --space-1: 0.25rem;  /* 4px */
  --space-2: 0.5rem;   /* 8px */
  --space-3: 0.75rem;  /* 12px */
  --space-4: 1rem;     /* 16px */
  --space-5: 1.25rem;  /* 20px */
  --space-6: 1.5rem;   /* 24px */
  --space-8: 2rem;     /* 32px */
  --space-12: 3rem;    /* 48px */

  /* Additional radius sizes */
  --radius-xl: 1rem;   /* 16px */
}

.dark {
  /* High-Contrast Dark Mode */
  --background: 220 13% 9%;        /* Deep dark */
  --surface: 220 13% 11%;          /* Dark surface */
  --surface-2: 220 13% 15%;        /* Elevated surface */
  --foreground: 220 13% 91%;       /* High contrast light text */

  /* High-Contrast Monochrome System (Dark) */
  --muted: 220 13% 19%;
  --muted-foreground: 220 9% 55%;
  --border: 220 13% 23%;
  --input: 220 13% 11%;
  --ring: 200 95% 60%;

  /* High-Contrast Cards & Surfaces (Dark) */
  --card: 220 13% 11%;
  --card-foreground: 220 13% 91%;
  --popover: 220 13% 11%;
  --popover-foreground: 220 13% 91%;

  /* Professional Elevation System (Dark) */
  --elevation-0: none;
  --elevation-1: 0 1px 3px hsl(220 15% 0% / 0.1);
  --elevation-2: 0 4px 12px hsl(220 15% 0% / 0.15);
}

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

html {
  scroll-behavior: smooth;
}

/* Professional Typography */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.9375rem;
  background-color: hsl(var(--background));
  color: hsl(var(--foreground));
  line-height: 1.5;
  letter-spacing: -0.005em;
  transition: color 0.15s ease-out, background-color 0.15s ease-out;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Display Typography */
h1, h2, .logo-text {
  font-family: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: 2rem;
}

h2 {
  font-size: 1.5rem;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
}

/* Clean background - no patterns */
body::before {
  display: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Header - Enhanced */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: hsl(var(--background) / 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-0);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  gap: var(--space-4);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.auth-section {
  display: flex;
  align-items: center;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.user-info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid hsl(var(--border));
}

.user-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  line-height: 1.2;
}

.user-email {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.2;
}

.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  min-height: 2.25rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-mark {
  color: hsl(var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: hsl(var(--primary) / 0.1);
}

.logo-text-container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
  transition: color 0.15s ease-out;
  line-height: 1;
  margin: 0;
}

/* Removed shimmer animation for clean design */

.logo-subtitle {
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(var(--muted-foreground));
  letter-spacing: 0.025em;
  margin-top: -2px;
}

/* Navigation - Enhanced */
.nav {
  display: flex;
  gap: var(--space-2);
}

.nav-link {
  padding: var(--space-2) var(--space-4);
  text-decoration: none;
  color: hsl(var(--muted-foreground));
  border-radius: var(--radius);
  transition: all 0.15s ease-out;
  font-weight: 500;
  font-size: 0.9375rem;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: hsl(var(--foreground));
  background-color: hsl(var(--surface));
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 1px;
  background: hsl(var(--primary));
  border-radius: 0.5px;
}

/* Theme Toggle - Enhanced */
.theme-toggle {
  padding: var(--space-3);
  background: transparent;
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease-out;
  font-size: 1.125rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  background-color: hsl(var(--surface));
  border-color: hsl(var(--primary) / 0.3);
  box-shadow: var(--elevation-1);
}

/* Dashboard Layout */
.quick-stats {
  margin: var(--space-8) 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-6);
}

.stat-card {
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--card) / 0.8) 100%);
  border: 1px solid hsl(var(--border) / 0.6);
  border-radius: var(--radius-lg);
  padding: var(--space-6) var(--space-5);
  text-align: left;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  backdrop-filter: blur(8px);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, hsl(var(--primary)), hsl(var(--primary) / 0.6));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-2);
  border-color: hsl(var(--primary) / 0.2);
  background: linear-gradient(135deg, hsl(var(--card)) 0%, hsl(var(--surface)) 100%);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stat-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, hsl(var(--primary) / 0.1), hsl(var(--primary) / 0.05));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: hsl(var(--primary));
  border: 1px solid hsl(var(--primary) / 0.1);
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 800;
  color: hsl(var(--foreground));
  line-height: 1;
  margin-bottom: var(--space-1);
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.stat-label {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  letter-spacing: 0.025em;
}

.stat-trend {
  font-size: 0.75rem;
  color: hsl(var(--success));
  font-weight: 600;
  opacity: 0.8;
}

/* Enhanced Agent Cards */
.agent-header {
  position: relative;
  margin-bottom: var(--space-3);
}

.agent-status-indicator {
  position: absolute;
  top: -4px;
  right: -4px;
}

.agent-status-badge {
  background: hsl(var(--success));
  color: hsl(var(--success-foreground));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  border: 1px solid hsl(var(--success) / 0.2);
}

.agent-personality-tag {
  display: inline-block;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  margin-bottom: var(--space-3);
}

.agent-stats {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  font-size: 0.8125rem;
}

.agent-stat {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.agent-stat-number {
  font-weight: 600;
  color: hsl(var(--primary));
}

.agent-stat-label {
  color: hsl(var(--muted-foreground));
}

.agent-stat-divider {
  color: hsl(var(--muted-foreground));
  font-weight: 300;
}

.btn-full {
  width: 100%;
}

/* Views - Enhanced */
.main {
  min-height: calc(100vh - 4.5rem);
  padding: var(--space-8) 0;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#agents-view {
  background: hsl(var(--background));
}

.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.view-title {
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}

.view-subtitle {
  color: hsl(var(--muted-foreground));
  margin-top: var(--space-2);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.5;
}

/* Buttons - Enhanced */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.15s ease-out;
  white-space: nowrap;
  min-height: 2.5rem;
  letter-spacing: -0.006em;
}

.btn-primary {
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-color: hsl(var(--primary));
}

.btn-primary:hover {
  background-color: hsl(var(--primary-hover));
  box-shadow: var(--elevation-1);
}

.btn-primary:active {
  background-color: hsl(var(--primary));
  opacity: 0.9;
}

.btn-outline {
  background-color: transparent;
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--border));
}

.btn-outline:hover {
  background-color: hsl(var(--surface));
  border-color: hsl(var(--primary) / 0.5);
}

.btn-outline:active {
  background-color: hsl(var(--surface-2));
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Cards */
.card {
  background-color: hsl(var(--card));
  color: hsl(var(--card-foreground));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--elevation-0);
}

.card-header {
  padding: 1.5rem 1.5rem 0;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.2;
}

.card-content {
  padding: 1.5rem;
}

/* Agent Grid - Enhanced */
.agents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
  margin-bottom: var(--space-8);
}

.agent-card {
  position: relative;
  padding: var(--space-6);
  text-align: center;
  transition: all 0.15s ease-out;
  cursor: pointer;
  border-radius: var(--radius-lg);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border) / 0.5);
  overflow: hidden;
}

.agent-card:hover {
  box-shadow: var(--elevation-1);
  border-color: hsl(var(--primary) / 0.25);
}

.agent-card:active {
  opacity: 0.95;
  box-shadow: var(--elevation-1);
}

/* Removed gradient overlay - professional hover instead */
.agent-card:hover {
  box-shadow: var(--elevation-1);
  background-color: hsl(var(--surface));
}

/* Personality-based accent colors */
.agent-card[data-personality="helpful"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="professional"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="creative"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="analytical"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="humorous"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-card[data-personality="casual"]::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: hsl(var(--primary) / 0.5);
  transition: all 0.15s ease-out;
}

.agent-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto var(--space-4);
  display: flex;
  align-items: center;
  justify-content: center;
  background: hsl(var(--surface));
  border-radius: var(--radius-xl);
  border: 2px solid hsl(var(--border) / 0.3);
  transition: all 0.15s ease-out;
  position: relative;
  overflow: hidden;
}

.agent-card:hover .agent-icon {
  background: hsl(var(--surface-2));
  box-shadow: var(--elevation-0);
  border-color: hsl(var(--primary) / 0.4);
}

.agent-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.025em;
  color: hsl(var(--foreground));
}

.agent-type {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--space-3);
  font-weight: 500;
  text-transform: capitalize;
  letter-spacing: 0.025em;
}

.agent-last-used {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground) / 0.8);
  margin-bottom: var(--space-4);
  font-weight: 400;
}

.agent-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.agent-actions .btn {
  font-size: 0.8125rem;
  padding: var(--space-2) var(--space-3);
  min-height: 2.25rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-8);
  max-width: 420px;
  margin: 0 auto;
  animation: fadeInUp 0.8s ease-out;
}

.empty-icon-circle {
  width: 96px;
  height: 96px;
  background: hsl(var(--muted));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
  font-size: 2.25rem;
  color: hsl(var(--muted-foreground));
  box-shadow: var(--elevation-0);
  transition: all 0.15s ease-out;
}

.empty-icon-circle:hover {
  color: hsl(var(--primary));
  box-shadow: var(--elevation-1);
}

.empty-state h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  letter-spacing: -0.025em;
}

.empty-state p {
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--space-6);
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Forms - Enhanced */
.create-form-container {
  max-width: 520px;
  margin: 0 auto;
}

.create-form {
  background-color: hsl(var(--card));
  padding: var(--space-8);
  border: 1px solid hsl(var(--border) / 0.5);
  border-radius: var(--radius-lg);
}

.form-group {
  margin-bottom: var(--space-6);
}

.form-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: hsl(var(--foreground));
  letter-spacing: -0.006em;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background-color: hsl(var(--background));
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  font-size: 0.9375rem;
  transition: all 0.15s ease-out;
  box-shadow: var(--elevation-0);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-8);
}

/* Chat */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid hsl(var(--border));
  gap: 1rem;
  flex-wrap: wrap;
}

.chat-agent-info {
  text-align: center;
  flex: 1;
}

.chat-agent-name {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.chat-agent-status {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  padding: 0.25rem 0.75rem;
  background-color: hsl(142 76% 36% / 0.1);
  color: hsl(142 76% 36%);
  border-radius: var(--radius);
}

.chat-container {
  height: 600px;
  display: flex;
  flex-direction: column;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  overflow: hidden;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chat-message {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  word-wrap: break-word;
}

.chat-message.user {
  align-self: flex-end;
  background-color: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-bottom-right-radius: 0.25rem;
}

.chat-message.agent {
  align-self: flex-start;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-bottom-left-radius: 0.25rem;
}

.chat-input-form {
  border-top: 1px solid hsl(var(--border));
  padding: 1rem;
}

.chat-input-container {
  display: flex;
  gap: 0.75rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius);
  background-color: hsl(var(--background));
}

.chat-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 2px hsl(var(--ring) / 0.2);
}

/* Recent Activity */
.recent-activity {
  margin-top: 2rem;
  animation: fadeInUp 0.6s ease-out;
  animation-delay: 200ms;
  animation-fill-mode: both;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid hsl(var(--border));
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.activity-dot {
  width: 8px;
  height: 8px;
  background-color: hsl(var(--primary));
  border-radius: 50%;
  flex-shrink: 0;
}

.activity-text {
  font-size: 0.875rem;
}

.activity-date {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
}

/* Loading */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: hsl(var(--background) / 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid hsl(var(--muted));
  border-top-color: hsl(var(--primary));
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Enhanced Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px hsl(var(--primary) / 0.5);
  }
  50% {
    box-shadow: 0 0 20px hsl(var(--primary) / 0.8);
  }
}

/* Smooth transitions for all interactive elements */
.btn, .nav-link, .agent-card, .form-input, .form-textarea, .form-select {
  transition: all 0.15s ease-out;
}

/* Add stagger animation for agent grid */
.agents-grid .agent-card:nth-child(1) { animation: fadeInUp 0.6s ease-out 0.1s both; }
.agents-grid .agent-card:nth-child(2) { animation: fadeInUp 0.6s ease-out 0.2s both; }
.agents-grid .agent-card:nth-child(3) { animation: fadeInUp 0.6s ease-out 0.3s both; }
.agents-grid .agent-card:nth-child(4) { animation: fadeInUp 0.6s ease-out 0.4s both; }
.agents-grid .agent-card:nth-child(5) { animation: fadeInUp 0.6s ease-out 0.5s both; }
.agents-grid .agent-card:nth-child(n+6) { animation: fadeInUp 0.6s ease-out 0.6s both; }

/* Loading state improvements */
.loading-spinner {
  animation: spin 1s linear infinite;
}

/* Toast */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  padding: 1rem 1.5rem;
  background-color: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--elevation-1);
  animation: slideInRight 0.15s ease-out;
  max-width: 350px;
}

.toast.success {
  border-left: 4px solid hsl(142 76% 36%);
}

.toast.error {
  border-left: 4px solid hsl(var(--destructive));
}

/* Duplicate animations removed - using consolidated set above */

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .view-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .agents-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  .chat-container {
    height: 500px;
  }

  .chat-header {
    flex-direction: column;
    text-align: center;
  }

  .form-actions {
    flex-direction: column;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Professional agent card styling - no glow */
.agent-card-glow {
  position: relative;
  transition: all 0.2s ease-out;
}

/* ==============================================
   TASK-BASED INTERFACE - NEW DESIGN
   ============================================== */

/* Task View Layout */
.task-view {
  background: hsl(var(--background));
}

.task-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-8);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.task-title-section {
  text-align: center;
  flex: 1;
}

.task-title {
  font-size: 2.25rem;
  font-weight: 600;
  color: hsl(var(--primary));
  margin-bottom: var(--space-2);
  letter-spacing: -0.025em;
}

.task-subtitle {
  color: hsl(var(--muted-foreground));
  font-size: 1.0625rem;
  font-weight: 400;
}

.task-workspace {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-8);
  min-height: 600px;
}

/* Agent Profile Card */
.agent-profile-card {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-1);
  padding: var(--space-6);
  height: fit-content;
  position: sticky;
  top: calc(4.5rem + var(--space-4));
}

.agent-profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  position: relative;
}

.agent-profile-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  background: hsl(var(--surface));
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid hsl(var(--border) / 0.3);
  box-shadow: var(--elevation-0);
}

.agent-profile-info {
  flex: 1;
}

.agent-profile-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: hsl(var(--foreground));
}

.agent-profile-personality {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--muted) / 0.5);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-transform: capitalize;
}

.agent-status-indicator {
  position: absolute;
  top: -8px;
  right: -8px;
}

.agent-status-badge {
  background: hsl(var(--success));
  color: hsl(var(--success-foreground));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  box-shadow: var(--elevation-0);
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: var(--elevation-0), 0 0 0 0 hsl(var(--success) / 0.4);
  }
  50% {
    box-shadow: var(--elevation-0), 0 0 0 4px hsl(var(--success) / 0.1);
  }
}

.agent-profile-description {
  margin-bottom: var(--space-4);
  padding: var(--space-3);
  background: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  border-left: 3px solid hsl(var(--primary) / 0.5);
}

.agent-profile-description p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: hsl(var(--foreground));
  margin: 0;
}

.capabilities-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.capabilities-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}

.capability-tag {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid hsl(var(--border) / 0.3);
}

/* Task Interface */
.task-interface {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

/* Task Input Section */
.task-input-section {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-0);
  padding: var(--space-6);
}

.task-input-header {
  margin-bottom: var(--space-4);
}

.task-input-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: hsl(var(--primary));
}

.task-input-header p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}

.task-input-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.task-input {
  width: 100%;
  min-height: 120px;
  padding: var(--space-4);
  background: hsl(var(--background));
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-family: inherit;
  resize: vertical;
  transition: all 0.15s ease-out;
}

.task-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1), var(--glow-subtle);
}

.task-input-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

/* Plan Visualization */
.plan-section {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-0);
  padding: var(--space-6);
  animation: fadeInUp 0.5s ease-out;
}

.plan-header {
  margin-bottom: var(--space-4);
}

.plan-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: hsl(var(--primary));
}

.plan-header p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}

.plan-visualization {
  margin-bottom: var(--space-6);
  padding: var(--space-8);
  background: hsl(220 15% 7%);
  border-radius: var(--radius);
  min-height: 400px;
  position: relative;
  overflow: visible;
}

.plan-graph {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 400px;
}

.plan-node {
  position: absolute;
  width: 200px;
  min-height: 80px;
  padding: var(--space-4);
  background: hsl(var(--background));
  border-radius: var(--radius-lg);
  border: 2px solid;
  transition: all 0.15s ease-out;
  animation: fadeInScale 0.5s ease-out;
}

.plan-node:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-1);
}

/* Node type colors */
.plan-node.input {
  border-color: hsl(160 100% 50%);
  box-shadow: 0 0 20px hsl(160 100% 50% / 0.3);
}

.plan-node.processing {
  border-color: hsl(200 95% 60%);
  box-shadow: 0 0 20px hsl(200 95% 60% / 0.3);
}

.plan-node.output {
  border-color: hsl(280 100% 70%);
  box-shadow: 0 0 20px hsl(280 100% 70% / 0.3);
}

.plan-node-content {
  text-align: center;
}

.plan-node-title {
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: hsl(var(--foreground));
  font-size: 0.9375rem;
}

.plan-node-subtitle {
  font-size: 0.75rem;
  color: hsl(var(--primary));
  margin-bottom: var(--space-1);
  font-weight: 500;
}

.plan-node-description {
  font-size: 0.8125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.3;
}

/* Interactive Node States */
.plan-node.pending {
  opacity: 0.7;
  border-style: dashed;
}

.plan-node.executing {
  border-color: hsl(45 100% 60%);
  box-shadow: 0 0 30px hsl(45 100% 60% / 0.6);
  background: hsl(45 100% 95%);
  animation: pulse 1.5s infinite;
}

.plan-node.completed {
  border-color: hsl(120 100% 40%);
  box-shadow: 0 0 20px hsl(120 100% 40% / 0.4);
  background: hsl(120 100% 95%);
  opacity: 1;
}

.plan-node.completed::after {
  content: '✓';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: hsl(120 100% 40%);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.75rem;
}

/* Pulse animation for executing nodes */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 30px hsl(45 100% 60% / 0.6);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 40px hsl(45 100% 60% / 0.8);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 30px hsl(45 100% 60% / 0.6);
  }
}

/* Cytoscape Container */
#cytoscape-container {
  width: 100% !important;
  height: 500px !important;
  min-height: 500px;
  position: relative;
  border-radius: var(--radius-lg);
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  overflow: hidden;
}

#plan-visualization {
  width: 100%;
  min-height: 500px;
  position: relative;
}

/* Graph connections */
.plan-connection {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

.plan-connection-line {
  stroke: hsl(var(--primary));
  stroke-width: 2;
  fill: none;
  opacity: 0.6;
}

.plan-connection-arrow {
  fill: hsl(var(--primary));
  opacity: 0.6;
}

/* Active connection animations */
.plan-connection-line.active-connection {
  stroke: hsl(120 100% 50%);
  stroke-width: 3;
  opacity: 1;
  animation: flowPulse 1.5s ease-in-out infinite;
}

.plan-connection-arrow.active-connection {
  fill: hsl(120 100% 50%);
  opacity: 1;
}

@keyframes flowPulse {
  0%, 100% {
    stroke-dasharray: 0;
  }
  50% {
    stroke-dasharray: 10, 5;
  }
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.plan-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
}

/* Progress Section */
.progress-section {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-0);
  padding: var(--space-6);
  animation: fadeInUp 0.5s ease-out;
}

.progress-header {
  margin-bottom: var(--space-4);
}

.progress-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-1);
  color: hsl(var(--primary));
}

.progress-header p {
  color: hsl(var(--muted-foreground));
  font-size: 0.9375rem;
}

.progress-container {
  margin-bottom: var(--space-6);
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: hsl(var(--muted));
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: var(--space-2);
  border: 1px solid hsl(var(--border));
}

.progress-fill {
  height: 100%;
  background: hsl(var(--surface));
  border-radius: 6px;
  transition: width 0.15s ease-out;
  position: relative;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, hsl(var(--background) / 0.3) 50%, transparent 100%);
  animation: shimmer-progress 1.5s infinite;
}

@keyframes shimmer-progress {
  0% { opacity: 0.3; }
  50% { opacity: 0.8; }
  100% { opacity: 0.3; }
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-text {
  font-size: 0.9375rem;
  color: hsl(var(--foreground));
  font-weight: 500;
}

.progress-percent {
  font-size: 0.875rem;
  color: hsl(var(--primary));
  font-weight: 600;
}

.progress-steps {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.progress-step {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius);
  transition: all 0.15s ease-out;
}

.progress-step.active {
  background: hsl(var(--primary) / 0.15);
  border-left: 3px solid hsl(var(--primary));
}

.progress-step.completed {
  background: hsl(var(--success) / 0.1);
}

.progress-step-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.15s ease-out;
}

.progress-step-icon.pending {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
}

.progress-step-icon.active {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  animation: spin-pulse 1s ease-in-out infinite;
}

.progress-step-icon.completed {
  background: hsl(var(--success));
  color: hsl(var(--success-foreground));
}

@keyframes spin-pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

.progress-step-text {
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

/* Results Section */
.results-section {
  background: hsl(var(--card));
  border-radius: var(--radius-lg);
  border: 1px solid hsl(var(--border) / 0.5);
  box-shadow: var(--elevation-1);
  padding: var(--space-6);
  animation: fadeInUp 0.5s ease-out;
}

.results-header {
  margin-bottom: var(--space-6);
  text-align: center;
}

.results-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: hsl(var(--primary));
}

.results-header p {
  color: hsl(var(--muted-foreground));
  font-size: 1.0625rem;
}

.results-content {
  background: hsl(var(--muted) / 0.2);
  border-radius: var(--radius);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border: 2px dashed hsl(var(--border));
  min-height: 200px;
}

.result-item {
  padding: var(--space-4);
  background: hsl(var(--background));
  border-radius: var(--radius);
  border: 1px solid hsl(var(--border) / 0.5);
  margin-bottom: var(--space-3);
  box-shadow: var(--elevation-0);
}

.result-item:last-child {
  margin-bottom: 0;
}

.result-item h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-2);
  color: hsl(var(--primary));
}

.result-item p {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: hsl(var(--foreground));
}

.results-actions {
  display: flex;
  justify-content: center;
  gap: var(--space-4);
}

/* Fun Loading States */
.bouncing-dots {
  display: inline-flex;
  gap: 2px;
}

.bouncing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: hsl(var(--primary));
  animation: bouncing 1.4s ease-in-out infinite both;
}

.bouncing-dot:nth-child(1) { animation-delay: -0.32s; }
.bouncing-dot:nth-child(2) { animation-delay: -0.16s; }
.bouncing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes bouncing {
  0%, 80%, 100% {
    opacity: 0.5;
  }
  40% {
    opacity: 1;
  }
}

/* Hide old chat elements */
.chat-container,
.chat-messages,
.chat-input-form {
  display: none;
}

/* Responsive Design for Task Interface */
@media (max-width: 768px) {
  .task-workspace {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .agent-profile-card {
    position: static;
  }

  .task-input-actions {
    flex-direction: column;
  }

  .plan-actions,
  .results-actions {
    flex-direction: column;
  }

  /* Remove hero responsive styles */
}
/* Dark mode theme toggle visibility fix */
.dark .theme-toggle {
  border-color: hsl(var(--border));
  background-color: hsl(var(--surface));
}

.dark .theme-toggle:hover {
  background-color: hsl(var(--surface-2));
  border-color: hsl(var(--primary) / 0.5);
}

.dark .theme-icon {
  color: hsl(var(--foreground));
}

/* Pulse animation for executing nodes */
@keyframes pulse {
    0% { 
        transform: scale(1); 
        opacity: 1; 
    }
    50% { 
        transform: scale(1.05); 
        opacity: 0.8; 
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

/* Results styling */
.results-container {
    padding: 20px;
    background: hsl(var(--surface));
    border-radius: 12px;
    border: 1px solid hsl(var(--border));
}

.results-header-info {
    margin-bottom: 24px;
    text-align: center;
}

.results-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 8px;
}

.results-subtitle {
    color: hsl(var(--muted-foreground));
    font-size: 0.875rem;
}

.results-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.result-section {
    padding: 16px;
    background: hsl(var(--muted));
    border-radius: 8px;
    border: 1px solid hsl(var(--border));
}

.result-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.result-section-icon {
    width: 20px;
    height: 20px;
    color: hsl(var(--primary));
}

.result-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin: 0;
}

.result-section-content {
    color: hsl(var(--muted-foreground));
    line-height: 1.6;
}

.results-metadata {
    display: flex;
    justify-content: space-around;
    padding: 16px;
    background: hsl(var(--accent));
    border-radius: 8px;
    border: 1px solid hsl(var(--border));
}

.result-stat {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
}

/* Plan collapsed indicator */
.plan-collapsed-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.plan-collapsed-indicator:hover {
    background: rgba(56, 189, 248, 0.1);
}

/* Real result content styling */
.real-result-content {
    background: hsl(var(--muted));
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
    border: 1px solid hsl(var(--border));
}

.real-result-text {
    color: hsl(var(--foreground));
    line-height: 1.6;
    font-size: 0.9rem;
}

.real-result-text p {
    margin-bottom: 12px;
}

.real-result-text p:last-child {
    margin-bottom: 0;
}

.real-result-text strong {
    color: hsl(var(--foreground));
    font-weight: 600;
}

.real-result-text em {
    font-style: italic;
    color: hsl(var(--muted-foreground));
}

/* Sidebar Toggle Functionality */
.sidebar-toggle-btn {
    position: fixed;
    top: 50%;
    left: 300px;
    transform: translateY(-50%);
    z-index: 1000;
    background: hsl(var(--background));
    color: hsl(var(--foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 0 var(--radius) var(--radius) 0;
    width: 24px;
    height: 48px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--elevation-2);
    transition: all 0.3s ease;
}

.sidebar-collapsed .sidebar-toggle-btn {
    left: 0;
    transform: translateY(-50%);
}

.sidebar-toggle-btn:hover {
    background: hsl(var(--primary));
    color: white;
    transform: translateY(-50%) translateX(2px);
}

.sidebar-toggle-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.sidebar-collapsed .sidebar-toggle-btn svg {
    transform: rotate(180deg);
}

.task-workspace {
    position: relative;
    transition: all 0.3s ease;
}

.task-workspace.sidebar-collapsed {
    grid-template-columns: 0 1fr !important;
}

.sidebar-collapsed .agent-profile-card {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.sidebar-collapsed .task-interface {
    margin-left: 0;
    width: 100%;
}

/* Show button only in task view */
.sidebar-toggle-btn {
    display: none;
}

.task-view .sidebar-toggle-btn {
    display: flex !important;
}

/* Responsive adjustments for sidebar toggle */
@media (max-width: 768px) {
    .sidebar-toggle-btn {
        display: none !important;
    }
}


/* Task View Full Width Fix */
.task-view .container {
  max-width: 100%;
  padding: 0;
}

/* Improved Task Interface */
.task-interface {
  padding: var(--space-2) var(--space-6);
}

/* Reduce task header space */
.task-header {
  padding: var(--space-3) var(--space-6) !important;
}

.task-title-section {
  margin: 0 !important;
}

.task-title {
  font-size: 1.5rem !important;
  margin-bottom: var(--space-1) !important;
  line-height: 1.2 !important;
}

.task-subtitle {
  font-size: 0.875rem !important;
  margin: 0 !important;
}

.task-input-section {
  margin-bottom: var(--space-6);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--elevation-1);
}

.task-input {
  width: 100%;
  min-height: 120px;
  padding: var(--space-4);
  background: hsl(var(--background));
  border: 2px solid hsl(var(--border));
  border-radius: var(--radius);
  font-size: 1rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s;
}

.task-input:focus {
  outline: none;
  border-color: hsl(var(--primary));
  box-shadow: 0 0 0 3px hsl(var(--primary) / 0.1);
}

/* Make plan visualization fixed size with SVG interaction */
.plan-visualization {
  height: 400px;
  overflow: hidden;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-4);
  background: hsl(var(--background));
  position: relative;
  cursor: grab;
}

.plan-visualization:active {
  cursor: grabbing;
}

/* SVG should fill container and be interactive */
.plan-visualization svg {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
}

/* Enable SVG panning and zooming */
.plan-visualization svg {
  overflow: visible;
  cursor: inherit;
}

/* If using D3 or other dynamic content */
.plan-visualization .plan-node,
.plan-visualization .plan-step {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Handle wide content inside */
.plan-visualization * {
  max-width: 100%;
  box-sizing: border-box;
}

/* Add zoom controls styling */
.plan-visualization::before {
  content: "🔍 Click and drag to pan • Mouse wheel to zoom";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  background: hsl(var(--background) / 0.9);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  z-index: 10;
  pointer-events: none;
}


/* Also make results section scrollable */
.results-content {
  max-height: 500px;
  overflow-y: auto;
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-4);
  background: hsl(var(--background));
}

.results-content::-webkit-scrollbar {
  width: 6px;
}

.results-content::-webkit-scrollbar-track {
  background: hsl(var(--muted));
  border-radius: 3px;
}

.results-content::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 3px;
}

.results-content::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground) / 0.4);
}


/* Fix collapsed state width expansion */
.sidebar-collapsed .task-interface {
  padding-left: var(--space-8);
  width: 100vw;
  max-width: 100%;
}

.sidebar-collapsed .task-input-section {
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: none;
}

/* Saved tasks section styling */
.agent-saved-tasks {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid hsl(var(--border));
}

.saved-tasks-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--space-3);
}

.saved-tasks-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-height: 300px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: hsl(var(--border)) hsl(var(--muted));
}

.saved-task-item {
  padding: var(--space-3);
  background: hsl(var(--muted) / 0.3);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.saved-task-item:hover {
  background: hsl(var(--muted) / 0.5);
  border-color: hsl(var(--primary) / 0.5);
  transform: translateX(2px);
}

.saved-task-preview {
  font-size: 0.875rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.saved-task-time {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  opacity: 0.8;
}

.saved-tasks-empty {
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
  text-align: center;
  padding: var(--space-6) var(--space-3);
  font-style: italic;
}

/* Custom scrollbar for saved tasks */
.saved-tasks-list::-webkit-scrollbar {
  width: 6px;
}

.saved-tasks-list::-webkit-scrollbar-track {
  background: hsl(var(--muted));
  border-radius: 3px;
}

.saved-tasks-list::-webkit-scrollbar-thumb {
  background: hsl(var(--border));
  border-radius: 3px;
}

.saved-tasks-list::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--muted-foreground));
}

/* Saved task header when viewing a saved result */
.saved-task-header {
  background: hsl(var(--muted) / 0.3);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.saved-task-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.saved-task-description {
  margin-bottom: var(--space-3);
}

.saved-task-description p {
  font-size: 1rem;
  color: hsl(var(--foreground));
  line-height: 1.5;
  font-weight: 500;
}

.saved-task-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}

.saved-task-meta span:not(:nth-child(2)) {
  opacity: 0.8;
}

/* Back to new task button styling */
#back-to-new-task {
  margin-right: var(--space-2);
}

/* Task description display in plan section */
.task-description {
  padding: var(--space-3);
  background: hsl(var(--muted) / 0.3);
  border-radius: var(--radius);
  margin: var(--space-3) 0;
  border-left: 3px solid hsl(var(--primary));
}

.task-description strong {
  color: hsl(var(--primary));
  font-weight: 600;
}

/* User Dropdown Improvements */
.user-info {
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  transition: all 0.15s ease-out;
  position: relative;
}

.user-info:hover {
  background-color: hsl(var(--surface));
}

.user-menu-arrow {
  transition: transform 0.15s ease-out;
  color: hsl(var(--muted-foreground));
}

.user-info[aria-expanded="true"] .user-menu-arrow {
  transform: rotate(180deg);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  min-width: 280px;
  background: hsl(var(--popover));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  box-shadow: var(--elevation-2);
  z-index: 1000;
  padding: 0;
  overflow: hidden;
  backdrop-filter: blur(20px) saturate(180%);
}

/* Subscription Status Item */
.subscription-status-item {
  padding: var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.1);
}

.subscription-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.subscription-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(var(--muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.subscription-status-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  font-weight: 500;
}

.subscription-status-badge.active {
  background: hsl(var(--success) / 0.1);
  color: hsl(var(--success));
  border: 1px solid hsl(var(--success) / 0.2);
}

.subscription-status-badge.inactive {
  background: hsl(var(--destructive) / 0.1);
  color: hsl(var(--destructive));
  border: 1px solid hsl(var(--destructive) / 0.2);
}

.subscription-status-badge.loading {
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

/* Status indicators */
.subscription-status-badge.active::before {
  content: '●';
  color: hsl(var(--success));
  margin-right: var(--space-1);
}

.subscription-status-badge.inactive::before {
  content: '●';
  color: hsl(var(--destructive));
  margin-right: var(--space-1);
}

/* Dropdown Divider */
.dropdown-divider {
  height: 1px;
  background: hsl(var(--border));
  margin: 0;
}

/* Dropdown Items */
.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: transparent;
  border: none;
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease-out;
  text-align: left;
}

.dropdown-item:hover {
  background: hsl(var(--surface));
  color: hsl(var(--foreground));
}

.dropdown-item:focus {
  outline: none;
  background: hsl(var(--surface));
}

.dropdown-icon {
  color: hsl(var(--muted-foreground));
  transition: color 0.15s ease-out;
}

.dropdown-item:hover .dropdown-icon {
  color: hsl(var(--foreground));
}

/* Manage Button Styling */
#manage-subscription-btn {
  align-self: flex-start;
  font-size: 0.75rem;
  padding: var(--space-1) var(--space-3);
  min-height: auto;
}

/* User Avatar Styling */
.user-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-weight: 600;
  font-size: 0.875rem;
  border: 2px solid hsl(var(--border));
  transition: all 0.15s ease-out;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  display: block;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-email {
  display: block;
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Animation for dropdown */
.user-dropdown {
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.user-dropdown:not([style*="display: none"]) {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Subscription Modal Styles */
.subscription-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.subscription-modal {
  background: hsl(var(--popover));
  border-radius: var(--radius-lg);
  box-shadow: var(--elevation-2);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid hsl(var(--border));
}

.subscription-modal .modal-header {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid hsl(var(--border));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subscription-modal .modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: 0;
}

.subscription-modal .modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius);
  transition: all 0.15s ease-out;
}

.subscription-modal .modal-close:hover {
  background: hsl(var(--surface));
  color: hsl(var(--foreground));
}

.subscription-modal .modal-body {
  padding: var(--space-6);
}

.subscription-modal .modal-body p {
  color: hsl(var(--foreground));
  line-height: 1.6;
  margin-bottom: var(--space-4);
}

.subscription-modal .modal-body ul {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0;
}

.subscription-modal .modal-body li {
  padding: var(--space-1) 0;
  color: hsl(var(--foreground));
}

.subscription-modal .modal-body h4 {
  font-weight: 600;
  color: hsl(var(--foreground));
  margin: var(--space-4) 0 var(--space-2);
}

.trial-benefits, .subscription-benefits, .subscription-features {
  background: hsl(var(--muted) / 0.1);
  padding: var(--space-4);
  border-radius: var(--radius);
  margin: var(--space-4) 0;
}

.trial-terms {
  padding: var(--space-4);
  background: hsl(var(--primary) / 0.05);
  border: 1px solid hsl(var(--primary) / 0.2);
  border-radius: var(--radius);
  margin-top: var(--space-4);
}

.trial-terms p {
  margin-bottom: var(--space-2);
  font-size: 0.875rem;
}

.trial-terms p:last-child {
  margin-bottom: 0;
}

.subscription-modal .modal-footer {
  padding: var(--space-4) var(--space-6) var(--space-6);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

.subscription-modal .modal-footer .btn {
  min-width: 120px;
}

/* Mobile responsive improvements for user dropdown */
@media (max-width: 768px) {
  .user-dropdown {
    min-width: 260px;
    right: -10px;
  }
  
  .subscription-status-item {
    padding: var(--space-3);
  }
  
  .subscription-info {
    gap: var(--space-1);
    margin-bottom: var(--space-2);
  }

  .subscription-modal {
    margin: var(--space-4);
    max-width: calc(100vw - 2 * var(--space-4));
  }

  .subscription-modal .modal-footer {
    flex-direction: column;
  }

  .subscription-modal .modal-footer .btn {
    width: 100%;
  }
}

/* Enhanced Loading Styles */
.loading-content {
  text-align: center;
  padding: 3rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  animation: loadingContentFloat 4s ease-in-out infinite;
}

.agent-thinking {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2rem;
  position: relative;
}

.agent-avatar {
  font-size: 3rem;
  animation: agentBounce 2s ease-in-out infinite;
  margin-right: 1rem;
}

.thinking-bubbles {
  display: flex;
  gap: 0.5rem;
}

.bubble {
  width: 12px;
  height: 12px;
  background: linear-gradient(45deg, #3b82f6, #8b5cf6);
  border-radius: 50%;
  animation: bubbleFloat 1.5s ease-in-out infinite;
}

.bubble:nth-child(1) {
  animation-delay: 0s;
}

.bubble:nth-child(2) {
  animation-delay: 0.3s;
}

.bubble:nth-child(3) {
  animation-delay: 0.6s;
}

.loading-message {
  font-size: 1.25rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899);
  background-size: 200% 200%;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientShift 3s ease infinite, messagePulse 2s ease-in-out infinite;
}

.loading-message i {
  color: #3b82f6;
  margin-right: 0.5rem;
  background: none;
  -webkit-text-fill-color: #3b82f6;
  animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
  0%, 100% { 
    color: #3b82f6;
    transform: scale(1);
  }
  50% { 
    color: #8b5cf6;
    transform: scale(1.1);
  }
}

@keyframes loadingContentFloat {
  0%, 100% { 
    transform: translateY(0px) scale(1);
  }
  50% { 
    transform: translateY(-10px) scale(1.02);
  }
}

@keyframes agentBounce {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg);
  }
  25% { 
    transform: translateY(-5px) rotate(-2deg);
  }
  75% { 
    transform: translateY(-3px) rotate(2deg);
  }
}

@keyframes bubbleFloat {
  0%, 100% { 
    transform: translateY(0px) scale(1);
    opacity: 0.7;
  }
  50% { 
    transform: translateY(-15px) scale(1.2);
    opacity: 1;
  }
}

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

@keyframes messagePulse {
  0%, 100% { 
    transform: scale(1);
  }
  50% { 
    transform: scale(1.05);
  }
}
