/* Base Reset and Typography */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Enterprise Color Palette - Dark Navy Theme */
  --primary-color: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --accent-color: #0ea5e9;
  --accent-dark: #0284c7;
  
  /* Semantic Colors */
  --success-color: #059669;
  --success-dark: #047857;
  --success-light: #10b981;
  --danger-color: #dc2626;
  --danger-dark: #b91c1c;
  --danger-light: #ef4444;
  --warning-color: #d97706;
  --warning-dark: #b45309;
  --warning-light: #f59e0b;
  --info-color: #0891b2;
  --info-dark: #0e7490;
  
  /* Neutral Grays - Professional */
  --background-color: #f8fafc;
  --background-secondary: #f1f5f9;
  --surface-color: #ffffff;
  --surface-elevated: #fefefe;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-strong: #cbd5e1;
  
  /* Text Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-disabled: #94a3b8;
  --text-inverse: #ffffff;
  
  /* Shadows - Professional Depth */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
  
  /* Border Radius */
  --border-radius-sm: 6px;
  --border-radius: 8px;
  --border-radius-md: 10px;
  --border-radius-lg: 12px;
  --border-radius-xl: 16px;
  --border-radius-full: 9999px;
  
  /* Spacing Scale */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  
  /* Transitions */
  --transition-fast: all 0.15s ease-out;
  --transition: all 0.2s ease-in-out;
  --transition-slow: all 0.3s ease-in-out;
  
  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  
  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.625;
}

body {
  background: linear-gradient(135deg, var(--background-color) 0%, var(--background-secondary) 100%);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: var(--line-height-normal);
  height: 100vh;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Compact Dashboard Layout */
.app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.app-header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 25%, #1e40af 50%, #1d4ed8 75%, #2563eb 100%);
  color: var(--text-inverse);
  padding: 12px var(--space-xl);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%), 
              linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%), 
              linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.08) 75%), 
              linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.08) 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
  opacity: 0.4;
}

.header-content {
  position: relative;
  z-index: 1;
  text-align: center;
}

.app-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

.app-header i {
  margin-right: var(--space-sm);
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
  opacity: 0.95;
}

.header-subtitle {
  display: none;
}

.app-container {
  flex: 1;
  padding: var(--space-lg);
  width: 100%;
  display: flex;
  gap: var(--space-lg);
  overflow: hidden;
}

.app-footer {
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-dark) 100%);
  color: var(--text-inverse);
  text-align: center;
  padding: var(--space-md);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  flex-shrink: 0;
  border-top: 1px solid var(--border-strong);
}

/* Compact Dashboard Layout */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  overflow-y: auto;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  overflow: hidden;
  min-width: 0;
}

.content-top {
  height: 60%;
  overflow: hidden;
}

.content-bottom {
  height: 40%;
  display: flex;
  gap: var(--space-lg);
  overflow: hidden;
}

.activity-section {
  flex: 2;
  overflow: hidden;
}

.payload-section {
  flex: 1;
  overflow: hidden;
}

.panel-section {
  background: var(--surface-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(10px);
  background: linear-gradient(145deg, var(--surface-color) 0%, var(--surface-elevated) 100%);
}

.panel-section.compact {
  padding: 12px;
}

.panel-section.compact .section-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
}

.panel-section.compact .form-group {
  margin-bottom: var(--space-md);
}

.panel-section.compact .form-control,
.panel-section.compact input,
.panel-section.compact select {
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-xs);
}

.panel-section:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
  border-color: var(--border-strong);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--border-light);
  flex-shrink: 0;
  position: relative;
}

.section-header::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: var(--border-radius-full);
}

.section-header i {
  font-size: var(--font-size-xl);
  color: var(--primary-color);
  margin-right: var(--space-md);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.section-header h2 {
  font-size: var(--font-size-xl);
  color: var(--text-primary);
  margin: 0;
  font-weight: var(--font-weight-semibold);
  flex: 1;
  letter-spacing: -0.025em;
}

.panel-actions {
  display: flex;
  gap: var(--space-sm);
}

/* Stream Counter Indicator */
.stream-counter {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-left: var(--space-xl);
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
  border-radius: var(--border-radius-full);
  box-shadow: var(--shadow-sm);
  min-width: 120px;
}

.counter-value {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--text-inverse);
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.counter-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
}

