/* CoandaView Main Styles - Matching CoandaCloud Apple Design */

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

:root {
  /* Tell browsers this is a dark theme - helps with native form controls */
  color-scheme: dark;

  /* Apple-style colors matching CoandaCloud */
  --apple-blue: #007AFF;
  --apple-gray: #8E8E93;
  --apple-light-gray: #F2F2F7;
  --apple-dark-gray: #1C1C1E;
  --apple-background: #000000;
  --apple-surface: rgba(255, 255, 255, 0.05);
  --apple-border: rgba(255, 255, 255, 0.1);
  --apple-text: #FFFFFF;
  --apple-secondary: rgba(255, 255, 255, 0.6);
  --apple-accent: #30D158;
  --apple-warning: #FF9F0A;
  --apple-critical: #FF453A;
  --blur-amount: 20px;
  --apple-gold: #FFD60A;
  --apple-yellow: #FFD60A;
  --apple-purple: #BF5AF2;

  /* Map to common variable names for compatibility */
  --primary-color: var(--apple-blue);
  --primary-dark: #0055CC;
  --secondary-color: var(--apple-accent);
  --accent-color: var(--apple-warning);
  --danger-color: var(--apple-critical);

  --bg-dark: var(--apple-background);
  --bg-darker: var(--apple-dark-gray);
  --bg-panel: var(--apple-surface);
  --bg-panel-hover: rgba(255, 255, 255, 0.08);

  --text-primary: var(--apple-text);
  --text-secondary: var(--apple-secondary);
  --text-muted: var(--apple-gray);

  --border-color: var(--apple-border);
  --border-light: rgba(255, 255, 255, 0.15);

  --success-color: var(--apple-accent);
  --warning-color: var(--apple-warning);
  --error-color: var(--apple-critical);
  --info-color: var(--apple-blue);

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;

  /* Borders */
  --border-radius: 8px;
  --border-radius-lg: 12px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
}

/* ===== Coanda Slider - Unified Slider Style ===== */
.coanda-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  outline: none;
  margin: 8px 0;
  cursor: pointer;
}

.coanda-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease;
}

.coanda-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

.coanda-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.coanda-slider:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.coanda-slider:disabled::-webkit-slider-thumb {
  cursor: not-allowed;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  line-height: 1.5;
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
}

