* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #1e1e1e;
  color: #cccccc;
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header Bar */
.header-bar {
  background: #2d2d2d;
  border-bottom: 1px solid #1e1e1e;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14px;
  color: #ffffff;
}

.app-logo svg {
  color: #4a9eff;
}

.header-center {
  display: flex;
  gap: 10px;
}

.header-btn {
  background: #3c3c3c;
  border: 1px solid #4a4a4a;
  color: #cccccc;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.header-btn:hover:not(:disabled) {
  background: #4a4a4a;
  border-color: #5a5a5a;
}

.header-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.header-right {
  display: flex;
  align-items: center;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #888888;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4caf50;
}

.status-indicator.uploading .status-dot {
  background: #ff9800;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Workspace */
.workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* Canvas Area (Preview) */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #252525;
  border-right: 1px solid #1e1e1e;
  position: relative;
}

.canvas-header {
  background: #2d2d2d;
  padding: 12px 20px;
  border-bottom: 1px solid #1e1e1e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.canvas-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.canvas-btn {
  background: #3c3c3c;
  border: 1px solid #4a4a4a;
  color: #cccccc;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.canvas-btn:hover {
  background: #4a4a4a;
  border-color: #5a5a5a;
}

.canvas-btn:active {
  transform: scale(0.95);
}

/* Before/After Compare Button */
.canvas-btn-compare {
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #4a9eff 0%, #3a8eef 100%);
  border-color: #4a9eff;
  color: white;
  font-weight: 500;
  font-size: 13px;
}

.canvas-btn-compare:hover {
  background: linear-gradient(135deg, #3a8eef 0%, #2a7edf 100%);
  border-color: #3a8eef;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.3);
}

.canvas-btn-compare:active {
  transform: translateY(0);
}

.canvas-btn-compare.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #10b981;
}

.canvas-btn-compare.active:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border-color: #059669;
}

.canvas-btn-compare svg {
  width: 16px;
  height: 16px;
}

.zoom-level {
  min-width: 50px;
  text-align: center;
  color: #4a9eff;
  font-size: 11px;
  font-weight: 600;
}

.canvas-info {
  color: #888888;
  font-size: 11px;
  margin-left: 12px;
  padding-left: 12px;
  border-left: 1px solid #3c3c3c;
}

.canvas-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e1e1e;
  position: relative;
  overflow: hidden;
  padding: 20px;
  cursor: grab;
}

.canvas-content.panning {
  cursor: grabbing;
}

.canvas-placeholder {
  text-align: center;
  color: #666666;
}

.placeholder-icon {
  width: 100px;
  height: 100px;
  color: #3c3c3c;
  margin-bottom: 20px;
}

.canvas-placeholder p {
  font-size: 18px;
  color: #888888;
  margin-bottom: 8px;
}

.canvas-placeholder .hint {
  font-size: 13px;
  color: #666666;
}

.image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
}

#previewImage {
  display: block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s ease-out;
  transform-origin: center center;
  user-select: none;
}

/* Properties Panel */
.properties-panel {
  width: 320px;
  background: #252525;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.panel-section {
  border-bottom: 1px solid #1e1e1e;
  padding: 20px;
}

.panel-title {
  font-size: 12px;
  font-weight: 600;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 15px;
}

/* Upload Zone */
.upload-zone {
  border: 2px dashed #3c3c3c;
  border-radius: 8px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #2d2d2d;
}

.upload-zone:hover {
  border-color: #4a9eff;
  background: #2f2f2f;
}

.upload-zone.dragover {
  border-color: #4a9eff;
  background: #2a3a4a;
  transform: scale(1.02);
}

.upload-icon {
  width: 48px;
  height: 48px;
  color: #4a9eff;
  margin-bottom: 12px;
}

.upload-zone p {
  color: #888888;
  font-size: 13px;
}

/* Property List */
.property-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.property-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.property-label {
  font-size: 11px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.property-value {
  font-size: 13px;
  color: #cccccc;
  word-break: break-word;
  background: #2d2d2d;
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #3c3c3c;
  font-family: 'Courier New', monospace;
  transition: all 0.2s;
}

.property-value:hover {
  border-color: #4a4a4a;
  background: #333333;
}

/* Message */
.message {
  margin-top: 15px;
  padding: 12px;
  border-radius: 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  display: none;
}

.message.success {
  background: rgba(76, 175, 80, 0.15);
  color: #81c784;
  border: 1px solid rgba(76, 175, 80, 0.3);
  display: block;
}

.message.error {
  background: rgba(244, 67, 54, 0.15);
  color: #e57373;
  border: 1px solid rgba(244, 67, 54, 0.3);
  display: block;
}

.message.info {
  background: rgba(33, 150, 243, 0.15);
  color: #64b5f6;
  border: 1px solid rgba(33, 150, 243, 0.3);
  display: block;
}

/* Session Restore Notification */
.session-restore-notification {
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.session-restore-notification button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.session-restore-notification button:active {
  transform: translateY(0);
}

/* Adjustment Controls */
.adjustment-control {
  margin-bottom: 20px;
}

.slider-wrapper {
  position: relative;
}

.hue-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, 
    hsl(0, 100%, 50%),
    hsl(60, 100%, 50%),
    hsl(120, 100%, 50%),
    hsl(180, 100%, 50%),
    hsl(240, 100%, 50%),
    hsl(300, 100%, 50%),
    hsl(360, 100%, 50%)
  );
  pointer-events: none;
  z-index: 0;
}

.hue-slider {
  position: relative;
  z-index: 1;
  background: transparent !important;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.control-label {
  font-size: 12px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.control-value {
  font-size: 12px;
  color: #4a9eff;
  font-weight: 600;
  min-width: 40px;
  text-align: right;
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  font-family: 'Courier New', monospace;
  user-select: none;
  border: 1px solid transparent;
}

.control-value:hover {
  background: rgba(74, 158, 255, 0.15);
  border-color: rgba(74, 158, 255, 0.3);
  transform: scale(1.05);
}

.control-value:active {
  transform: scale(0.98);
}

.control-value-input {
  font-family: 'Courier New', monospace;
  outline: none;
  transition: all 0.2s;
}

.control-value-input::-webkit-inner-spin-button,
.control-value-input::-webkit-outer-spin-button {
  opacity: 0.7;
  cursor: pointer;
  margin-left: 4px;
}

.control-value-input::-webkit-inner-spin-button:hover,
.control-value-input::-webkit-outer-spin-button:hover {
  opacity: 1;
  background: rgba(74, 158, 255, 0.2);
}

.slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #2d2d2d;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4a9eff;
  cursor: pointer;
  transition: all 0.2s;
}

.slider::-webkit-slider-thumb:hover {
  background: #5ab0ff;
  transform: scale(1.1);
}

.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #4a9eff;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.slider::-moz-range-thumb:hover {
  background: #5ab0ff;
  transform: scale(1.1);
}