.stream-counter.has-streams {
  background: linear-gradient(135deg, var(--success-color) 0%, var(--success-light) 100%);
  animation: streamCounterActive 1.5s infinite;
}

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

/* Professional Form Styling */
.form-group {
  margin-bottom: var(--space-lg);
}

/* Form groups within config sections need tighter spacing */
.config-section .form-group {
  margin-bottom: var(--space-sm);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-sm);
  letter-spacing: 0.025em;
}

.form-control,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-normal);
  transition: var(--transition);
  background-color: var(--surface-color);
  color: var(--text-primary);
  box-shadow: var(--shadow-inner);
}

.form-control:focus,
.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1), var(--shadow-sm);
  background-color: var(--surface-elevated);
}

.form-control:hover,
.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  border-color: var(--border-strong);
}

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

/* Password Field with Toggle */
.password-field {
  position: relative;
  display: flex;
}

.password-field input {
  flex-grow: 1;
  padding-right: 48px;
}

.toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.toggle-password:hover {
  color: var(--text-primary);
  background-color: var(--border-color);
}

/* File Selector */
.file-selector-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.file-display {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 2px dashed var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--background-color);
  transition: var(--transition);
  min-height: 60px;
}

.file-display:hover {
  border-color: var(--primary-color);
  background-color: rgba(37, 99, 235, 0.05);
}

.file-info {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
  min-width: 0; /* Allow text to wrap */
  padding-top: 2px;
}

.file-info i {
  color: var(--primary-color);
  font-size: 1.1rem;
  flex-shrink: 0; /* Keep icon size fixed */
}

.selected-file-name {
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  max-height: 2.8em; /* Allow for exactly 2 lines */
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  padding: 2px 0;
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.75rem;
  background-color: var(--border-color);
  padding: 2px 8px;
  border-radius: 12px;
}

.btn-browse {
  padding: 8px 16px;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-browse:hover {
  background-color: var(--primary-dark);
  transform: translateY(-1px);
}

/* File Preview */
.file-preview {
  margin-top: 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  background-color: var(--surface-color);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--background-color);
}

.preview-header h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-close-preview {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-close-preview:hover {
  color: var(--danger-color);
  background-color: rgba(220, 38, 38, 0.1);
}

.preview-content {
  padding: 12px;
  flex: 1;
  overflow-y: auto;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.7rem;
  line-height: 1.3;
  background-color: #f8f9fa;
  color: var(--text-primary);
}

/* Streaming Info */
.streaming-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
  padding: 8px;
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
}

.status-indicator {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
}

/* Status indicator states */
.status-indicator.ready {
  color: var(--primary-color);
}

.status-indicator.streaming {
  color: var(--success-color);
  animation: pulse 2s infinite;
}

.status-indicator.error {
  color: var(--danger-color);
}

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

/* Session Configuration */
.session-config {
  margin-bottom: 12px;
  overflow-y: auto;
  flex: 1;
}

.metadata-section {
  margin-top: 8px;
  padding: 8px;
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
}

.section-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.form-control select,
.form-control textarea {
  width: 100%;
  padding: 8px 12px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 0.875rem;
  transition: var(--transition);
  background-color: var(--surface-color);
  color: var(--text-primary);
}

.form-control select:focus,
.form-control textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

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

/* Control Buttons */
.control-section {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

/* Professional Button System */
.btn {
  flex: 1;
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  position: relative;
  overflow: hidden;
  min-height: 44px;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn i {
  font-size: var(--font-size-base);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.btn-start {
  background: linear-gradient(135deg, var(--success-color) 0%, var(--success-dark) 100%);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--success-dark);
}

.btn-start:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--success-light) 0%, var(--success-color) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-end {
  background: linear-gradient(135deg, var(--danger-color) 0%, var(--danger-dark) 100%);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--danger-dark);
}

.btn-end:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--danger-light) 0%, var(--danger-color) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-add {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: var(--text-inverse);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--primary-dark);
}

.btn-add:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary-color) 100%);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:disabled {
  background: var(--text-disabled);
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn:disabled::before {
  display: none;
}

.btn-clear-logs {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius);
  transition: var(--transition);
}