/* Header - CoandaCloud Tech Style */
.header {
  background: linear-gradient(180deg, rgba(18, 18, 20, 0.95) 0%, rgba(12, 12, 14, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1000;
  height: 60px;
}

.logo {
  font-size: 22px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--apple-blue), var(--apple-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.2s ease;
  user-select: none;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  flex-shrink: 0;
}

.logo:hover {
  transform: translateY(-1px);
  opacity: 0.8;
}

.logo img {
  height: 28px;
  width: auto;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  font-size: 12px;
}

.status-indicator {
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.status-indicator.connected {
  color: var(--apple-accent);
  border-color: rgba(48, 209, 88, 0.3);
  background: rgba(48, 209, 88, 0.1);
}

.status-indicator.connecting {
  color: var(--apple-warning);
  border-color: rgba(255, 159, 10, 0.3);
  background: rgba(255, 159, 10, 0.1);
}

.status-indicator.disconnected {
  color: var(--apple-critical);
  border-color: rgba(255, 69, 58, 0.3);
  background: rgba(255, 69, 58, 0.1);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  font-size: 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.user-name {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  align-items: center;
}

/* Rendering Mode Toggle - CoandaCloud Tech Style */
.rendering-mode-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.rendering-mode-toggle .toggle-label {
  user-select: none;
  transition: color 0.3s;
}

/* Toggle switch container */
.rendering-mode-toggle .switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.rendering-mode-toggle .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.rendering-mode-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: 0.3s;
  border-radius: 24px;
}

.rendering-mode-toggle .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.rendering-mode-toggle input:checked + .slider {
  background-color: var(--apple-blue);
}

.rendering-mode-toggle input:focus + .slider {
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
}

.rendering-mode-toggle input:checked + .slider:before {
  transform: translateX(20px);
}

/* Highlight active label */
.rendering-mode-toggle .toggle-label:first-of-type {
  color: rgba(255, 255, 255, 0.9);
}

.rendering-mode-toggle input:checked ~ .toggle-label:first-of-type {
  color: rgba(255, 255, 255, 0.5);
}

.rendering-mode-toggle input:checked ~ .toggle-label:last-of-type {
  color: rgba(255, 255, 255, 0.9);
}

.rendering-mode-toggle .toggle-label:last-of-type {
  color: rgba(255, 255, 255, 0.5);
}

/* Buttons - Apple Style */
button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-connect {
  background: var(--apple-blue);
  border: 1px solid var(--apple-blue);
  border-radius: 20px;
  padding: 8px 16px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(var(--blur-amount));
  -webkit-backdrop-filter: blur(var(--blur-amount));
}

.btn-connect:hover {
  background: #0055CC;
  transform: translateY(-1px);
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.15s ease;
}

.btn-icon.recording {
  background: rgba(255, 69, 58, 0.9);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(255, 69, 58, 0.3);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.btn-icon.active {
  background: rgba(0, 122, 255, 0.2);
  border-color: rgba(0, 122, 255, 0.4);
  color: #007AFF;
}

.btn-icon.active:hover {
  background: rgba(0, 122, 255, 0.25);
  border-color: rgba(0, 122, 255, 0.5);
}

.header-icon {
  filter: invert(1);
  opacity: 0.9;
}

.btn-icon:hover .header-icon {
  opacity: 1;
}

/* Download button with progress animation */
.btn-icon.btn-download {
  position: relative;
}

.btn-icon.btn-download.downloading {
  pointer-events: none;
}

.btn-icon.btn-download.downloading .header-icon {
  opacity: 0.3;
}

.btn-icon.btn-download .download-progress {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.btn-icon.btn-download.downloading .download-progress {
  display: block;
}

.btn-icon.btn-download .download-progress svg {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.btn-icon.btn-download .download-progress .progress-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 2;
}

.btn-icon.btn-download .download-progress .progress-ring {
  fill: none;
  stroke: #4CAF50;
  stroke-width: 2;
  stroke-linecap: round;
  /* Perimeter of rounded rect 34x34 with rx=7: 4*(34-2*7) + 2*PI*7 ≈ 123.96 */
  stroke-dasharray: 124;
  stroke-dashoffset: 124;
  transition: stroke-dashoffset 0.15s ease;
}

.btn-icon.btn-download .download-progress .progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 9px;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 2px rgba(0,0,0,0.5);
  z-index: 1;
}

.btn-icon-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 16px;
}

.btn-icon-small:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

/* Main Content */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Sidebar Toggle Button - CoandaCloud Tech Style */
.sidebar-toggle {
  position: absolute;
  left: 320px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  width: 20px;
  height: 44px;
  background: rgba(28, 28, 30, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: none;
  border-radius: 0 8px 8px 0;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  width: 24px;
  border-color: rgba(255, 255, 255, 0.15);
}

.sidebar-toggle svg {
  transition: transform 0.3s ease;
}

/* When sidebar is hidden, move toggle and rotate arrow */
.main-content.sidebar-hidden .sidebar-toggle {
  left: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 8px 8px 0;
}

.main-content.sidebar-hidden .sidebar-toggle svg {
  transform: rotate(180deg);
}

/* Left Sidebar (single sidebar layout) - CoandaCloud Tech Style */
.sidebar-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 320px;
  height: 100%;
  background: linear-gradient(180deg, rgba(18, 18, 20, 0.95) 0%, rgba(12, 12, 14, 0.98) 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px;
  flex-shrink: 0;
  transition: margin-left 0.3s ease, opacity 0.2s ease;
}

/* Hidden sidebar state */
.main-content.sidebar-hidden .sidebar-left {
  margin-left: -320px;
  opacity: 0;
  pointer-events: none;
}

/* Custom scrollbar for sidebar */
.sidebar-left::-webkit-scrollbar {
  width: 6px;
}

.sidebar-left::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-left::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.sidebar-left::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Panel - CoandaCloud Tech Style */
.panel {
  background: rgba(28, 28, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(28, 28, 30, 0.75);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.panel-header h3 {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.panel-content {
  padding: 14px;
  font-size: 13px;
  overflow-x: hidden;
  background: transparent;
}

/* Custom scrollbar for panels */
.panel-content::-webkit-scrollbar {
  width: 8px;
}

.panel-content::-webkit-scrollbar-track {
  background: var(--bg-darker);
  border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* Pipeline Tree - CoandaCloud Tech Style */
.pipeline-tree {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pipeline-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: 100%;
}

.pipeline-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.pipeline-item.active {
  background: rgba(0, 122, 255, 0.12);
  border-color: rgba(0, 122, 255, 0.4);
}

.pipeline-item .icon {
  font-size: 16px;
  opacity: 0.8;
}

.pipeline-item .label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-item .pipeline-remove {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  font-size: 16px;
  line-height: 1;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  width: 24px;
}

.pipeline-item .pipeline-remove:hover {
  color: var(--danger-color);
  background: rgba(255, 69, 58, 0.15);
}

.pipeline-item .pipeline-remove:focus {
  outline: none;
}

.property-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.property-title {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 4px;
}

.property-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.property-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}

.property-control.hidden {
  display: none !important;
}

.property-control label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  text-transform: none;
  letter-spacing: 0;
}

.property-control input,
.property-control select {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  outline: none;
  transition: all 0.15s ease;
}

.property-control input:hover,
.property-control select:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

.property-control input:focus,
.property-control select:focus {
  border-color: rgba(0, 122, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
}

.property-pick {
  margin-top: 4px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 122, 255, 0.4);
  background: rgba(0, 122, 255, 0.1);
  color: var(--primary-color);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.property-pick:hover {
  background: rgba(0, 122, 255, 0.2);
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.property-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.property-actions .btn-primary {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--primary-color), #0055CC);
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

.property-actions .btn-primary:hover {
  background: linear-gradient(135deg, #0088FF, var(--primary-color));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
}

/* Viewport */
.viewport-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg-dark);
}

/* Viewport Toolbar - CoandaCloud Tech Style */
.viewport-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, rgba(18, 18, 20, 0.95) 0%, rgba(12, 12, 14, 0.98) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-toolbar:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-toolbar.active {
  background: linear-gradient(135deg, var(--primary-color), #0055CC);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

.toolbar-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-right: 4px;
}

/* View Lock Button Styles */
.btn-view-lock {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  min-width: auto;
}

.btn-view-lock span {
  font-size: 11px;
  white-space: nowrap;
}

.btn-view-lock.controlling {
  background: #4CAF50;
  color: white;
  animation: pulse-glow 2s infinite;
}

.btn-view-lock.locked-by-other {
  background: var(--bg-panel);
  color: #ff9800;
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-view-lock.locked-by-other:hover {
  background: var(--bg-panel);
}

.view-lock-status {
  font-size: 11px;
  color: #ff9800;
  margin-left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.view-lock-status .view-lock-holder {
  font-weight: 600;
  color: #ffb74d;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.5);
  }
  50% {
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
  }
}

/* View Lock - Request Control state */
.btn-view-lock.locked-by-other {
  cursor: pointer;
  opacity: 1;
}

.btn-view-lock.locked-by-other:hover {
  background: rgba(255, 152, 0, 0.2);
  border-color: #ff9800;
}

.btn-view-lock.requesting {
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
  cursor: wait;
  animation: requesting-pulse 1.5s infinite;
}

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

/* View Lock - Approval Dialog (Multi-user) */
.view-lock-approval-dialog {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.view-lock-approval-dialog .approval-requests-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Individual request card - each is a standalone notification */
.approval-request-card {
  background: rgba(28, 28, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 16px;
  min-width: 320px;
  max-width: 380px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: slideInNotification 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInNotification {
  from {
    transform: translateX(120%) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translateX(0) scale(1);
    opacity: 1;
  }
}

.approval-request-card .request-card-content {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.approval-request-card .request-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.approval-request-card .request-message {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.approval-request-card .requester-name {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.approval-request-card .request-action-text {
  color: var(--text-secondary);
  font-size: 13px;
}

.approval-request-card .request-buttons {
  display: flex;
  gap: 10px;
}

.approval-request-card .request-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.approval-request-card .request-btn.approve {
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.approval-request-card .request-btn.approve:hover {
  background: linear-gradient(135deg, #5CBF60, #4CAF50);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.approval-request-card .request-btn.approve:active {
  transform: translateY(0);
}

.approval-request-card .request-btn.deny {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.approval-request-card .request-btn.deny:hover {
  background: rgba(244, 67, 54, 0.15);
  color: #f44336;
  border-color: rgba(244, 67, 54, 0.3);
}

.approval-request-card .request-btn svg {
  flex-shrink: 0;
}

/* View Lock - Leave Sync Button */
.view-lock-leave-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255, 152, 0, 0.15);
  border: 1px solid rgba(255, 152, 0, 0.3);
  border-radius: 6px;
  color: #ff9800;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 8px;
}

.view-lock-leave-btn:hover {
  background: rgba(255, 152, 0, 0.25);
  border-color: #ff9800;
}

.view-lock-leave-btn svg {
  flex-shrink: 0;
}

/* View Lock - Join Sync button (for rejoining after working independently) */
.view-lock-join-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(33, 150, 243, 0.15);
  border: 1px solid rgba(33, 150, 243, 0.3);
  border-radius: 6px;
  color: #2196F3;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 8px;
}

.view-lock-join-btn:hover {
  background: rgba(33, 150, 243, 0.25);
  border-color: #2196F3;
}

.view-lock-join-btn svg {
  flex-shrink: 0;
}

/* View Lock - Following state */
#btnViewLock.following {
  background: rgba(33, 150, 243, 0.15);
  border-color: rgba(33, 150, 243, 0.3);
  color: #2196F3;
}

#btnViewLock.following:hover {
  background: rgba(33, 150, 243, 0.2);
}

/* View Lock - Working independently state */
#btnViewLock.locked-by-other {
  background: rgba(158, 158, 158, 0.1);
  border-color: rgba(158, 158, 158, 0.2);
  color: var(--text-secondary);
  cursor: not-allowed;
}

#btnViewLock:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* View Lock - Authorization Dropdown (hover) */
.view-lock-auth-dropdown {
  position: fixed;
  z-index: 10001;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  min-width: 220px;
  max-width: 300px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.view-lock-auth-dropdown .auth-dropdown-header {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.view-lock-auth-dropdown .auth-dropdown-list {
  padding: 8px 0;
}

.view-lock-auth-dropdown .auth-dropdown-section {
  padding: 6px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.view-lock-auth-dropdown .auth-dropdown-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 13px;
}

.view-lock-auth-dropdown .auth-dropdown-user .user-name {
  color: var(--text-primary);
}

.view-lock-auth-dropdown .auth-dropdown-user .user-status {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
}

.view-lock-auth-dropdown .auth-dropdown-user.approved .user-status {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
}

.view-lock-auth-dropdown .auth-dropdown-user.denied .user-status {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.view-lock-auth-dropdown .auth-dropdown-user.pending .user-status {
  background: rgba(255, 152, 0, 0.2);
  color: #ff9800;
}

.view-lock-auth-dropdown .auth-dropdown-user .user-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(33, 150, 243, 0.2);
  color: #2196f3;
}

.view-lock-auth-dropdown .auth-dropdown-empty {
  padding: 12px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  font-style: italic;
}

.view-lock-auth-dropdown .auth-dropdown-request {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  font-size: 13px;
}

.view-lock-auth-dropdown .auth-dropdown-request .request-status {
  font-size: 10px;
  color: #ff9800;
}

/* View Lock - Requesting Overlay */
.view-lock-requesting-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  backdrop-filter: blur(2px);
}

.view-lock-requesting-overlay .requesting-content {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 32px 48px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.view-lock-requesting-overlay .requesting-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(33, 150, 243, 0.2);
  border-top-color: #2196f3;
  border-radius: 50%;
  margin: 0 auto 20px;
  animation: spin 1s linear infinite;
}

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

.view-lock-requesting-overlay .requesting-text {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}

.view-lock-requesting-overlay .requesting-subtext {
  color: var(--text-secondary);
  font-size: 13px;
  margin-bottom: 12px;
}

.view-lock-requesting-overlay .requesting-progress {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 16px;
}

.view-lock-requesting-overlay .requesting-progress .approved-count {
  color: #4CAF50;
  font-weight: 600;
}

.view-lock-requesting-overlay .requesting-progress .total-count {
  color: var(--text-primary);
  font-weight: 600;
}

.view-lock-requesting-overlay .requesting-users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  max-width: 400px;
}

.view-lock-requesting-overlay .requesting-user {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--bg-hover);
}

.view-lock-requesting-overlay .requesting-user.approved {
  background: rgba(76, 175, 80, 0.2);
  color: #4CAF50;
}

.view-lock-requesting-overlay .requesting-user.denied {
  background: rgba(244, 67, 54, 0.2);
  color: #f44336;
}

.view-lock-requesting-overlay .requesting-user.pending {
  background: rgba(255, 152, 0, 0.15);
  color: #ff9800;
}

.view-lock-requesting-overlay .requesting-user .user-name {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-lock-requesting-overlay .requesting-user .user-status {
  font-size: 14px;
}

.view-lock-requesting-overlay .controller-name {
  color: #2196f3;
  font-weight: 500;
}

.view-lock-requesting-overlay .requesting-cancel {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 24px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.view-lock-requesting-overlay .requesting-cancel:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.color-input {
  width: 50px;
  height: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-panel);
  cursor: pointer;
}

.viewport {
  flex: 1;
  position: relative;
  background: #1a1a1a;
}

.viewport canvas.picking {
  cursor: crosshair;
}

.viewport-overlay {
  position: absolute;
  bottom: var(--spacing-md);
  left: var(--spacing-md);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  pointer-events: none;
}

.streamline-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  min-width: 200px;
  max-width: 600px;
  width: 300px;
  padding: 12px;
  border-radius: 12px;
  background: rgba(18, 18, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  gap: 10px;
  pointer-events: auto;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  cursor: default;
  user-select: none;
}

.streamline-legend.resizing {
  cursor: ew-resize;
}

.streamline-legend .legend-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  background: transparent;
  transition: background 0.2s;
  z-index: 10;
}

.streamline-legend .legend-resize-handle:hover,
.streamline-legend .legend-resize-handle:active {
  background: rgba(255, 255, 255, 0.1);
}

.streamline-legend .legend-resize-corner {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: transparent;
  z-index: 11;
}

.streamline-legend .legend-resize-corner::after {
  content: '';
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(255, 255, 255, 0.3);
  border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.streamline-legend .legend-resize-corner:hover::after {
  border-color: rgba(255, 255, 255, 0.6);
}

.streamline-legend .legend-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
}

.streamline-legend .legend-gradient-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.streamline-legend .legend-gradient {
  width: 100%;
  height: 16px;
  border-radius: var(--border-radius);
  background-color: #333;
}

.streamline-legend .legend-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  gap: 8px;
  padding: 0 4px;
}

.streamline-legend .legend-ticks span {
  line-height: 1;
  white-space: nowrap;
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.streamline-legend .legend-meta {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
}

.fps-counter,
.coordinates {
  display: none;
}

/* Loading Overlay - CoandaCloud Tech Style */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 50;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-overlay p {
  margin-top: 20px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.loading-progress {
  margin-top: 24px;
  width: 280px;
  text-align: center;
}

.progress-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--apple-blue), var(--apple-accent));
  transition: width 0.3s ease;
  border-radius: 2px;
  border-radius: 2px;
}

.loading-details {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: var(--spacing-xs);
  min-height: 18px; /* Prevent layout shift when text changes */
  line-height: 1.5;
  transition: opacity 0.15s ease; /* Smooth text changes */
}

/* Form Elements - CoandaCloud Tech Style */
label {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 12px;
  transition: all 0.15s ease;
}

input[type="text"]:hover,
input[type="number"]:hover,
select:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

/* Ensure dropdown options are visible on all browsers */
select option {
  background: #1c1c1e;
  color: rgba(255, 255, 255, 0.9);
}

select option:checked,
select option:hover {
  background: #2c2c2e;
  color: #ffffff;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
}

/* Remove blue focus rings on click, show only on keyboard navigation */
*:focus {
  outline: none;
}

*:focus-visible {
  outline: 2px solid rgba(0, 122, 255, 0.4);
  outline-offset: 2px;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.25);
}

/* Modals - CoandaCloud Tech Style */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.75);
  z-index: 1000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(135deg, rgba(28, 28, 30, 0.98) 0%, rgba(18, 18, 20, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin: 0;
}

.close-modal,
.btn-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.5);
  font-size: 20px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.15s ease;
}

.close-modal:hover,
.btn-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 20px 24px;
  background: rgba(0, 0, 0, 0.15);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Terms of Service / Privacy Policy Content Styling */
.tos-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.tos-content h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 24px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.tos-content h2 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}

.tos-content h2:first-of-type {
  margin-top: 16px;
}

.tos-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 20px 0 12px 0;
}

.tos-content p {
  margin: 12px 0;
  color: var(--text-secondary);
}

.tos-content ul {
  margin: 12px 0;
  padding-left: 0;
  list-style: none;
}

.tos-content ul li {
  position: relative;
  padding-left: 20px;
  margin: 8px 0;
  color: var(--text-secondary);
}

.tos-content ul li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.tos-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.tos-content a {
  color: var(--primary-color);
  text-decoration: none;
  transition: opacity 0.2s;
}

.tos-content a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.tos-content pre {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 12px 16px;
  margin: 12px 0;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 13px;
  overflow-x: auto;
  color: var(--text-primary);
}

.tos-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 32px 0;
}

.tos-content > p:first-child {
  background: var(--bg-secondary);
  padding: 12px 16px;
  border-radius: var(--border-radius);
  border-left: 3px solid var(--primary-color);
}

.tos-content ul ul {
  margin: 8px 0 8px 20px;
}

.tos-content ul ul li::before {
  content: "◦";
}

/* Buttons - CoandaCloud Tech Style */
.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), #0055CC);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0088FF, var(--primary-color));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.95);
}

.btn-small {
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.btn-small:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

.btn-small:active {
  transform: translateY(0);
  background: rgba(255, 255, 255, 0.06);
}

.btn-small.btn-primary,
.btn-small[style*="background: #2a5a2a"],
.btn-small[style*="background:#2a5a2a"] {
  background: linear-gradient(135deg, var(--primary-color), #0055CC) !important;
  border-color: transparent !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.2);
}

.btn-small.btn-primary:hover,
.btn-small[style*="background: #2a5a2a"]:hover,
.btn-small[style*="background:#2a5a2a"]:hover {
  background: linear-gradient(135deg, #0088FF, var(--primary-color)) !important;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.btn-tiny {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  margin: 0 2px;
  transition: all 0.15s ease;
}

.btn-tiny:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Text Utilities */
.text-muted {
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

/* File Dropzone - CoandaCloud Tech Style */
.file-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: var(--spacing-xl);
  background: rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-normal);
}

.file-dropzone:hover {
  border-color: rgba(0, 122, 255, 0.4);
  background: rgba(0, 122, 255, 0.08);
}

.file-dropzone p {
  margin: var(--spacing-sm) 0;
  color: rgba(255, 255, 255, 0.6);
}

/* Scrollbar - CoandaCloud Tech Style */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* File Browser - CoandaCloud Tech Style */
#fileBrowser {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.15);
}

#breadcrumb {
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  white-space: nowrap;
  overflow-x: auto;
}