.reset-btn {
  width: 100%;
  background: #3c3c3c;
  border: 1px solid #4a4a4a;
  color: #cccccc;
  padding: 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  margin-top: 10px;
}

.reset-btn:hover {
  background: #4a4a4a;
  border-color: #5a5a5a;
}

.reset-btn:active {
  transform: scale(0.98);
}

.panel-reset-btn {
  width: 100%;
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  color: #888888;
  padding: 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  margin-top: 15px;
}

.panel-reset-btn:hover {
  background: #3c3c3c;
  border-color: #4a9eff;
  color: #cccccc;
}

.panel-reset-btn:active {
  transform: scale(0.98);
}

.panel-reset-btn svg {
  width: 14px;
  height: 14px;
}

/* Slider Info */
.slider-info {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10px;
  color: #666666;
}

/* Preview Comparison */
.preview-comparison {
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  padding: 15px;
  margin-top: 15px;
}

.comparison-item {
  margin-bottom: 12px;
}

.comparison-item:last-child {
  margin-bottom: 0;
}

.comparison-label {
  font-size: 10px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.comparison-bar {
  height: 30px;
  background: #1e1e1e;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid #3c3c3c;
}

.bar-fill {
  height: 100%;
  transition: all 0.3s ease;
}

/* Collapsible Panel */
.collapsible-panel {
  border-bottom: 1px solid #1e1e1e;
}

.panel-header {
  padding: 15px 20px;
  background: #2d2d2d;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #cccccc;
  transition: background 0.2s;
  user-select: none;
}

.panel-header:hover {
  background: #333333;
}

.panel-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.effect-toggle-btn {
  background: transparent;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #888;
}

.effect-toggle-btn:hover {
  background: #3a3a3a;
  border-color: #555;
}

.effect-toggle-btn.active {
  background: #007acc;
  border-color: #007acc;
  color: #fff;
}

.effect-toggle-btn.active:hover {
  background: #005a9e;
  border-color: #005a9e;
}

.effect-toggle-btn svg {
  width: 14px;
  height: 14px;
}

.panel-header .chevron {
  transition: transform 0.3s ease;
  color: #888888;
}

.panel-header.collapsed .chevron {
  transform: rotate(-90deg);
}

.panel-content {
  padding: 20px;
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.panel-content.collapsed {
  max-height: 0;
  padding: 0 20px;
}

/* Curves */
.curves-container {
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  padding: 15px;
}

.curves-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.curves-label {
  font-size: 11px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.curve-channel-select {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  color: #cccccc;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  font-family: inherit;
}

.curve-channel-select:hover {
  border-color: #4a9eff;
  background: #252525;
}

.curve-channel-select:focus {
  border-color: #4a9eff;
  background: #252525;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

.curve-channel-select option {
  background: #2d2d2d;
  color: #cccccc;
  padding: 8px;
}

#curveCanvas {
  width: 100%;
  height: auto;
  border-radius: 6px;
  cursor: crosshair;
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
}

.curves-info {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 11px;
  color: #888888;
}

.curves-info span span {
  color: #4a9eff;
  font-weight: 600;
}

.histogram-hint {
  font-size: 9px;
  color: #666666;
  font-weight: normal;
  text-transform: none;
  letter-spacing: normal;
  margin-left: 4px;
}

.curves-help {
  margin-top: 10px;
  padding: 10px;
  background: #2d2d2d;
  border-radius: 6px;
  font-size: 10px;
  color: #888888;
  line-height: 1.5;
}

/* Levels */
.levels-container {
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  padding: 15px;
}

.levels-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.levels-label {
  font-size: 11px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

#levelsCanvas {
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  margin-bottom: 15px;
}

.levels-sliders {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.levels-slider-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.levels-slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: #cccccc;
}

.levels-number-input {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  color: #4a9eff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  width: 60px;
  text-align: center;
  outline: none;
  transition: all 0.2s;
  font-family: 'Courier New', monospace;
  font-weight: 600;
}

.levels-number-input:hover {
  border-color: #4a4a4a;
  background: #252525;
}

.levels-number-input:focus {
  border-color: #4a9eff;
  background: #252525;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

.levels-number-input::-webkit-inner-spin-button,
.levels-number-input::-webkit-outer-spin-button {
  opacity: 0.7;
  cursor: pointer;
}

.levels-number-input::-webkit-inner-spin-button:hover,
.levels-number-input::-webkit-outer-spin-button:hover {
  opacity: 1;
}

.levels-shadow-slider::-webkit-slider-thumb {
  background: #000000 !important;
  border: 2px solid #4a9eff;
}

.levels-highlight-slider::-webkit-slider-thumb {
  background: #ffffff !important;
  border: 2px solid #4a9eff;
}

/* Output Levels */
.output-levels {
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  border-radius: 6px;
  padding: 12px;
}

.output-levels-bar {
  position: relative;
  height: 30px;
  margin-bottom: 10px;
}

.output-gradient {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  background: linear-gradient(to right, #000000, #ffffff);
  border-radius: 4px;
  border: 1px solid #3c3c3c;
}

.output-markers {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.output-slider {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.output-slider:first-child {
  z-index: 3;
}

.output-values {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #888888;
}

.output-values span span {
  color: #4a9eff;
  font-weight: 600;
}

/* Tone Sections */
.tone-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #3c3c3c;
}

.tone-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.tone-label {
  font-size: 12px;
  font-weight: 600;
  color: #4a9eff;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

/* Black & White */
.bw-preview {
  margin-bottom: 20px;
}

.bw-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  color: #cccccc;
}

.bw-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Vibrance Info */
.vibrance-info {
  margin-top: 15px;
  padding: 12px;
  background: #2d2d2d;
  border-radius: 6px;
  font-size: 11px;
  color: #888888;
  line-height: 1.6;
}

/* Filter & Gradient Preview */
.filter-preview,
.gradient-preview {
  margin-top: 10px;
  transition: all 0.3s ease;
}

/* History Panel */
.history-panel {
  position: fixed;
  top: 50px;
  right: 0;
  width: 320px;
  height: calc(100vh - 50px);
  background: #252525;
  border-left: 1px solid #1e1e1e;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #2d2d2d;
  border-bottom: 1px solid #1e1e1e;
}

.history-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: #cccccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.history-close {
  background: none;
  border: none;
  color: #888888;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.history-close:hover {
  background: #3c3c3c;
  color: #cccccc;
}

.history-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.history-empty {
  text-align: center;
  color: #666666;
  padding: 40px 20px;
  font-size: 13px;
}

.history-item {
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.history-item:hover {
  background: #333333;
  border-color: #4a9eff;
}

.history-item.active {
  background: #3a4a5a;
  border-color: #4a9eff;
}

.history-item.active::before {
  content: '→';
  position: absolute;
  left: -15px;
  color: #4a9eff;
  font-size: 18px;
  font-weight: bold;
}

.history-action {
  font-size: 13px;
  font-weight: 600;
  color: #cccccc;
  margin-bottom: 4px;
}

.history-details {
  font-size: 11px;
  color: #888888;
}

.history-time {
  font-size: 10px;
  color: #666666;
  margin-top: 4px;
}

.curves-presets {
  margin-top: 15px;
}

.preset-label {
  font-size: 10px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.preset-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.preset-btn {
  background: #3c3c3c;
  border: 1px solid #4a4a4a;
  color: #cccccc;
  padding: 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.preset-btn:hover {
  background: #4a4a4a;
  border-color: #4a9eff;
}

.preset-btn:active {
  transform: scale(0.98);
}

/* Color Preview Box */
.color-preview-box {
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  padding: 15px;
  margin-top: 20px;
}

.color-preview-label {
  font-size: 11px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.color-preview-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-swatch {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 2px solid #4a4a4a;
  background: linear-gradient(135deg, 
    hsl(0, 100%, 50%) 0%,
    hsl(60, 100%, 50%) 17%,
    hsl(120, 100%, 50%) 33%,
    hsl(180, 100%, 50%) 50%,
    hsl(240, 100%, 50%) 67%,
    hsl(300, 100%, 50%) 83%,
    hsl(360, 100%, 50%) 100%
  );
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.color-swatch:hover {
  border-color: #4a9eff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.3);
}

.color-swatch:active {
  transform: scale(0.95);
}

.color-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.color-label {
  font-size: 10px;
  color: #888888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-value {
  font-size: 12px;
  color: #4a9eff;
  font-family: 'Courier New', monospace;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: all 0.2s;
  user-select: none;
}

.color-value:hover {
  background: rgba(74, 158, 255, 0.15);
  border-color: rgba(74, 158, 255, 0.3);
}

.color-value-input {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #4a9eff;
  background: #1e1e1e;
  border: 1px solid #4a9eff;
  padding: 4px 6px;
  border-radius: 4px;
  outline: none;
  width: 100%;
  font-weight: 600;
}

/* Scrollbar - Global */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: #1e1e1e;
  border-radius: 6px;
}

::-webkit-scrollbar-thumb {
  background: #3c3c3c;
  border-radius: 6px;
  border: 2px solid #1e1e1e;
  transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
  background: #4a9eff;
}

::-webkit-scrollbar-thumb:active {
  background: #5ab0ff;
}

::-webkit-scrollbar-corner {
  background: #1e1e1e;
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: #3c3c3c #1e1e1e;
}

/* Specific scrollbars */
.properties-panel::-webkit-scrollbar {
  width: 10px;
}

.history-content::-webkit-scrollbar {
  width: 8px;
}

.canvas-content::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  .workspace {
    flex-direction: column;
  }

  .canvas-area {
    border-right: none;
    border-bottom: 1px solid #1e1e1e;
    min-height: 300px;
  }

  .properties-panel {
    width: 100%;
    max-height: 50vh;
  }

  .header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }
}

/* Input fields - Global styling */
input[type="number"],
input[type="text"],
input[type="range"],
select,
textarea {
  font-family: inherit;
}

input[type="number"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #4a9eff;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

/* Checkbox styling */
input[type="checkbox"] {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #3c3c3c;
  border-radius: 4px;
  background: #1e1e1e;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
}

input[type="checkbox"]:hover {
  border-color: #4a9eff;
  background: #252525;
}

input[type="checkbox"]:checked {
  background: #4a9eff;
  border-color: #4a9eff;
}

input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
}

input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.2);
}

/* Number input arrows styling */
input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
  opacity: 0;
  width: 16px;
  height: 100%;
  position: absolute;
  right: 0;
  cursor: pointer;
}

input[type="number"]:hover::-webkit-inner-spin-button,
input[type="number"]:hover::-webkit-outer-spin-button {
  opacity: 0.7;
}

input[type="number"]::-webkit-inner-spin-button:hover,
input[type="number"]::-webkit-outer-spin-button:hover {
  opacity: 1;
}

/* Smooth transitions for all interactive elements */
button,
input,
select,
.slider,
.control-value,
.panel-header {
  transition: all 0.2s ease;
}

/* Color Picker Popup */
.color-picker-popup {
  position: fixed;
  background: #2d2d2d;
  border: 1px solid #4a4a4a;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  z-index: 10000;
  min-width: 280px;
  animation: popupFadeIn 0.2s ease;
}

@keyframes popupFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.color-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.color-picker-title {
  font-size: 13px;
  font-weight: 600;
  color: #cccccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-picker-close {
  background: none;
  border: none;
  color: #888888;
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.color-picker-close:hover {
  background: #3c3c3c;
  color: #cccccc;
}

.color-picker-canvas-container {
  position: relative;
  margin-bottom: 15px;
}

.color-picker-canvas {
  width: 240px;
  height: 240px;
  border-radius: 8px;
  cursor: crosshair;
  border: 1px solid #3c3c3c;
}

.color-picker-cursor {
  position: absolute;
  width: 12px;
  height: 12px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  transform: translate(-50%, -50%);
}

.color-picker-hue-slider {
  width: 100%;
  height: 20px;
  border-radius: 10px;
  background: linear-gradient(to right,
    hsl(0, 100%, 50%),
    hsl(60, 100%, 50%),
    hsl(120, 100%, 50%),
    hsl(180, 100%, 50%),
    hsl(240, 100%, 50%),
    hsl(300, 100%, 50%),
    hsl(360, 100%, 50%)
  );
  margin-bottom: 15px;
  cursor: pointer;
  border: 1px solid #3c3c3c;
  position: relative;
}

.color-picker-hue-cursor {
  position: absolute;
  width: 4px;
  height: 24px;
  background: #ffffff;
  border: 1px solid #000000;
  border-radius: 2px;
  top: -2px;
  pointer-events: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.color-picker-preview {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.color-picker-preview-box {
  flex: 1;
  height: 50px;
  border-radius: 6px;
  border: 1px solid #3c3c3c;
}

.color-picker-inputs {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-picker-input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-picker-input-label {
  font-size: 11px;
  color: #888888;
  width: 40px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.color-picker-input {
  flex: 1;
  background: #1e1e1e;
  border: 1px solid #3c3c3c;
  color: #cccccc;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-family: 'Courier New', monospace;
  outline: none;
  transition: all 0.2s;
}

.color-picker-input:hover {
  border-color: #4a4a4a;
  background: #252525;
}

.color-picker-input:focus {
  border-color: #4a9eff;
  background: #252525;
  box-shadow: 0 0 0 2px rgba(74, 158, 255, 0.1);
}

.color-picker-buttons {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.color-picker-btn {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #3c3c3c;
}

.color-picker-btn-apply {
  background: #4a9eff;
  color: #ffffff;
  border-color: #4a9eff;
}

.color-picker-btn-apply:hover {
  background: #5ab0ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(74, 158, 255, 0.3);
}

.color-picker-btn-cancel {
  background: #3c3c3c;
  color: #cccccc;
}

.color-picker-btn-cancel:hover {
  background: #4a4a4a;
}

/* Panel Tabs */
.panel-tabs {
  display: flex;
  background: #2d2d2d;
  border-bottom: 1px solid #1e1e1e;
  padding: 0;
  gap: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.panel-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: #888888;
  padding: 12px 8px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-tab:hover {
  background: #333333;
  color: #cccccc;
}

.panel-tab.active {
  color: #4a9eff;
  border-bottom-color: #4a9eff;
  background: #252525;
}

.panel-tab svg {
  flex-shrink: 0;
}

/* Tab Content */
.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.tab-content.active {
  display: block;
}

/* Panel Footer */
.panel-footer {
  position: sticky;
  bottom: 0;
  background: #2d2d2d;
  border-top: 1px solid #1e1e1e;
  padding: 15px 20px;
  z-index: 100;
}

.panel-footer .reset-btn {
  margin-top: 0;
}

/* Effects Info */
.effects-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.effects-info svg {
  opacity: 0.5;
}

.effects-info p {
  max-width: 250px;
}

/* Adjust properties panel layout */
.properties-panel {
  display: flex;
  flex-direction: column;
}

/* Right Panels Container */
.right-panels {
  width: 320px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

/* Properties Panel - Top */
.properties-panel {
  flex: 1;
  min-height: 0;
  border-bottom: 1px solid #1e1e1e;
}

/* Features Panel - Bottom */
.features-panel {
  height: 250px;
  background: #252525;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.features-header {
  background: #2d2d2d;
  border-bottom: 1px solid #1e1e1e;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.features-title {
  font-size: 12px;
  font-weight: 600;
  color: #cccccc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.features-toggle {
  background: none;
  border: none;
  color: #888888;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.features-toggle:hover {
  background: #3c3c3c;
  color: #cccccc;
}

.features-toggle svg {
  transition: transform 0.3s;
}

.features-toggle.collapsed svg {
  transform: rotate(180deg);
}

.features-content {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
}

.features-panel.collapsed {
  height: 44px;
}

.features-panel.collapsed .features-content {
  display: none;
}

/* Feature Items */
.feature-item {
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-item:hover {
  background: #333333;
  border-color: #4a9eff;
  transform: translateX(2px);
}

.feature-item:active {
  transform: scale(0.98);
}

.feature-icon {
  width: 36px;
  height: 36px;
  background: #1e1e1e;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #4a9eff;
}

.feature-info {
  flex: 1;
  min-width: 0;
}

.feature-name {
  font-size: 13px;
  font-weight: 600;
  color: #cccccc;
  margin-bottom: 2px;
}

.feature-desc {
  font-size: 11px;
  color: #888888;
  line-height: 1.4;
}

/* Resize Handle */
.resize-handle {
  height: 4px;
  background: #1e1e1e;
  cursor: ns-resize;
  position: relative;
  transition: background 0.2s;
}

.resize-handle:hover {
  background: #4a9eff;
}

.resize-handle::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 8px;
  background: transparent;
}

/* Background Removal Feature */
.feature-instructions {
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.instruction-step {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #cccccc;
  line-height: 1.5;
}

.instruction-step:last-child {
  margin-bottom: 0;
}

.step-number {
  width: 24px;
  height: 24px;
  background: #4a9eff;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.step-text {
  flex: 1;
  padding-top: 3px;
}

.step-text strong {
  color: #4a9eff;
  font-weight: 700;
  background: rgba(74, 158, 255, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(74, 158, 255, 0.3);
}

.feature-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 15px;
}

.feature-buttons .feature-btn-primary {
  grid-column: 1 / -1;
}

.feature-btn {
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
  border: none;
}

.feature-btn-primary {
  background: #4a9eff;
  color: #ffffff;
}

.feature-btn-primary:hover {
  background: #5ab0ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(74, 158, 255, 0.3);
}

.feature-btn-secondary {
  background: #3c3c3c;
  color: #cccccc;
  border: 1px solid #4a4a4a;
}

.feature-btn-secondary:hover {
  background: #4a4a4a;
}

.selection-info {
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 6px;
  padding: 12px;
}

.info-item {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-label {
  color: #888888;
}

.info-value {
  color: #4a9eff;
  font-weight: 600;
}

/* Selection Markers on Canvas */
.selection-marker {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  z-index: 100;
  animation: markerPulse 1s infinite;
}

.selection-marker.foreground {
  background: #00ff00;
  border-color: #00ff00;
}

.selection-marker.background {
  background: #ff0000;
  border-color: #ff0000;
}

@keyframes markerPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.8;
  }
}

/* Batch Gallery */
.batch-gallery {
  background: #1a1a1a;
  border-top: 1px solid #2d2d2d;
  padding: 12px;
  max-height: 180px;
  display: flex;
  flex-direction: column;
}

.batch-gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #2d2d2d;
}

.batch-title {
  font-size: 11px;
  font-weight: 700;
  color: #888;
  letter-spacing: 0.5px;
}

.batch-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.batch-btn {
  background: #2d2d2d;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 6px 10px;
  color: #ccc;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
}

.batch-btn:hover {
  background: #3a3a3a;
  border-color: #4a4a4a;
}

.batch-btn svg {
  width: 16px;
  height: 16px;
}

.batch-btn-primary {
  background: #007acc;
  border-color: #007acc;
  color: white;
}

.batch-btn-primary:hover {
  background: #005a9e;
  border-color: #005a9e;
}

.batch-btn-danger {
  background: #d32f2f;
  border-color: #d32f2f;
  color: white;
}

.batch-btn-danger:hover {
  background: #b71c1c;
  border-color: #b71c1c;
}

.batch-counter {
  font-size: 12px;
  color: #888;
  padding: 0 8px;
  font-weight: 600;
}

.batch-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 0;
}

.batch-thumbnails::-webkit-scrollbar {
  height: 6px;
}

.batch-thumbnails::-webkit-scrollbar-track {
  background: #1a1a1a;
}

.batch-thumbnails::-webkit-scrollbar-thumb {
  background: #3a3a3a;
  border-radius: 3px;
}

.batch-thumbnails::-webkit-scrollbar-thumb:hover {
  background: #4a4a4a;
}

.batch-thumbnail {
  position: relative;
  width: 120px;
  height: 90px;
  flex-shrink: 0;
  border: 2px solid #2d2d2d;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.batch-thumbnail:hover {
  border-color: #4a4a4a;
  transform: translateY(-2px);
}

.batch-thumbnail.active {
  border-color: #007acc;
  box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.3);
}

.batch-thumbnail.processed::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: #4caf50;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
}

.batch-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.batch-thumb-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.batch-thumb-name {
  font-size: 10px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.batch-thumb-check {
  font-size: 14px;
  color: #4caf50;
  font-weight: bold;
}

.batch-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  background: rgba(211, 47, 47, 0.9);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.batch-thumbnail:hover .batch-thumb-remove {
  display: flex;
}

.batch-thumb-remove:hover {
  background: #b71c1c;
  transform: scale(1.1);
}

/* Batch Context Menu */
.batch-context-menu {
  position: fixed;
  background: #2d2d2d;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  min-width: 220px;
  max-width: 280px;
  padding: 4px 0;
  animation: contextMenuFadeIn 0.15s ease;
  visibility: visible;
}

@keyframes contextMenuFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.batch-context-menu-item {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: #ccc;
  font-size: 13px;
  transition: all 0.2s;
}

.batch-context-menu-item:hover {
  background: #3a3a3a;
  color: #fff;
}

.batch-context-menu-item .menu-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* Batch Selection Modal */
.batch-selection-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.batch-selection-content {
  background: #1e1e1e;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.batch-selection-header {
  padding: 20px;
  border-bottom: 1px solid #2d2d2d;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.batch-selection-header h3 {
  margin: 0;
  font-size: 18px;
  color: #fff;
  font-weight: 600;
}

.batch-selection-close {
  background: none;
  border: none;
  color: #888;
  font-size: 28px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.batch-selection-close:hover {
  background: #3a3a3a;
  color: #fff;
}

.batch-selection-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.batch-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

.batch-selection-item {
  position: relative;
}

.batch-selection-item input[type="checkbox"] {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 2;
  accent-color: #007acc;
}

.batch-selection-item label {
  display: block;
  cursor: pointer;
  border: 2px solid #2d2d2d;
  border-radius: 6px;
  overflow: hidden;
  transition: all 0.2s;
  position: relative;
}

.batch-selection-item input[type="checkbox"]:checked + label {
  border-color: #007acc;
  box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.3);
}

.batch-selection-item label:hover {
  border-color: #4a4a4a;
  transform: translateY(-2px);
}

.batch-selection-item img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.selection-name {
  display: block;
  padding: 8px;
  font-size: 11px;
  color: #ccc;
  background: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selection-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #4caf50;
  color: white;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.batch-selection-footer {
  padding: 15px 20px;
  border-top: 1px solid #2d2d2d;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.batch-selection-footer .batch-btn {
  margin: 0;
}

/* Header Dropdown Menus */
.header-dropdown {
  position: relative;
  display: inline-block;
}

.header-btn-primary {
  background: #007acc;
  color: white;
}

.header-btn-primary:hover {
  background: #005a9e;
}

.header-btn-success {
  background: #4caf50;
  color: white;
}

.header-btn-success:hover {
  background: #45a049;
}

.dropdown-arrow {
  margin-left: 4px;
  transition: transform 0.2s;
}

.header-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.header-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: #2d2d2d;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  min-width: 220px;
  padding: 6px 0;
  z-index: 1000;
  display: none;
  animation: dropdownFadeIn 0.2s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.header-dropdown.active .header-dropdown-menu {
  display: block;
}

.dropdown-item {
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: #ccc;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.dropdown-item:hover:not(:disabled) {
  background: #3a3a3a;
  color: #fff;
}

.dropdown-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dropdown-item svg {
  flex-shrink: 0;
}

.dropdown-shortcut {
  margin-left: auto;
  font-size: 11px;
  color: #888;
  padding-left: 20px;
}

.dropdown-divider {
  height: 1px;
  background: #3a3a3a;
  margin: 6px 0;
}

/* Adjust header center spacing */
.header-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Canvas Toolbar */
.canvas-toolbar {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.canvas-tool-btn {
  width: 40px;
  height: 40px;
  background: #3c3c3c;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  color: #cccccc;
  position: relative;
}

.canvas-tool-btn:hover {
  background: #4a4a4a;
  border-color: #5a5a5a;
}

.canvas-tool-btn.active {
  background: #4a9eff;
  border-color: #4a9eff;
  color: #ffffff;
}

.canvas-tool-btn svg {
  width: 20px;
  height: 20px;
}

.tool-separator {
  height: 1px;
  background: #3c3c3c;
  margin: 4px 0;
}

/* Tool Options Panel */
.tool-options-panel {
  position: absolute;
  left: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #2d2d2d;
  border: 1px solid #3c3c3c;
  border-radius: 8px;
  padding: 16px;
  min-width: 200px;
  z-index: 99;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: none;
}

.tool-options-panel.show {
  display: block;
}

.tool-option-group {
  margin-bottom: 16px;
}

.tool-option-group:last-child {
  margin-bottom: 0;
}

.tool-option-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #888888;
}

.tool-option-value {
  color: #cccccc;
  font-weight: 500;
}

.tool-option-slider {
  width: 100%;
  height: 4px;
  background: #3c3c3c;
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
}

.tool-option-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: #4a9eff;
  border-radius: 50%;
  cursor: pointer;
}

.tool-option-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: #4a9eff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

.tool-color-picker {
  width: 100%;
  height: 32px;
  border: 1px solid #4a4a4a;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

.tool-color-picker::-webkit-color-swatch-wrapper {
  padding: 2px;
}

.tool-color-picker::-webkit-color-swatch {
  border: none;
  border-radius: 2px;
}

/* Tooltip for tools */
.canvas-tool-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 12px;
  background: #1e1e1e;
  color: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 1000;
}

.canvas-tool-btn:hover::after {
  opacity: 1;
}

/* Tool Options Panel Variants */
.tool-option-title {
  font-size: 13px;
  font-weight: 600;
  color: #cccccc;
  margin-bottom: 8px;
}

.tool-option-description {
  font-size: 11px;
  color: #888888;
  margin-bottom: 16px;
  line-height: 1.4;
}

.tool-option-info {
  font-size: 10px;
  color: #666666;
  background: #1e1e1e;
  padding: 8px;
  border-radius: 4px;
  margin-top: 12px;
  line-height: 1.4;
}

/* Patch Tool Cursor */
.canvas-content.patch-cursor {
  cursor: crosshair;
}

.patch-preview-circle {
  position: absolute;
  border: 2px solid #4a9eff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}

.patch-selection-circle {
  position: absolute;
  border: 2px dashed #ffaa00;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1001;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
  animation: marchingAnts 0.5s linear infinite;
}

@keyframes marchingAnts {
  0% {
    border-offset: 0;
  }
  100% {
    border-offset: 8px;
  }
}

/* Brush Tool Cursor */
.canvas-content.brush-cursor {
  cursor: none;
}

.brush-cursor-circle {
  position: absolute;
  border: 2px solid #ffffff;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8);
  mix-blend-mode: difference;
}

#brushCanvas {
  image-rendering: auto;
}


/* ============================================
   VOICE CONTROL STYLES - REDESIGNED
   ============================================ */

/* Voice Control Button */
#voiceControlBtn {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

#voiceControlBtn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 68, 68, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

#voiceControlBtn.listening {
  background: linear-gradient(135deg, #ff4444 0%, #ff6b6b 100%);
  border-color: #ff4444;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(255, 68, 68, 0.4);
  animation: voicePulse 2s ease-in-out infinite;
}

#voiceControlBtn.listening::before {
  width: 300px;
  height: 300px;
  animation: ripple 1.5s ease-out infinite;
}

@keyframes voicePulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(255, 68, 68, 0.4), 0 0 0 0 rgba(255, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 4px 30px rgba(255, 68, 68, 0.6), 0 0 0 15px rgba(255, 68, 68, 0);
  }
}

@keyframes ripple {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* Voice Indicator - Modern Design */
.voice-indicator {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(255, 68, 68, 0.98) 0%, rgba(255, 107, 107, 0.98) 100%);
  color: #ffffff;
  padding: 18px 35px;
  border-radius: 60px;
  display: flex;
  align-items: center;
  gap: 18px;
  z-index: 1000;
  box-shadow: 
    0 10px 40px rgba(255, 68, 68, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  animation: slideDownBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  backdrop-filter: blur(20px) saturate(180%);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideDownBounce {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px) scale(0.8);
  }
  60% {
    transform: translateX(-50%) translateY(5px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.voice-wave {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
}

.voice-wave span {
  width: 4px;
  height: 8px;
  background: #ffffff;
  border-radius: 4px;
  animation: waveAnimation 1.2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.voice-wave span:nth-child(1) { animation-delay: 0s; }
.voice-wave span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave span:nth-child(4) { animation-delay: 0.3s; }
.voice-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes waveAnimation {
  0%, 100% {
    height: 8px;
    opacity: 0.4;
  }
  50% {
    height: 28px;
    opacity: 1;
  }
}

.voice-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Voice Transcript - Modern Glass Design */
.voice-transcript {
  position: absolute;
  top: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.95) 0%, rgba(90, 176, 255, 0.95) 100%);
  color: #ffffff;
  padding: 20px 40px;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 600;
  z-index: 1001;
  box-shadow: 
    0 8px 32px rgba(74, 158, 255, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  animation: transcriptFadeIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  backdrop-filter: blur(20px) saturate(180%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  max-width: 85%;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: 0.3px;
  line-height: 1.5;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes transcriptFadeIn {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-30px) scale(0.9);
  }
  60% {
    transform: translateX(-50%) translateY(5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.voice-transcript.listening {
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.95) 0%, rgba(90, 176, 255, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.3);
}

.voice-transcript.interim {
  background: linear-gradient(135deg, rgba(255, 152, 0, 0.95) 0%, rgba(255, 183, 77, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.3);
  animation: transcriptPulse 1.5s ease-in-out infinite;
}

.voice-transcript.final {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.95) 0%, rgba(129, 199, 132, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.3);
  animation: transcriptSuccess 0.6s ease;
}

@keyframes transcriptPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    box-shadow: 0 8px 32px rgba(255, 152, 0, 0.5);
  }
  50% {
    transform: translateX(-50%) scale(1.03);
    box-shadow: 0 12px 40px rgba(255, 152, 0, 0.7);
  }
}

@keyframes transcriptSuccess {
  0% {
    transform: translateX(-50%) scale(1);
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    transform: translateX(-50%) scale(1);
  }
}

/* Voice Feedback - Toast Style */
.voice-feedback {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.98) 0%, rgba(60, 60, 60, 0.98) 100%);
  color: #ffffff;
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  z-index: 1000;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  animation: feedbackSlideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  backdrop-filter: blur(20px) saturate(180%);
  border: 2px solid rgba(255, 255, 255, 0.15);
  max-width: 85%;
  text-align: center;
  letter-spacing: 0.3px;
}

@keyframes feedbackSlideUp {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(30px) scale(0.9);
  }
  60% {
    transform: translateX(-50%) translateY(-5px) scale(1.02);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.voice-feedback.success {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.95) 0%, rgba(129, 199, 132, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 8px 32px rgba(76, 175, 80, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  animation: feedbackSlideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), successGlow 2s ease-in-out;
}

.voice-feedback.error {
  background: linear-gradient(135deg, rgba(244, 67, 54, 0.95) 0%, rgba(229, 115, 115, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 8px 32px rgba(244, 67, 54, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  animation: feedbackSlideUp 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55), errorShake 0.5s ease;
}

.voice-feedback.info {
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.95) 0%, rgba(100, 181, 246, 0.95) 100%);
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 8px 32px rgba(74, 158, 255, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

@keyframes successGlow {
  0%, 100% {
    box-shadow: 
      0 8px 32px rgba(76, 175, 80, 0.6),
      0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  }
  50% {
    box-shadow: 
      0 12px 40px rgba(76, 175, 80, 0.8),
      0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  }
}

@keyframes errorShake {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-50%) translateY(0) translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(-50%) translateY(0) translateX(5px); }
}

/* Voice Control Help Panel - Modern Card Design */
.voice-help-panel {
  position: absolute;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(45, 45, 45, 0.98) 100%);
  border: 2px solid rgba(74, 158, 255, 0.3);
  border-radius: 16px;
  padding: 24px;
  max-width: 380px;
  z-index: 999;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  backdrop-filter: blur(20px) saturate(180%);
  animation: panelSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes panelSlideIn {
  0% {
    opacity: 0;
    transform: translateX(30px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.voice-help-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid rgba(74, 158, 255, 0.2);
}

.voice-help-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: 0.3px;
}

.voice-help-title svg {
  color: #4a9eff;
  filter: drop-shadow(0 0 8px rgba(74, 158, 255, 0.5));
}

.voice-help-close {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #888888;
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.voice-help-close:hover {
  background: rgba(244, 67, 54, 0.2);
  border-color: rgba(244, 67, 54, 0.4);
  color: #ff6b6b;
  transform: rotate(90deg);
}

.voice-help-content {
  font-size: 13px;
  color: #cccccc;
  line-height: 1.7;
}

.voice-command-list {
  list-style: none;
  padding: 0;
  margin: 15px 0;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.voice-command-list::-webkit-scrollbar {
  width: 6px;
}

.voice-command-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.voice-command-list::-webkit-scrollbar-thumb {
  background: rgba(74, 158, 255, 0.3);
  border-radius: 3px;
}

.voice-command-list::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 158, 255, 0.5);
}

.voice-command-list li {
  padding: 12px 16px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.6) 0%, rgba(60, 60, 60, 0.4) 100%);
  border-radius: 10px;
  border-left: 4px solid #4a9eff;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.voice-command-list li::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, rgba(74, 158, 255, 0.1) 0%, transparent 100%);
  transition: width 0.3s ease;
}

.voice-command-list li:hover {
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.15) 0%, rgba(90, 176, 255, 0.1) 100%);
  transform: translateX(6px);
  border-left-color: #5ab0ff;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}

.voice-command-list li:hover::before {
  width: 100%;
}

.voice-command-list li strong {
  color: #4a9eff;
  font-weight: 700;
  text-shadow: 0 0 10px rgba(74, 158, 255, 0.3);
}

.voice-help-tip {
  margin-top: 20px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.15) 0%, rgba(90, 176, 255, 0.1) 100%);
  border: 2px solid rgba(74, 158, 255, 0.3);
  border-radius: 12px;
  font-size: 12px;
  color: #64b5f6;
  line-height: 1.6;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.1);
}

.voice-help-tip strong {
  color: #5ab0ff;
  font-weight: 700;
}

.voice-help-tip kbd {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments for voice control */
@media (max-width: 768px) {
  .voice-indicator {
    padding: 12px 20px;
    font-size: 12px;
  }

  .voice-feedback {
    font-size: 12px;
    padding: 10px 20px;
    max-width: 90%;
  }

  .voice-help-panel {
    right: 10px;
    left: 10px;
    max-width: none;
  }
}


/* Voice Control Settings Panel - Premium Design */
.voice-settings-panel {
  position: absolute;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(45, 45, 45, 0.98) 100%);
  border: 2px solid rgba(74, 158, 255, 0.3);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  z-index: 999;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  backdrop-filter: blur(20px) saturate(180%);
  animation: panelSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.voice-settings-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.voice-settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.voice-settings-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.voice-settings-label svg {
  color: #4a9eff;
  filter: drop-shadow(0 0 8px rgba(74, 158, 255, 0.5));
}

.voice-device-select {
  width: 100%;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.8) 0%, rgba(45, 45, 45, 0.8) 100%);
  border: 2px solid rgba(74, 158, 255, 0.2);
  color: #ffffff;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-weight: 500;
}

.voice-device-select:hover {
  border-color: #4a9eff;
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.9) 0%, rgba(60, 60, 60, 0.9) 100%);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}

.voice-device-select:focus {
  border-color: #4a9eff;
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.9) 0%, rgba(60, 60, 60, 0.9) 100%);
  box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.15);
}

