/* ========================================
   Tempo Designer - Custom CSS
   Additional utilities beyond Tailwind
======================================== */

/* ========================================
   BASE STYLES
======================================== */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  background-color: var(--surface);
  color: var(--on-surface);
  line-height: 1.5;
  min-height: 100vh;
  overflow: hidden;
}

/* ========================================
   LAYOUT UTILITIES
======================================== */

/* Layout modes */
[data-layout="compact"] {
  --space-unit: 4px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
}

[data-layout="comfortable"] {
  --space-unit: 8px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
}

/* Default to comfortable */
:root {
  --space-unit: 8px;
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
}

/* Main layout */
.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 56px;
  min-width: 56px;
  max-width: 56px;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: var(--space-2);
  padding-bottom: 0;
  border-right: 1px solid var(--outline-variant);
  background-color: var(--surface-dim);
  overflow: visible;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.header-bar {
  min-height: 40px;
  max-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 var(--space-3);
  border-bottom: 1px solid var(--outline-variant);
  background-color: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* ========================================
   APP SHELL (Apple Window Style)
======================================== */

.app-shell {
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  overflow: hidden;
}

.window-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.window-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
}

.window-btn-close { background-color: #FF5F57; }
.window-btn-minimize { background-color: #FEBC2E; }
.window-btn-maximize { background-color: #28C840; }

.window-btn:hover {
  filter: brightness(1.1);
  transform: scale(1.1);
}

/* ========================================
   NAVIGATION
======================================== */

#main-nav {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) 0;
}

.nav-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rounded-macos);
  color: var(--on-surface-var-1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item:hover {
  background-color: var(--surf-container-high);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--surf-container-high);
  color: var(--brand-primary);
  border-radius: var(--rounded-macos);
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
}

/* Focus visible styles for accessibility */
.nav-item:focus-visible,
.icon-btn:focus-visible,
.icon-btn-sm:focus-visible,
.window-btn:focus-visible,
.chat-input-send:focus-visible,
.chat-input-btn-icon:focus-visible,
.dropdown-item:focus-visible {
  outline: 2px solid var(--brand-purple);
  outline-offset: 2px;
}

/* Remove default button outline when focused with mouse */
:focus:not(:focus-visible) {
  outline: none;
}

/* ========================================
   AVATAR & DROPDOWNS
======================================== */

.avatar {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #A78BFA, #8B5CF6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 2px var(--outline);
}

/* Redesigned Gradient Avatar Section */
.avatar-section {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rounded-macos);
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-section:hover {
  background-color: var(--surf-container-high);
}

.avatar-gradient {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--avatar-gradient-start) 0%, var(--avatar-gradient-mid) 50%, var(--avatar-gradient-end) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px var(--avatar-shadow);
}

.avatar-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
  pointer-events: none;
}

.avatar-gradient:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px var(--avatar-shadow);
}