.breadcrumb-item {
  color: var(--primary-color);
  cursor: pointer;
  transition: all 0.15s ease;
}

.breadcrumb-item:hover {
  color: #0088FF;
  text-decoration: underline;
}

.breadcrumb-current {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

#fileList {
  max-height: 400px;
  overflow-y: auto;
  background: transparent;
}

.file-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 14px;
}

.file-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  position: relative;
}

.file-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.file-item.selected {
  background: rgba(0, 122, 255, 0.1);
  border-color: rgba(0, 122, 255, 0.4);
}

.file-item.openfoam-case {
  border-color: rgba(76, 175, 80, 0.4);
  background: rgba(76, 175, 80, 0.08);
}

.file-item.openfoam-case:hover {
  background: rgba(76, 175, 80, 0.15);
  border-color: rgba(76, 175, 80, 0.5);
}

.file-icon {
  font-size: 32px;
  margin-bottom: 4px;
  opacity: 0.85;
}

.file-name {
  font-size: 11px;
  text-align: center;
  word-break: break-word;
  color: rgba(255, 255, 255, 0.85);
  width: 100%;
  line-height: 1.3;
}

.file-item-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--danger-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: bold;
  line-height: 0.85;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  z-index: 10;
  padding: 0;
  padding-bottom: 2px;
  margin: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.file-item:hover .file-item-delete {
  opacity: 1;
}