.voice-device-select option {
  background: #2d2d2d;
  color: #ffffff;
  padding: 12px;
}

.voice-settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.voice-settings-btn {
  flex: 1;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.2) 0%, rgba(90, 176, 255, 0.15) 100%);
  border: 2px solid rgba(74, 158, 255, 0.3);
  color: #4a9eff;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.voice-settings-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(74, 158, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.voice-settings-btn:hover {
  background: linear-gradient(135deg, #4a9eff 0%, #5ab0ff 100%);
  border-color: #4a9eff;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 158, 255, 0.4);
}

.voice-settings-btn:hover::before {
  width: 300px;
  height: 300px;
}

.voice-settings-btn:active {
  transform: translateY(0);
}

.voice-settings-btn svg {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 0 4px currentColor);
}

/* Microphone Test Indicator - Modern */
.mic-test-container {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.6) 0%, rgba(60, 60, 60, 0.4) 100%);
  border-radius: 12px;
  border: 2px solid rgba(74, 158, 255, 0.2);
}

.mic-test-label {
  font-size: 12px;
  color: #4a9eff;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.mic-test-bar {
  width: 100%;
  height: 24px;
  background: rgba(30, 30, 30, 0.8);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(74, 158, 255, 0.2);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.mic-test-level {
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(74, 158, 255, 0.8) 0%, 
    rgba(76, 175, 80, 0.8) 50%, 
    rgba(255, 152, 0, 0.8) 100%);
  width: 0%;
  transition: width 0.1s ease;
  border-radius: 10px;
  box-shadow: 
    0 0 20px rgba(74, 158, 255, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  position: relative;
}

.mic-test-level::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Settings button highlight */
#voiceSettingsBtn {
  position: relative;
}

