/* ====================================================================
   ZENTRALE SIDEBAR-STYLES - AKKORDEON-STRUKTUR MIT ICC-RECHNER v3.4
   Diese Datei wird von allen Seiten (index.html, compare.html, detail.html) geladen
   ==================================================================== */

/* ===== DESIGN TOKENS ===== */
:root {
  --sidebar-bg: #F4F5F9;
  --sidebar-surface: #FFFFFF;
  --sidebar-border: #E5E7EB;
  --sidebar-accent: #6B5CD6;
  --sidebar-accent-light: #F0EEFF;
  --sidebar-text: #2F2F33;
  --sidebar-text-muted: #6B7280;
  --sidebar-success: #2BB673;
  --sidebar-warning: #E9A043;
  --sidebar-destructive: #D6455D;
}

/* Bookmark & Compare Buttons */
.bookmark-btn, .compare-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bookmark-btn:hover, .compare-btn:hover {
  transform: scale(1.2);
}

.bookmark-btn i, .compare-btn i {
  font-size: 1rem;
  color: #6c757d;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.bookmark-btn.bookmarked i {
  color: #ffc107;
}

.compare-btn.selected i {
  color: #667eea;
}

/* Header Buttons (Detail-Seite - reine Icons, weiß) */
.header .bookmark-btn,
.header .compare-btn,
.header .icc-send-btn {
  background: none;
  border: none;
  padding: 0;
  margin-left: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.header .bookmark-btn i,
.header .compare-btn i,
.header .icc-send-btn i {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.7);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
  transition: all 0.2s;
}

.header .bookmark-btn:hover i,
.header .compare-btn:hover i,
.header .icc-send-btn:hover i {
  color: white;
  transform: scale(1.15);
}

.header .bookmark-btn.bookmarked i {
  color: #ffc107;
}

.header .compare-btn.selected i {
  color: #a8e6cf;
}

.header .icc-send-btn.active i {
  color: #a8e6cf;
}

/* Action Buttons (für detail.html) */
.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0.5rem;
  margin-left: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-btn:hover {
  transform: scale(1.2);
}

.action-btn i {
  font-size: 1.3rem;
  color: #6c757d;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.action-btn.bookmarked i {
  color: #ffc107;
}

.action-btn.selected i {
  color: #667eea;
}

/* Float Button - IMMER SICHTBAR */
.sidebar-float-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: all 0.3s;
  z-index: 1050;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.sidebar-float-btn i {
  font-size: 1.5rem;
}

.sidebar-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: #dc3545;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

/* Sidebar Panel */
.sidebar-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 420px;
  height: 100vh;
  background-color: #f8f9fa;
  box-shadow: -4px 0 12px rgba(0,0,0,0.15);
  z-index: 1051;
  transition: right 0.3s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.sidebar-panel.open {
  right: 0;
}

.sidebar-panel-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 1.5rem;
  flex-shrink: 0;
}

.sidebar-panel-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
}

/* Akkordeon Container */
.sidebar-accordion-container {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

/* Akkordeon Sections */
.accordion-section {
  background: white;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  overflow: hidden;
  border-top: 2px solid #764ba2;
}

.accordion-header {
  width: 100%;
  padding: 12px 16px;
  background: white;
  border: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.2s;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.accordion-header:hover {
  background-color: #f8f9fa;
}

.accordion-title {
  display: flex;
  align-items: center;
}

.accordion-badge {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 10px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: bold;
  margin-left: 8px;
}

.accordion-icon {
  transition: transform 0.3s;
  color: #6c757d;
}

.accordion-section.open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  background: #fafafa;
}

.accordion-section.open .accordion-content {
  max-height: 600px;
}

.accordion-body {
  padding: 12px 16px;
}

/* ===== EINHEITLICHE SIDEBAR-ELEMENTE ===== */

/* Primärer Action-Button (Gradient) */
.sidebar-action-btn {
  width: 100%;
  padding: 10px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}

.sidebar-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
}