.file-item-delete:hover {
  transform: scale(1.1);
  background: #FF0000;
}

.file-item-delete:active {
  transform: scale(0.95);
}

.file-item-download {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 0.85;
  opacity: 0;
  transition: opacity var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
  z-index: 10;
  padding: 0;
  margin: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.file-item:hover .file-item-download {
  opacity: 1;
}

.file-item-download:hover {
  transform: scale(1.1);
  background: #005bb5;
}

.file-item-download:active {
  transform: scale(0.95);
}

.file-item-rename {
  position: absolute;
  bottom: 6px;
  left: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--warning-color);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
  z-index: 2;
}

.file-item:hover .file-item-rename {
  opacity: 1;
  transform: translateY(0);
}

.file-item-rename:hover {
  transform: translateY(0) scale(1.1);
  background: #f59e0b;
}

.file-item-rename:active {
  transform: translateY(0) scale(0.95);
}

.file-size {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: all 0.15s ease;
}

.file-item:hover .file-size {
  opacity: 1;
  transform: translateY(0);
}

.case-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(76, 175, 80, 0.9);
  color: white;
  font-size: 8px;
  padding: 3px 6px;
  border-radius: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Mesh Parts Panel - CoandaCloud Tech Style */
.mesh-parts-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.mesh-parts-controls .btn-small {
  flex: 1;
}