#voiceSettingsBtn:hover {
  background: #4a4a4a;
  border-color: #4a9eff;
}

#voiceSettingsBtn.has-settings {
  border-color: #4a9eff;
}

#voiceSettingsBtn.has-settings::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: #4a9eff;
  border-radius: 50%;
  animation: settingsPulse 2s infinite;
}

@keyframes settingsPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Responsive adjustments for settings */
@media (max-width: 768px) {
  .voice-settings-panel {
    right: 10px;
    left: 10px;
    max-width: none;
  }

  .voice-settings-actions {
    flex-direction: column;
  }

  .voice-settings-btn {
    width: 100%;
  }
}


/* Wake Word Indicator - Floating Badge */
.wake-word-indicator {
  position: absolute;
  bottom: 30px;
  right: 30px;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.95) 0%, rgba(90, 176, 255, 0.95) 100%);
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 998;
  box-shadow: 
    0 8px 32px rgba(74, 158, 255, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  backdrop-filter: blur(20px) saturate(180%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  animation: wakeWordFloat 3s ease-in-out infinite;
}

@keyframes wakeWordFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

.wake-word-indicator svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
  animation: wakeWordPulse 2s ease-in-out infinite;
}

@keyframes wakeWordPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.wake-word-indicator span {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Voice Mode Info */
.voice-mode-info {
  padding: 12px;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.1) 0%, rgba(90, 176, 255, 0.05) 100%);
  border: 1px solid rgba(74, 158, 255, 0.2);
  border-radius: 8px;
  font-size: 11px;
  color: #64b5f6;
  line-height: 1.5;
}