.sidebar-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Sekundärer Button (Outline Grau) */
.sidebar-secondary-btn {
  width: auto;
  padding: 4px 10px;
  background: var(--sidebar-surface);
  color: var(--sidebar-text-muted);
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sidebar-secondary-btn:hover {
  background: var(--sidebar-bg);
  border-color: var(--sidebar-text-muted);
  color: var(--sidebar-text);
}

/* Icon-Only Button (Tertiär) */
.sidebar-icon-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  color: var(--sidebar-text-muted);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-icon-btn:hover {
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
}

.sidebar-icon-btn i {
  font-size: 14px;
}

/* Destructive Icon Button */
.sidebar-icon-btn.destructive {
  color: var(--sidebar-text-muted);
}

.sidebar-icon-btn.destructive:hover {
  background: rgba(214, 69, 93, 0.1);
  color: var(--sidebar-destructive);
}

/* Accent Icon Button */
.sidebar-icon-btn.accent {
  color: var(--sidebar-text-muted);
}

.sidebar-icon-btn.accent:hover {
  background: var(--sidebar-accent-light);
  color: var(--sidebar-accent);
}

.sidebar-icon-btn.accent.active {
  background: var(--sidebar-accent);
  color: white;
  border-radius: 6px;
  box-shadow: 0 2px 4px rgba(107, 92, 214, 0.3);
}

.sidebar-icon-btn.accent.active i {
  font-weight: bold;
}

/* Leere Nachricht */
.sidebar-empty-msg {
  text-align: center;
  color: #6c757d;
  font-size: 13px;
  padding: 16px 8px;
  margin: 0;
}

/* Hint-Text */
.sidebar-hint {
  color: #6c757d;
  font-size: 11px;
  margin: 0;
}

/* Spinner */
.sidebar-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(102, 126, 234, 0.2);
  border-top-color: #667eea;
  border-radius: 50%;
  animation: sidebar-spin 0.8s linear infinite;
}

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

/* Upload Loading State */
.upload-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px;
}

.upload-loading span {
  font-size: 12px;
  color: #667eea;
  font-weight: 500;
}

.icc-upload-zone.loading {
  pointer-events: none;
  opacity: 0.8;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

/* Labels */
.sidebar-label {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

/* Input-Row */
.sidebar-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Select */
.sidebar-select {
  padding: 6px 10px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 13px;
  background: white;
  cursor: pointer;
}

.sidebar-select:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Input Grid - feste Breite für LAB und RGB */
.sidebar-input-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.icc-input-section {
  min-height: 100px;
}

/* Feste Höhe für ICC Input Container */
#iccLabInput,
#iccRgbInput {
  min-height: 58px;
}

.sidebar-input-group {
  display: flex;
  flex-direction: column;
}

.sidebar-input-label {
  font-size: 11px;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

.sidebar-input {
  padding: 8px 10px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  font-size: 13px;
  width: 100%;
  transition: border-color 0.2s;
}

.sidebar-input:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* ===== EINHEITLICHE FARBKARTEN ===== */
.sidebar-color-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--sidebar-surface);
  border: 1px solid var(--sidebar-border);
  margin-bottom: 8px;
  transition: all 0.2s;
}

.sidebar-color-card:hover {
  border-color: var(--sidebar-accent);
  box-shadow: 0 2px 8px rgba(107, 92, 214, 0.12);
}

/* Kein farbiger Hintergrund mehr für Farben im Vergleich */