.mesh-part-item {
  padding: 8px 10px;
  margin: 4px 0;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mesh-part-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.mesh-part-item input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--apple-blue);
  flex-shrink: 0;
}

.mesh-part-item label {
  cursor: pointer;
  flex: 1;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  user-select: none;
}

/* Mesh part groups (collapsible) */
.mesh-part-group {
  margin: 6px 0;
}

.mesh-part-group-header {
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-weight: 500;
}

.mesh-part-group-header:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.mesh-part-group-header .expand-icon {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  width: 12px;
  text-align: center;
}

.mesh-part-group-header input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: var(--apple-blue);
  flex-shrink: 0;
}

.mesh-part-group-header .group-title {
  flex: 1;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  user-select: none;
}

.mesh-part-group-children {
  margin-left: 16px;
  margin-top: 6px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  display: block;
}

.mesh-part-group-children.collapsed {
  display: none;
}

.mesh-part-group-children .mesh-part-item {
  margin: 3px 0;
  font-size: 12px;
  padding: 6px 10px;
}

/* Nested subgroups within type groups */
.mesh-part-subgroup {
  margin: 4px 0;
}

.mesh-part-subgroup-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  cursor: pointer;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}

.mesh-part-subgroup-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.mesh-part-subgroup-header .expand-icon {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.3);
  width: 10px;
  text-align: center;
}

.mesh-part-subgroup-header input[type="checkbox"] {
  cursor: pointer;
  width: 14px;
  height: 14px;
  accent-color: var(--apple-blue);
  flex-shrink: 0;
}

.mesh-part-subgroup-header .subgroup-title {
  flex: 1;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  user-select: none;
}

.mesh-part-subgroup-children {
  margin-left: 12px;
  margin-top: 4px;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.04);
  display: block;
}

.mesh-part-subgroup-children.collapsed {
  display: none;
}

.mesh-part-subgroup-children .mesh-part-item {
  margin: 2px 0;
  font-size: 11px;
  padding: 4px 8px;
}