.btn-clear-logs:hover {
  color: var(--danger-color);
  background-color: rgba(220, 38, 38, 0.1);
}

.btn-add-tab {
  background: none;
  border: none;
  color: var(--primary-color);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
}

.btn-add-tab:hover {
  color: var(--primary-dark);
  background-color: rgba(37, 99, 235, 0.1);
}

.btn-pause {
  background: linear-gradient(135deg, var(--warning-color), #e67e22);
  color: white;
  border: none;
}

.btn-pause:hover:not(:disabled) {
  background: linear-gradient(135deg, #e67e22, var(--warning-color));
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

/* Status Panel */
.status-panel {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-message {
  padding: 8px 12px;
  border-radius: var(--border-radius);
  background-color: var(--background-color);
  border-left: 4px solid var(--primary-color);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-primary);
  flex-shrink: 0;
}

.log-container {
  flex: 1;
  overflow-y: auto;
  border: 2px solid var(--border-color);
  padding: 12px;
  border-radius: var(--border-radius);
  background-color: var(--background-color);
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.75rem;
  line-height: 1.4;
}

.log-container::-webkit-scrollbar {
  width: 8px;
}

.log-container::-webkit-scrollbar-track {
  background: var(--border-color);
  border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}

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

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(4px);
}

.modal-content {
  background-color: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--border-radius);
  transition: var(--transition);
  font-size: 1.25rem;
}

.btn-close-modal:hover {
  color: var(--danger-color);
  background-color: rgba(220, 38, 38, 0.1);
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid var(--border-color);
  background-color: var(--background-color);
}

.btn-secondary {
  background-color: var(--text-muted);
  color: white;
}

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

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

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

/* File Browser */
.file-browser {
  min-height: 300px;
}

.current-path {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  margin-bottom: 16px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.file-list {
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  max-height: 300px;
  overflow-y: auto;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition);
}

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

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

.file-item.selected {
  background-color: rgba(37, 99, 235, 0.1);
  border-left: 4px solid var(--primary-color);
}

.file-item.directory {
  color: var(--primary-color);
}

.file-item.json-file {
  color: var(--success-color);
}

.file-item i {
  width: 16px;
  text-align: center;
}

.file-name {
  flex: 1;
  font-size: 0.875rem;
}

.file-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px;
  color: var(--text-secondary);
}

.loading-spinner i {
  font-size: 1.25rem;
}

/* Webhook Message Types */
.webhook-log {
  padding: 8px 12px;
  margin: 4px 0;
  border-left: 4px solid var(--primary-color);
  border-radius: var(--border-radius);
  background-color: rgba(37, 99, 235, 0.05);
  color: var(--text-primary);
  font-weight: normal;
  line-height: 1.4;
  transition: var(--transition);
}

.webhook-log:hover {
  background-color: rgba(37, 99, 235, 0.1);
}

.webhook-start {
  background-color: rgba(5, 150, 105, 0.05);
  border-left-color: var(--success-color);
}

.webhook-start:hover {
  background-color: rgba(5, 150, 105, 0.1);
}

.webhook-transcription {
  background-color: rgba(100, 116, 139, 0.05);
  border-left-color: var(--secondary-color);
}

.webhook-end {
  background-color: rgba(147, 51, 234, 0.05);
  border-left-color: #9333ea;
}

.webhook-final {
  background-color: rgba(217, 119, 6, 0.05);
  border-left-color: var(--warning-color);
}

.webhook-response.success {
  color: var(--success-color);
}

.webhook-response.failed {
  color: var(--warning-color);
}

.agent-message {
  margin-right: 10%;
}

.client-message {
  margin-left: 10%;
  background-color: rgba(59, 130, 246, 0.05);
  border-left-color: #3b82f6;
}