.avatar-letter {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.avatar-dropdown {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rounded-macos);
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-dropdown:hover {
  background-color: var(--surf-container-high);
}

.avatar-dropdown .avatar {
  margin: 0;
}

.dropdown-menu {
  position: fixed;
  min-width: 240px;
  max-width: 280px;
  background-color: var(--surf-container);
  border: 0.5px solid var(--outline-variant);
  border-radius: var(--rounded-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Avatar dropdown specific positioning */
#avatar-menu {
  transform: scale(0.95) translateY(-10px);
}

#avatar-menu.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.dropdown-header {
  padding: var(--space-3);
  border-bottom: 1px solid var(--outline-variant);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  color: var(--text-primary);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.dropdown-item:hover {
  background-color: var(--surf-container-high);
}

.dropdown-divider {
  height: 1px;
  background-color: var(--outline-variant);
  margin: var(--space-1) 0;
}

/* ========================================
   BUTTONS
======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--rounded-macos);
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn-primary {
  background-color: var(--brand-purple);
  color: white;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--surf-container-high);
  color: var(--text-primary);
  border: 0.5px solid var(--outline-variant);
}

.btn-secondary:hover {
  background-color: var(--surf-container-highest);
}

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

.btn-ghost:hover {
  background-color: var(--surf-container-high);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--rounded-macos);
}

/* ========================================
   CARDS
======================================== */

.card {
  background-color: var(--surf-container);
  border: 0.5px solid var(--outline-variant);
  border-radius: var(--rounded-lg);
  padding: var(--space-4);
  transition: all 0.2s ease;
}

.card-hover:hover {
  border-color: var(--outline);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ========================================
   HOME CONTENT
======================================== */

.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-4);
  background-color: var(--surface-dim);
  position: relative;
  /* Grid alignment variables */
  --card-width: 200px;
  --card-gap: 4px;
  --cards-total-width: calc(var(--card-width) * 3 + var(--card-gap) * 2);
  --first-card-offset: calc(var(--cards-total-width) / 2);
}

.home-content::before {
  content: '';
  position: absolute;
  inset: 0;
  background-color: var(--surface);
  /* Grid Pattern - Precisely aligned with centered cards */
  /* Grid pattern: 200px wide, repeats every 200px */
  /* SVG rect: x='2', so visual cell starts 2px into each 200px repeat */
  /* Cards are centered, so first card starts at: 50% - (cards-total-width / 2) */
  /* Grid pattern must start at: first-card-start - 2px (to account for SVG x='2') */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='240' viewBox='0 0 200 240'%3E%3Crect x='2' y='2' width='196' height='236' rx='24' fill='%23332F26' fill-opacity='0.4'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-position-x: calc(50% - var(--first-card-offset) - 2px);
  background-position-y: center;
  pointer-events: none;
  z-index: 0;
}

.home-hero {
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: relative;
  z-index: 2;
}

.home-subtitle {
  max-width: 400px;
}

.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 0.5px solid var(--glass-border);
}

/* ========================================
   HOME CARDS
======================================== */

.home-cards {
  display: flex;
  gap: var(--card-gap);
  position: relative;
  z-index: 2;
  flex-wrap: wrap;
  justify-content: center;
}

.home-card {
  width: var(--card-width);
  padding: var(--space-4);
  background-color: var(--surf-container);
  border: 0.5px solid var(--outline-variant);
  border-radius: var(--rounded-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  /* Pop-out effect - cards appear above the grid */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 2;
}

.home-card:hover {
  border-color: var(--outline);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: var(--surf-container-high);
  z-index: 3;
}

.home-card:active {
  transform: translateY(0);
}

.home-card:focus-visible {
  outline: 2px solid var(--brand-purple);
  outline-offset: 4px;
}

.home-card-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(205, 157, 250, 0.15);
  border-radius: var(--rounded-md);
  color: var(--brand-purple);
}

.home-card-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.home-card-title {
  font-size: var(--text-subhead);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
}

.home-card-desc {
  font-size: var(--text-caption-1);
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ========================================
   INPUTS
======================================== */

.input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background-color: var(--surf-container-low);
  border: 0.5px solid var(--outline-variant);
  border-radius: var(--rounded-macos);
  color: var(--text-primary);
  font-size: var(--text-body);
  outline: none;
  transition: all 0.2s ease;
}

.input:focus {
  border-color: var(--brand-purple);
  box-shadow: 0 0 0 3px rgba(205, 157, 250, 0.2);
}

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

/* ========================================
   TOGGLES
======================================== */

.toggle {
  width: 44px;
  height: 24px;
  background-color: var(--surf-container-high);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease;
  border: none;
}

.toggle.active {
  background-color: var(--brand-purple);
}

.toggle-knob {
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle.active .toggle-knob {
  transform: translateX(20px);
}

/* ========================================
   TABS
======================================== */

.tabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-1);
  background-color: var(--surf-container-low);
  border-radius: var(--rounded-macos);
}

.tab {
  padding: var(--space-2) var(--space-3);
  border-radius: 6px;
  font-size: var(--text-callout);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
}

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

.tab.active {
  background-color: var(--surf-container);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* ========================================
   BADGES
======================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: var(--font-weight-semibold);
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-primary {
  background-color: rgba(205, 157, 250, 0.2);
  color: var(--brand-purple);
}

.badge-success {
  background-color: rgba(31, 223, 102, 0.2);
  color: var(--success);
}

.badge-warning {
  background-color: rgba(248, 200, 6, 0.2);
  color: var(--warning);
}

.badge-error {
  background-color: rgba(229, 25, 25, 0.2);
  color: var(--error);
}

/* ========================================
   ICONS (Huge Icons style)
======================================== */

.icon {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  color: currentColor;
}

.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }
.icon-xl { width: 32px; height: 32px; }