/* Settings button highlight */
#voiceSettingsBtn {
  position: relative;
}

#voiceSettingsBtn:hover {
  background: #4a4a4a;
  border-color: #4a9eff;
}

#voiceSettingsBtn.has-settings {
  border-color: #4a9eff;
}

#voiceSettingsBtn.has-settings::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background: #4a9eff;
  border-radius: 50%;
  animation: settingsPulse 2s infinite;
}

@keyframes settingsPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

/* Voice Control Settings Panel - Premium Design */
.voice-settings-panel {
  position: absolute;
  top: 80px;
  right: 20px;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.98) 0%, rgba(45, 45, 45, 0.98) 100%);
  border: 2px solid rgba(74, 158, 255, 0.3);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  z-index: 999;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  backdrop-filter: blur(20px) saturate(180%);
  animation: panelSlideIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.voice-settings-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.voice-settings-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.voice-settings-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.voice-settings-label svg {
  color: #4a9eff;
  filter: drop-shadow(0 0 8px rgba(74, 158, 255, 0.5));
}

.voice-device-select {
  width: 100%;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.8) 0%, rgba(45, 45, 45, 0.8) 100%);
  border: 2px solid rgba(74, 158, 255, 0.2);
  color: #ffffff;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
  font-weight: 500;
}