/* Display Controls - CoandaCloud Tech Style */
.display-control {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.display-control .display-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.display-control label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.display-control select {
  margin-top: 4px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  transition: all 0.15s ease;
}

.display-control select:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

.display-control select:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
}

.display-control .slider-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.display-control .slider-value {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Monaco', 'Menlo', monospace;
  background: rgba(0, 0, 0, 0.25);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Display control sliders now use .coanda-slider class */

/* Filter Controls - CoandaCloud Tech Style */
.filter-section {
  margin-bottom: 8px;
  padding: 0;
  border-radius: 10px;
  background: rgba(28, 28, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-section:hover {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(28, 28, 30, 0.8);
}

.filter-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  cursor: pointer;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: all 0.15s ease;
}

.filter-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.filter-section:has(.filter-controls[style*="block"]) .filter-header,
.filter-section:has(.filter-controls:not([style*="none"])) .filter-header {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.filter-header input[type="checkbox"] {
  cursor: pointer;
  width: 16px;
  height: 16px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--apple-blue);
  border-radius: 4px;
}

.filter-header label {
  cursor: pointer;
  user-select: none;
  flex: 1;
  line-height: 1;
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.filter-header label strong {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.filter-controls {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 0;
}

.filter-controls label {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
  text-transform: none;
  letter-spacing: 0;
}

.filter-controls input[type="number"],
.filter-controls input[type="text"],
.filter-controls select {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.92);
  transition: all 0.15s ease;
}

.filter-controls input[type="number"]:hover,
.filter-controls input[type="text"]:hover,
.filter-controls select:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
}

.filter-controls input[type="number"]:focus,
.filter-controls input[type="text"]:focus,
.filter-controls select:focus {
  outline: none;
  border-color: rgba(0, 122, 255, 0.5);
  background: rgba(0, 0, 0, 0.4);
}

/* Only show focus ring for keyboard navigation */
.filter-controls input[type="number"]:focus-visible,
.filter-controls input[type="text"]:focus-visible,
.filter-controls select:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

/* Filter control sliders now use .coanda-slider class */

.vector-input {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.vector-input.with-button {
  grid-template-columns: repeat(3, 1fr) 36px;
  align-items: center;
}

.vector-input.two {
  grid-template-columns: repeat(2, 1fr);
}

.vector-input input {
  width: 100%;
  text-align: center;
  padding: 8px 6px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 0;
  transition: all 0.15s ease;
}

.vector-input input:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.4);
}

.vector-input input:focus {
  border-color: rgba(0, 122, 255, 0.5);
  background: rgba(0, 0, 0, 0.45);
}

.vector-input.with-button .btn-icon-small {
  height: 100%;
}

.checkbox-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.checkbox-inline:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.checkbox-inline input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--apple-blue);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-inline label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  margin: 0;
}

.filter-controls .btn-small {
  margin-top: 6px;
  width: 100%;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.filter-controls .btn-small:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
}

.filter-controls .btn-small:active {
  transform: translateY(0);
}

/* Filter section info text */
.filter-controls p {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  padding: 6px 8px;
  background: rgba(0, 122, 255, 0.08);
  border-radius: 6px;
  border-left: 2px solid var(--primary-color);
  margin: 0;
}

/* Divider within filter controls */
.filter-controls hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.seed-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.1));
  position: relative;
}

.seed-group::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
}

.seed-group.hidden {
  display: none !important;
}

/* Info box styling */
.info-box {
  padding: 8px 10px;
  background: rgba(0, 122, 255, 0.08);
  border-radius: 6px;
  border-left: 2px solid var(--primary-color);
}

.info-box small {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Selection type controls */
.selection-type-controls {
  padding: 8px 0;
}

/* Expandable/collapsible sections within filters */
.filter-subsection {
  margin-top: 8px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-subsection-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
}

.filter-subsection-header::before {
  content: '▸';
  font-size: 10px;
  transition: transform var(--transition-fast);
}

.filter-subsection.expanded .filter-subsection-header::before {
  transform: rotate(90deg);
}

/* Better button group styling */
.filter-controls .button-group {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.filter-controls .button-group .btn-small {
  margin-top: 0;
  flex: 1;
}

/* Status indicators */
.filter-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.filter-status.active {
  background: rgba(48, 209, 88, 0.2);
  color: var(--success-color);
}

.filter-status.warning {
  background: rgba(255, 159, 10, 0.2);
  color: var(--warning-color);
}

/* Improved slider with value display */
.slider-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slider-row .slider-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.slider-row .slider-value {
  font-size: 11px;
  color: var(--text-secondary);
  font-family: 'Monaco', 'Menlo', monospace;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Colormap Control Styling */
.colormap-control {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.colormap-preview {
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: linear-gradient(to right, #00f, #0ff, #0f0, #ff0, #f00);
  margin: 4px 0;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.solid-color-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
}

.solid-color-picker input[type="color"] {
  width: 50px;
  height: 28px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
  padding: 2px;
}

.solid-color-picker input[type="color"]:hover {
  border-color: var(--border-light);
}

/* Custom colormap edit button */
.colormap-custom-edit {
  margin-top: 4px;
}

.colormap-custom-edit button,
.colormap-solid-picker + .colormap-custom-edit button {
  width: 100%;
  padding: 6px 12px;
  font-size: 11px;
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.15), rgba(0, 122, 255, 0.08));
  border: 1px solid rgba(0, 122, 255, 0.3);
  border-radius: 6px;
  color: var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.colormap-custom-edit button:hover {
  background: linear-gradient(135deg, rgba(0, 122, 255, 0.25), rgba(0, 122, 255, 0.15));
  border-color: var(--primary-color);
}

/* Action button variants for filters */
.btn-action-success {
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.2), rgba(48, 209, 88, 0.1)) !important;
  border-color: rgba(48, 209, 88, 0.4) !important;
  color: var(--success-color) !important;
}

.btn-action-success:hover {
  background: linear-gradient(135deg, rgba(48, 209, 88, 0.3), rgba(48, 209, 88, 0.15)) !important;
  border-color: var(--success-color) !important;
}

.btn-action-danger {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.2), rgba(255, 69, 58, 0.1)) !important;
  border-color: rgba(255, 69, 58, 0.4) !important;
  color: var(--danger-color) !important;
}