/* ========================================
   SCROLLBARS (macOS style)
======================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--outline-variant);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--outline);
}

/* ========================================
   VIEW CONTAINERS
======================================== */

.view-container {
  display: none;
  width: 100%;
  height: 100%;
}

.view-container.active {
  display: flex;
  flex-direction: column;
}

/* Chat view specific - side by side layout */
#view-chat.view-container.active {
  display: flex;
  flex-direction: row;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }

/* ========================================
   CHAT INPUT (Concentric Design)
======================================== */

.chat-input-container {
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-3) 40px;
}

.chat-input-outer {
  background-color: var(--surf-container-low);
  border: 0.5px solid var(--outline-variant);
  border-radius: var(--rounded-lg);
  padding: 4px;
}

.chat-input-middle {
  background-color: var(--surf-container-highest);
  border: 0.5px solid transparent;
  border-radius: var(--rounded-md);
  padding: 0;
}

.chat-input-inner {
  background-color: var(--surf-container);
  border: 0.5px solid var(--outline-variant);
  border-radius: var(--rounded-md);
  min-height: 50px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-2);
}

.chat-input-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 14px;
  line-height: 1.4;
  resize: none;
  min-height: 28px;
}

.chat-input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: var(--space-1);
  margin-top: var(--space-1);
}

.chat-input-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.chat-input-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--rounded-macos);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  transition: background-color 0.15s ease;
}

.chat-input-btn:hover {
  background-color: var(--surf-container-high);
}

.chat-input-btn-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rounded-macos);
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: background-color 0.15s ease;
}

.chat-input-btn-icon:hover {
  background-color: var(--surf-container-high);
}

.chat-input-divider {
  width: 1px;
  height: 20px;
  background-color: var(--outline-variant);
  margin: 0 var(--space-2);
}

.chat-input-send {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background-color: var(--brand-purple);
  border: none;
  cursor: pointer;
  color: white;
  transition: all 0.15s ease;
}

.chat-input-send:hover {
  background-color: #b87ed9;
  transform: scale(1.05);
}

.chat-input-send:focus {
  outline: 2px solid var(--brand-purple);
  outline-offset: 2px;
}

.chat-input-send svg {
  width: 18px;
  height: 18px;
}

.chat-plan-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 8px;
  background-color: rgba(254, 254, 0, 0.08);
  color: #fefe00;
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.chat-plan-badge svg {
  width: 16px;
  height: 16px;
}

.chat-model-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.chat-model-badge svg {
  width: 12px;
  height: 12px;
}

/* ========================================
   WORKSPACES PANEL
======================================== */

.workspaces-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
}

.workspaces-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-1);
  min-height: 48px;
}

.workspaces-title {
  font-size: var(--text-callout);
  font-weight: 500;
  color: var(--text-primary);
}

.workspaces-actions {
  display: flex;
  gap: var(--space-2);
}

.workspaces-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 0 var(--space-1);
}

.workspace-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.workspaces-divider {
  height: 1px;
  background-color: var(--outline-variant);
  margin: var(--space-1) 0;
  opacity: 0.5;
}

/* Workspace Card (Header) */
.workspace-card {
  background-color: var(--surf-container-high);
  border-radius: var(--rounded-md);
  overflow: hidden;
}

.workspace-card-inner {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1);
}

.workspace-card-active {
  background-color: var(--surf-container-low);
}

.workspace-status {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
}

.status-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  background-color: var(--surf-container-high);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-primary);
  opacity: 0.5;
}

.workspace-name {
  flex: 1;
  font-size: 12px;
  font-weight: 500;
  color: var(--on-surface);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-card-actions {
  display: flex;
  gap: var(--space-1);
  align-items: center;
}

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  min-width: 20px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

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

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn-sm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  min-width: 16px;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.15s ease;
}

.icon-btn-sm:hover {
  color: var(--text-primary);
}