.conversation-header,
.conversation-footer {
  text-align: center;
  font-weight: 600;
  padding: 8px 16px;
  margin: 12px 0;
  background-color: var(--background-color);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.conversation-header {
  color: var(--success-color);
  border-color: rgba(5, 150, 105, 0.2);
}

.conversation-footer {
  color: var(--danger-color);
  border-color: rgba(220, 38, 38, 0.2);
}

.webhook-details,
.webhook-response {
  margin: 2px 0 4px 16px;
  padding: 2px 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
  border-left: 2px solid var(--border-color);
  background-color: rgba(100, 116, 139, 0.05);
  border-radius: 0 4px 4px 0;
}

.error-message {
  background-color: rgba(220, 38, 38, 0.05);
  border-left: 4px solid var(--danger-color);
  color: var(--danger-color);
  padding: 8px 12px;
  margin: 4px 0;
  border-radius: var(--border-radius);
  font-weight: 500;
}

.system-message {
  background-color: rgba(100, 116, 139, 0.05);
  border-left: 4px solid var(--secondary-color);
  color: var(--text-secondary);
  padding: 6px 10px;
  margin: 2px 0;
  border-radius: var(--border-radius);
  font-weight: 400;
  font-style: italic;
}

/* Payload display styles */
.payload-container {
  background: #ffffff;
  border: 1px solid #e1e4e8;
  border-radius: 8px;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  position: relative;
}

.payload-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #007acc, #00d4aa, #007acc);
  border-radius: 8px 8px 0 0;
}

.payload-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.5;
  background: transparent;
  color: #24292f;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.02em;
}

.payload-content::-webkit-scrollbar {
  width: 8px;
}

.payload-content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.payload-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #d0d7de, #afb8c1);
  border-radius: 4px;
  border: 1px solid #d0d7de;
}

.payload-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #afb8c1, #8c959f);
}

.payload-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #656d76;
  font-style: italic;
  height: 100%;
  padding: var(--spacing-md);
  text-align: center;
  font-size: 13px;
  background: transparent;
}

.payload-empty::before {
  content: '📄';
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* JSON syntax highlighting */
.json-key {
  color: #0969da;
  font-weight: 500;
}

.json-string {
  color: #0a3069;
  font-style: normal;
}

.json-number {
  color: #8250df;
  font-weight: 600;
}

.json-boolean {
  color: #cf222e;
  font-weight: 600;
}

.json-null {
  color: #656d76;
  font-style: italic;
}

.json-bracket {
  color: #24292f;
  font-weight: bold;
}

.json-null {
  color: #569cd6;
}

/* Compact Dashboard Responsive Design */
@media (max-width: 1200px) {
  .app-container {
    flex-direction: column;
    gap: var(--space-md);
  }
  
  .sidebar {
    width: 100%;
    flex-direction: row;
    gap: var(--space-md);
    overflow-x: auto;
  }
  
  .sidebar .panel-section {
    min-width: 280px;
    flex-shrink: 0;
  }
  
  .content-top {
    height: 40%;
  }
  
  .content-bottom {
    height: 60%;
    flex-direction: column;
  }
  
  .activity-section,
  .payload-section {
    flex: 1;
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: var(--space-md);
  }
  
  .sidebar {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .sidebar .panel-section {
    min-width: auto;
  }
  
  .content-top {
    height: auto;
    min-height: 300px;
  }
  
  .content-bottom {
    height: auto;
  }
  
  .streaming-info {
    grid-template-columns: 1fr;
  }
  
  .control-section,
  .stream-controls {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .file-display {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  
  .tab-nav {
    padding: var(--space-xs);
  }
  
  .tab-button {
    padding: var(--space-sm) var(--space-md);
    font-size: var(--font-size-xs);
  }
  
  .stream-counter {
    margin-left: var(--space-md);
    min-width: 60px;
  }
  
  /* Make data source config single column on mobile */
  .data-source-config {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    grid-template-areas: 
      "file-selection"
      "session-config"
      "metadata-config"
      "stream-controls";
  }
  
  /* Make metadata forms single column on mobile */
  .metadata-config-section .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .app-container {
    padding: var(--space-md);
  }
  
  .app-header h1 {
    font-size: var(--font-size-xl);
  }
  
  .header-subtitle {
    font-size: var(--font-size-sm);
  }
  
  .panel-section {
    padding: var(--space-lg);
  }
  
  .btn {
    padding: var(--space-md) var(--space-lg);
    font-size: var(--font-size-xs);
    min-height: 40px;
  }
  
  .modal-content {
    width: 95%;
    margin: var(--space-xl);
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: var(--space-lg);
  }
}

/* Professional Tabbed Interface */
.tabs-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface-color);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-inner);
}

.tab-nav {
  display: flex;
  border-bottom: 2px solid var(--border-light);
  background: linear-gradient(135deg, var(--background-color) 0%, var(--background-secondary) 100%);
  overflow-x: auto;
  flex-shrink: 0;
  padding: var(--space-xs);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.tab-button {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: none;
  border: none;
  cursor: pointer;
  border-radius: var(--border-radius);
  transition: var(--transition);
  white-space: nowrap;
  color: var(--text-secondary);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-sm);
  position: relative;
  margin-right: var(--space-xs);
}

.tab-button:hover {
  background: var(--surface-color);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.tab-button.active {
  color: var(--primary-color);
  background: var(--surface-color);
  box-shadow: var(--shadow-md);
  font-weight: var(--font-weight-semibold);
}

.tab-button.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  border-radius: var(--border-radius-full);
}

.tab-label {
  flex: 1;
}

.tab-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  font-size: 0.75rem;
  transition: var(--transition);
  opacity: 0.7;
}