.btn-action-danger:hover {
  background: linear-gradient(135deg, rgba(255, 69, 58, 0.3), rgba(255, 69, 58, 0.15)) !important;
  border-color: var(--danger-color) !important;
}

/* Filter result display */
.filter-result {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.filter-result-title {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-result-content {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.filter-result-content span {
  margin-right: 12px;
}

/* Cutting planes list styling */
#cuttingPlanesList {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#cuttingPlanesList > div {
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast);
}

#cuttingPlanesList > div:hover {
  border-color: var(--border-light);
}

#cuttingPlanesList > div.selected {
  border-color: var(--primary-color);
  background: rgba(0, 122, 255, 0.08);
}

/* Probe Display */
.probe-display {
  position: fixed;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--apple-blue);
  border-radius: 8px;
  padding: 10px;
  min-width: 200px;
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.probe-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-blue);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.probe-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.probe-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.probe-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.probe-value {
  color: var(--text-primary);
  font-family: 'Monaco', 'Menlo', monospace;
  font-weight: 600;
}

/* View Cube - CoandaCloud Tech Style */
.view-cube {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  padding: 14px;
  cursor: move;
  z-index: 1000;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(24, 24, 26, 0.95), rgba(14, 14, 16, 0.98));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.03);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  display: none; /* Hidden by default */
}

.view-cube.visible {
  display: block;
}

.view-cube:hover {
  border-color: rgba(0, 122, 255, 0.4);
  box-shadow: 0 16px 40px rgba(0, 122, 255, 0.25), 0 0 0 1px rgba(0, 122, 255, 0.2);
}

.view-cube.dragging {
  cursor: grabbing;
  border-color: rgba(0, 122, 255, 0.5);
  box-shadow: 0 20px 48px rgba(0, 122, 255, 0.3), 0 0 0 2px rgba(0, 122, 255, 0.3);
  transition: none;
}

.view-cube-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
  text-align: center;
  user-select: none;
  cursor: move;
  padding: 4px 0;
}

.view-cube-title:hover {
  color: rgba(255, 255, 255, 0.8);
}

#viewCubeCanvas {
  display: block;
  border-radius: 8px;
  margin: 0 auto;
  cursor: grab;
}

#viewCubeCanvas:active {
  cursor: grabbing;
}

/* Chart Modal Styles */
.chart-modal {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s ease-in;
}

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

.chart-modal-content {
  position: relative;
  background: linear-gradient(135deg, #1e1e23 0%, #14141a 100%);
  margin: 2% auto;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: 90%;
  max-width: 1400px;
  height: 90vh;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.chart-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px 12px 0 0;
}

.chart-modal-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 20px;
  font-weight: 600;
}

.chart-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  font-weight: 300;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.chart-modal-body {
  flex: 1;
  padding: 30px;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-modal-body canvas {
  max-width: 100%;
  max-height: 100%;
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Chart Modal Footer */
.chart-modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 20px 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 0 12px 12px;
}

.btn-modal {
  padding: 12px 24px;
  background: linear-gradient(135deg, #007AFF, #0051D5);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 122, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-modal:hover {
  background: linear-gradient(135deg, #0051D5, #003DA5);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.5);
  transform: translateY(-1px);
}

.btn-modal:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(0, 122, 255, 0.4);
}

/* ===== Share Modal Styles ===== */
.share-modal-content {
  width: 560px;
  max-width: 95vw;
}

.share-modal-content .modal-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.share-section {
  margin-bottom: 24px;
}

.share-section:last-child {
  margin-bottom: 0;
}

.share-section-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #aaa;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Invite Row */
.share-invite-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.share-email-input {
  flex: 1;
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s;
}

.share-email-input:focus {
  outline: none;
  border-color: #2196F3;
}

.share-email-input::placeholder {
  color: #666;
}

.share-role-select {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #fff;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  min-width: 120px;
}

.share-role-select:focus {
  outline: none;
  border-color: #2196F3;
}

.share-send-btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
}

/* Collaborators List */
.share-collaborators {
  border-top: 1px solid #333;
  padding-top: 20px;
}

.collaborators-list {
  max-height: 200px;
  overflow-y: auto;
}

.empty-collaborators {
  color: #666;
  font-size: 14px;
  font-style: italic;
  padding: 16px;
  text-align: center;
  background: #1a1a1a;
  border-radius: 8px;
}

.collaborator-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #1a1a1a;
  border-radius: 8px;
  margin-bottom: 8px;
  gap: 12px;
}

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

.collaborator-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.collaborator-name {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.collaborator-email {
  font-size: 12px;
  color: #888;
}

.collaborator-role {
  font-size: 12px;
  color: #2196F3;
  padding: 4px 10px;
  background: rgba(33, 150, 243, 0.15);
  border-radius: 12px;
}

.remove-collaborator-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  margin-left: auto;
}

.remove-collaborator-btn:hover {
  color: #f44336;
  background: rgba(244, 67, 54, 0.1);
}

/* Public Link Section */
.share-public-link {
  border-top: 1px solid #333;
  padding-top: 20px;
}