.icon-btn-sm svg {
  width: 14px;
  height: 14px;
}

.add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  min-width: 18px;
  background-color: var(--surface);
  border: 0.5px dashed var(--outline);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.add-btn:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.add-btn svg {
  width: 12px;
  height: 12px;
}

/* Workspace Item */
.workspace-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-1);
  padding: var(--space-1);
  padding-right: var(--space-2);
  border-radius: var(--rounded-md);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.workspace-item:hover {
  background-color: var(--surf-container-high);
}

.workspace-item-active {
  background-color: var(--surf-container);
}

.workspace-item-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  color: var(--text-secondary);
}

.workspace-item-avatar svg {
  width: 20px;
  height: 20px;
}

.workspace-item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.workspace-item-row {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.workspace-item-row .workspace-status {
  width: 16px;
  height: 16px;
  min-width: 16px;
}

.workspace-item-row .status-pill {
  width: 14px;
  height: 14px;
  min-width: 14px;
  font-size: 9px;
}

.workspace-item-row .workspace-name {
  font-size: 12px;
}

.badge-success {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 4px;
  font-size: 10px;
  font-weight: 400;
  color: var(--success);
  border: 0.5px solid var(--surf-container-high);
  border-radius: 4px;
  white-space: nowrap;
}

.workspace-item-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 18px;
}

.pin-icon {
  width: 12px;
  height: 12px;
  min-width: 12px;
  color: var(--text-tertiary);
}

.meta-text {
  font-size: 10px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.meta-dot {
  width: 2px;
  height: 2px;
  min-width: 2px;
  background-color: var(--text-tertiary);
  border-radius: 50%;
}

/* ========================================
   CHAT UI CONTAINER (3 Columns: Workspaces | Chat | Files)
======================================== */

.chat-ui-container {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: relative;
}

.workspaces-sidebar {
  width: 280px;
  min-width: 200px;
  max-width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border-right: 0.5px solid var(--outline-variant);
  overflow: hidden;
  flex-shrink: 0;
}

.chat-content-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--surface-dim);
  min-width: 400px;
}

.files-sidebar {
  width: 280px;
  min-width: 200px;
  max-width: 400px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border-left: 0.5px solid var(--outline-variant);
  overflow: hidden;
  flex-shrink: 0;
}

/* Resize Handles - positioned in chat-ui-container */
#resize-handle-left {
  position: absolute;
  left: 280px;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 20;
  background: transparent;
  transition: background-color 0.15s ease;
  transform: translateX(-50%);
}

#resize-handle-left:hover,
#resize-handle-left:active {
  background-color: var(--outline-variant);
}

#resize-handle-right {
  position: absolute;
  right: 280px;
  top: 0;
  bottom: 0;
  width: 8px;
  cursor: col-resize;
  z-index: 20;
  background: transparent;
  transition: background-color 0.15s ease;
  transform: translateX(50%);
}

#resize-handle-right:hover,
#resize-handle-right:active {
  background-color: var(--outline-variant);
}


.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

/* ========================================
   FILES SIDEBAR (Right Panel)
======================================== */

.files-sidebar {
  width: 280px;
  min-width: 280px;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--surface);
  border-left: 0.5px solid var(--outline-variant);
  overflow: hidden;
}

.files-tabs {
  display: flex;
  gap: 4px;
  padding: 0 8px;
  background-color: var(--surf-container-low);
  border-bottom: 0.5px solid var(--outline-variant);
}

.files-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

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

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

.files-tab-active::after {
  content: '';
  position: absolute;
  bottom: -0.5px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--text-tertiary);
}

.files-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.file-item:hover {
  background-color: var(--surf-container-high);
}

.file-name {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 12px;
  color: var(--text-primary);
}

/* Terminal Section */
.terminal-section {
  border-top: 0.5px solid var(--outline-variant);
}

.terminal-tabs {
  display: flex;
  gap: 4px;
  padding: 0 8px;
  background-color: var(--surf-container-low);
}

.terminal-tab {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 8px;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease;
}

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

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

.terminal-tab-active::after {
  content: '';
  position: absolute;
  bottom: -0.5px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--text-tertiary);
}

.terminal-content {
  padding: 10px;
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 12px;
}

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