.tab-close:hover {
  color: var(--danger-color);
  background-color: rgba(220, 38, 38, 0.1);
  opacity: 1;
}

/* Miniature stream control buttons in tabs */
.tab-stream-controls {
  display: flex;
  gap: 4px;
  margin-left: var(--space-sm);
  align-items: center;
}

.tab-stream-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  font-size: 0.7rem;
  transition: var(--transition);
  opacity: 0.8;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-stream-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.tab-stream-btn.start-btn {
  color: var(--success-color);
  border: 1px solid transparent;
}

.tab-stream-btn.start-btn:not(:disabled) {
  background-color: rgba(5, 150, 105, 0.1);
  border-color: var(--success-color);
}

.tab-stream-btn.start-btn:hover:not(:disabled) {
  background-color: rgba(5, 150, 105, 0.2);
  color: var(--success-dark);
  transform: scale(1.1);
}

.tab-stream-btn.stop-btn {
  color: var(--danger-color);
  border: 1px solid transparent;
}

.tab-stream-btn.stop-btn:not(:disabled) {
  background-color: rgba(220, 38, 38, 0.1);
  border-color: var(--danger-color);
}

.tab-stream-btn.stop-btn:hover:not(:disabled) {
  background-color: rgba(220, 38, 38, 0.2);
  color: var(--danger-dark);
  transform: scale(1.1);
}

/* Status indicator in tab */
.tab-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  margin-left: 4px;
  transition: var(--transition);
}

.tab-status-indicator.ready {
  background-color: var(--primary-color);
}

.tab-status-indicator.streaming {
  background-color: var(--success-color);
  animation: pulse 1.5s infinite;
}

.tab-status-indicator.error {
  background-color: var(--danger-color);
}

.tab-content {
  flex: 1;
  overflow: hidden;
}

.tab-pane {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
}

.tab-pane.active {
  display: block;
}

.data-source-config {
  display: grid;
  grid-template-columns: 0.8fr 0.8fr 1.4fr;
  grid-template-rows: auto auto;
  gap: 16px;
  height: 100%;
  padding: 16px;
  grid-template-areas: 
    "file-selection session-config metadata-config"
    "stream-controls stream-controls stream-controls";
}

.config-section {
  background-color: var(--background-color);
  border-radius: var(--border-radius);
  padding: 10px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

/* Grid area assignments for config sections */
.file-selection-section {
  grid-area: file-selection;
}

.session-config-section {
  grid-area: session-config;
}

.metadata-config-section {
  grid-area: metadata-config;
}

/* Make metadata section use 3 columns since it now has more space */
.metadata-config-section .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.stream-controls-section {
  grid-area: stream-controls;
}

.config-section h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.config-section h4 i {
  color: var(--primary-color);
  font-size: 1rem;
}

.stream-controls {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.stream-controls .btn {
  flex: 1;
  padding: 8px 16px;
  font-size: 0.875rem;
}

.status-message {
  padding: 8px 12px;
  border-radius: var(--border-radius);
  background-color: var(--surface-color);
  border-left: 4px solid var(--primary-color);
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--text-primary);
}

/* Reduce button sizes for streaming controls */
.control-section .btn {
  padding: 6px 12px;
  font-size: 12px;
  min-width: 100px;
  height: 32px;
}

.control-section .btn i {
  margin-right: 4px;
  font-size: 11px;
}