.sidebar-color-card .swatch {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

.sidebar-color-card .info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.sidebar-color-card .info .title {
  font-size: 12px;
  font-weight: 600;
  color: var(--sidebar-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-color-card .info .subtitle {
  font-size: 10px;
  color: var(--sidebar-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-color-card .actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* Legacy Support */
.sidebar-color-item {
  padding: 10px;
  border-radius: 8px;
  background: var(--sidebar-surface);
  border: 1px solid var(--sidebar-border);
  margin-bottom: 10px;
  transition: all 0.2s;
}

.sidebar-color-item:hover {
  border-color: var(--sidebar-accent);
  box-shadow: 0 2px 8px rgba(107, 92, 214, 0.12);
}

/* Kein farbiger Hintergrund mehr für Farben im Vergleich */

.sidebar-color-swatch {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--sidebar-border);
  display: block;
  flex-shrink: 0;
}

/* ICC-Rechner Styles */
.icc-upload-zone {
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  margin-bottom: 12px;
  transition: all 0.2s;
  cursor: pointer;
  background: white;
}

.icc-upload-zone:hover {
  border-color: #667eea;
  background: #f8f9ff;
}

.icc-upload-zone.dragover {
  border-color: #667eea;
  background: #e8eaff;
}

.icc-upload-zone.loaded {
  border-style: solid;
  border-color: #28a745;
  background: #f0fff4;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #6c757d;
}

.upload-placeholder i {
  font-size: 24px;
  color: #667eea;
}

.upload-placeholder span {
  font-weight: 600;
  font-size: 13px;
}

.upload-placeholder small {
  font-size: 11px;
}

.upload-loaded {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.upload-loaded span {
  font-size: 12px;
  font-weight: 500;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ICC Result */
.icc-result {
  background: white;
  border-radius: 8px;
  padding: 12px;
  border: 1px solid #dee2e6;
}

.icc-result-swatch {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  border: 2px solid #dee2e6;
  flex-shrink: 0;
}

.icc-cmyk-values {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.icc-cmyk-values span {
  background: #f0f0f0;
  padding: 2px 6px;
  border-radius: 4px;
}

.icc-gamut-info {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  color: #856404;
}

.icc-gamut-info.good {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

/* ICC Button for Detail Page */
.icc-send-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}

.icc-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

/* Footer */
.sidebar-footer {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 2px solid #e8eaf6;
  padding: 12px 16px;
  flex-shrink: 0;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
  .sidebar-panel {
    width: 100%;
    right: -100%;
  }
  
  .sidebar-panel.open {
    right: 0;
  }
  
  .sidebar-float-btn {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
  }
  
  .sidebar-float-btn i {
    font-size: 1.2rem;
  }
  
  .accordion-header {
    padding: 14px 16px;
  }
  
  .icc-upload-zone {
    padding: 20px 16px;
  }
  
  .upload-placeholder i {
    font-size: 28px;
  }
}

/* Animation für Toast */
@keyframes slideInBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideOutBottom {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(100%);
    opacity: 0;
  }
}

/* ICC History Styles */
.icc-history-list {
  max-height: 200px;
  overflow-y: auto;
  margin-top: 10px;
}

.icc-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid #e9ecef;
}

.icc-history-item:hover {
  background: #e9ecef;
}

.icc-history-swatch {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.icc-history-info {
  flex: 1;
  min-width: 0;
}

.icc-history-input {
  font-size: 0.75rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icc-history-cmyk {
  font-size: 0.8rem;
  font-weight: 600;
  color: #333;
}

/* ===== HARMONISCHE FARBPALETTEN SIDEBAR ===== */

.sidebar-palette-group {
  margin-bottom: 12px;
}

.sidebar-palette-group:last-child {
  margin-bottom: 0;
}

.sidebar-palette-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.sidebar-palette-colors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 4px;
}

.sidebar-palette-swatch {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--sidebar-border);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.sidebar-palette-swatch:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10;
}

.sidebar-palette-swatch.is-base {
  border: 2px solid var(--sidebar-accent);
  box-shadow: 0 0 0 2px var(--sidebar-accent-light);
}

/* Palette Sliders */
.sidebar-palette-sliders {
  background: var(--sidebar-bg);
  border-radius: 8px;
  padding: 12px;
}

.sidebar-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.sidebar-slider-row:last-of-type {
  margin-bottom: 0;
}

.sidebar-slider-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-text-muted);
  min-width: 65px;
}

.sidebar-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--sidebar-border);
  border-radius: 3px;
  outline: none;
}

.sidebar-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sidebar-accent);
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  transition: transform 0.15s;
}

.sidebar-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.sidebar-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--sidebar-accent);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.sidebar-slider-value {
  font-size: 11px;
  font-weight: 600;
  color: var(--sidebar-text);
  min-width: 36px;
  text-align: right;
}

.sidebar-palette-swatch::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 5px;
  opacity: 0;
  background: rgba(255,255,255,0.3);
  transition: opacity 0.2s;
}

.sidebar-palette-swatch:active::after {
  opacity: 1;
}

.sidebar-palette-swatch[title] {
  cursor: pointer;
}

#paletteContent {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 4px;
}

#paletteContent::-webkit-scrollbar {
  width: 4px;
}

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

#paletteContent::-webkit-scrollbar-thumb {
  background: var(--sidebar-border);
  border-radius: 2px;
}

#paletteContent::-webkit-scrollbar-thumb:hover {
  background: var(--sidebar-text-muted);
}

/* Palette Source Card */
#paletteSourceColor {
  margin-bottom: 16px;
  border: 2px solid var(--sidebar-accent);
  background: var(--sidebar-accent-light);
}

#paletteSourceColor .swatch {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Palette Icon Button für Farbkarten */
.palette-btn {
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  padding: 0;
  margin-left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.palette-btn:hover {
  transform: scale(1.2);
}

.palette-btn i {
  font-size: 1rem;
  color: #6c757d;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

.palette-btn.active i {
  color: var(--sidebar-accent);
}

/* Header Palette Button (Detail-Seite) */
.header .palette-btn {
  background: none;
  border: none;
  padding: 0;
  margin-left: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.header .palette-btn i {
  font-size: 1.25rem;
  color: rgba(255,255,255,0.7);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
  transition: all 0.2s;
}

.header .palette-btn:hover i {
  color: white;
  transform: scale(1.15);
}

.header .palette-btn.active i {
  color: #a8e6cf;
}

/* Copy Toast Animation */
.sidebar-palette-swatch.copied {
  animation: swatchCopied 0.3s ease;
}

@keyframes swatchCopied {
  0% { transform: scale(1); }
  50% { transform: scale(0.85); }
  100% { transform: scale(1); }
}