.voice-device-select:hover {
  border-color: #4a9eff;
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.9) 0%, rgba(60, 60, 60, 0.9) 100%);
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
}

.voice-device-select:focus {
  border-color: #4a9eff;
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.9) 0%, rgba(60, 60, 60, 0.9) 100%);
  box-shadow: 0 0 0 4px rgba(74, 158, 255, 0.15);
}

.voice-device-select option {
  background: #2d2d2d;
  color: #ffffff;
  padding: 12px;
}

.voice-settings-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.voice-settings-btn {
  flex: 1;
  background: linear-gradient(135deg, rgba(74, 158, 255, 0.2) 0%, rgba(90, 176, 255, 0.15) 100%);
  border: 2px solid rgba(74, 158, 255, 0.3);
  color: #4a9eff;
  padding: 12px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.voice-settings-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(74, 158, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.voice-settings-btn:hover {
  background: linear-gradient(135deg, #4a9eff 0%, #5ab0ff 100%);
  border-color: #4a9eff;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(74, 158, 255, 0.4);
}

.voice-settings-btn:hover::before {
  width: 300px;
  height: 300px;
}

.voice-settings-btn:active {
  transform: translateY(0);
}

.voice-settings-btn svg {
  width: 16px;
  height: 16px;
  filter: drop-shadow(0 0 4px currentColor);
}

/* Microphone Test Indicator - Modern */
.mic-test-container {
  margin-top: 20px;
  padding: 20px;
  background: linear-gradient(135deg, rgba(45, 45, 45, 0.6) 0%, rgba(60, 60, 60, 0.4) 100%);
  border-radius: 12px;
  border: 2px solid rgba(74, 158, 255, 0.2);
}

.mic-test-label {
  font-size: 12px;
  color: #4a9eff;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.mic-test-bar {
  width: 100%;
  height: 24px;
  background: rgba(30, 30, 30, 0.8);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(74, 158, 255, 0.2);
  position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.mic-test-level {
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(74, 158, 255, 0.8) 0%, 
    rgba(76, 175, 80, 0.8) 50%, 
    rgba(255, 152, 0, 0.8) 100%);
  width: 0%;
  transition: width 0.1s ease;
  border-radius: 10px;
  box-shadow: 
    0 0 20px rgba(74, 158, 255, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.2) inset;
  position: relative;
}

.mic-test-level::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.3) 50%, 
    transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Responsive adjustments for voice control */
@media (max-width: 768px) {
  .voice-indicator {
    padding: 14px 25px;
    font-size: 13px;
    gap: 12px;
  }

  .voice-wave {
    height: 24px;
  }

  .voice-transcript {
    padding: 16px 30px;
    font-size: 16px;
    max-width: 90%;
  }

  .voice-feedback {
    font-size: 13px;
    padding: 12px 24px;
    max-width: 90%;
  }

  .voice-help-panel,
  .voice-settings-panel {
    right: 10px;
    left: 10px;
    max-width: none;
    top: 70px;
  }

  .wake-word-indicator {
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    font-size: 12px;
  }
}

/* Additional polish for voice UI */
.voice-help-panel,
.voice-settings-panel {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.voice-help-panel::-webkit-scrollbar,
.voice-settings-panel::-webkit-scrollbar {
  width: 8px;
}

.voice-help-panel::-webkit-scrollbar-track,
.voice-settings-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.voice-help-panel::-webkit-scrollbar-thumb,
.voice-settings-panel::-webkit-scrollbar-thumb {
  background: rgba(74, 158, 255, 0.3);
  border-radius: 4px;
}

.voice-help-panel::-webkit-scrollbar-thumb:hover,
.voice-settings-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(74, 158, 255, 0.5);
}