.public-link-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.public-link-toggle input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  width: 44px;
  height: 24px;
  background: #444;
  border-radius: 12px;
  position: relative;
  transition: background 0.2s;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.2s;
}

.public-link-toggle input[type="checkbox"]:checked + .toggle-slider {
  background: #2196F3;
}

.public-link-toggle input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(20px);
}

.public-link-input {
  flex: 1;
  background: #1a1a1a;
  border: 1px solid #444;
  color: #2196F3;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-family: monospace;
  height: 40px;
  box-sizing: border-box;
}

.btn-copy {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #2196F3;
  color: white;
  border: none;
  padding: 0 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.2s;
  white-space: nowrap;
  height: 40px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.btn-copy:hover {
  background: #1976D2;
}

.btn-copy.copied {
  background: #4CAF50;
}

/* ===== Mobile Menu Button ===== */
.mobile-menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
}

.mobile-menu-toggle:active {
  transform: scale(0.95);
}

/* ===== Mobile Overlay ===== */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1500;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-overlay.active {
  display: block;
  opacity: 1;
}

/* ===== Mobile Actions Menu ===== */
.mobile-actions-menu {
  display: none;
  position: relative;
}

.mobile-more-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-actions-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: rgba(28, 28, 30, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 8px;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  z-index: 2000;
}

.mobile-actions-dropdown.open {
  display: block;
}

.mobile-action-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.mobile-action-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.mobile-action-item:active {
  background: rgba(255, 255, 255, 0.12);
}

.mobile-action-item img,
.mobile-action-item svg {
  flex-shrink: 0;
}

/* ===== Mobile Responsive Styles ===== */

/* Tablet breakpoint */
@media (max-width: 1024px) {
  .sidebar-left {
    width: 280px;
  }

  /* Update toggle position to match narrower sidebar */
  .sidebar-toggle {
    left: 280px;
  }

  .main-content.sidebar-hidden .sidebar-left {
    margin-left: -280px;
  }
}

/* Mobile breakpoint */
@media (max-width: 768px) {
  /* Show mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
    order: -1;
    margin-right: 8px;
  }

  /* Header adjustments */
  .header {
    padding: 8px 12px;
    height: 54px;
  }

  .logo {
    font-size: 16px;
  }

  .logo span:last-child {
    font-size: 8px !important;
    padding: 1px 4px !important;
  }

  .logo img {
    height: 24px;
  }

  /* Hide user info on mobile (too cramped) */
  .user-info {
    display: none !important;
  }

  /* Hide regular header actions on mobile, show mobile menu instead */
  .header-actions {
    display: none !important;
  }

  .mobile-actions-menu {
    display: block;
  }

  /* Sidebar - slide in from left */
  .sidebar-left {
    position: fixed !important;
    top: 54px;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    z-index: 2000;
    margin-left: 0 !important;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    background: rgba(18, 18, 20, 0.98);
    padding: 12px;
    overflow-y: auto;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .sidebar-left.mobile-open {
    transform: translateX(0);
  }

  /* Hide the desktop sidebar toggle on mobile */
  .sidebar-toggle {
    display: none !important;
  }

  /* Viewport takes full width */
  .viewport-container {
    width: 100% !important;
    margin-left: 0 !important;
  }

  /* Viewport toolbar - make it scrollable */
  .viewport-toolbar {
    padding: 6px 8px;
    gap: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .viewport-toolbar::-webkit-scrollbar {
    display: none;
  }

  .toolbar-group {
    flex-shrink: 0;
  }

  .btn-toolbar {
    padding: 6px 10px;
    font-size: 11px;
  }

  .toolbar-label {
    font-size: 11px;
  }

  /* Color input smaller */
  .color-input {
    width: 28px;
    height: 28px;
  }

  /* Hide case name toolbar on small screens */
  #caseNameToolbar {
    display: none !important;
  }

  /* View cube adjustments */
  .view-cube {
    bottom: 20px;
    transform: translateX(-50%) scale(0.8);
  }

  /* Legends - smaller on mobile */
  .streamline-legend {
    right: 8px;
    width: 140px;
  }

  .legend-title {
    font-size: 11px;
  }

  /* Viewport overlay adjustments */
  .viewport-overlay {
    left: 8px;
    bottom: 8px;
  }

  .fps-counter,
  .coordinates {
    font-size: 10px;
    padding: 4px 8px;
  }

  /* Panel adjustments */
  .panel-header {
    padding: 10px 12px;
  }

  .panel-header h3 {
    font-size: 11px;
  }

  .panel-content {
    padding: 10px;
    font-size: 12px;
  }

  /* Probe display adjustments */
  .probe-display {
    max-width: 200px;
    font-size: 11px;
  }

  /* Loading overlay adjustments */
  .loading-overlay p {
    font-size: 13px;
  }
}

/* Small mobile breakpoint */
@media (max-width: 480px) {
  .header {
    padding: 6px 10px;
    height: 50px;
  }

  .logo {
    font-size: 14px;
    gap: 4px;
  }

  .logo img {
    height: 20px;
  }

  /* Hide Beta badge on very small screens */
  .logo span:last-child {
    display: none !important;
  }

  /* Sidebar narrower */
  .sidebar-left {
    top: 50px;
    width: 280px;
    max-width: 90vw;
  }

  /* Viewport toolbar even smaller */
  .viewport-toolbar {
    padding: 4px 6px;
    gap: 4px;
  }

  .btn-toolbar {
    padding: 5px 8px;
    font-size: 10px;
  }

  /* View cube smaller */
  .view-cube {
    bottom: 15px;
    transform: translateX(-50%) scale(0.7);
  }

  /* Legends even smaller */
  .streamline-legend {
    width: 120px;
    right: 5px;
  }

  /* Hide coordinates on very small screens */
  .coordinates {
    display: none !important;
  }
}
