/* ===========================================
   CHROMA.MAL+ Tools Styles
   Consolidated CSS for all tools
   =========================================== */

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

/* ===== VIEW TRANSITIONS ===== */
#welcome-section,
#tools-container {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#welcome-section.hidden,
#tools-container.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}

/* Tool panel transitions */
.tool-panel {
  display: none;
}

.tool-panel.active {
  display: block;
  animation: fadeInUp 0.25s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-panel.active {
    animation: none;
  }
  #welcome-section,
  #tools-container {
    transition: none;
  }
}

/* Category cards keyboard focus */
.welcome-category-card:focus {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 120, 0, 0.3);
}

/* ===== SHARED: ENHANCED COLOR CARDS ===== */
/* Reusable color card component with hex, star, and temperature badge */
.color-card {
  position: relative;
  border-radius: 8px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 90px;
}

.color-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.color-card-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  opacity: 0.8;
}

.color-card-hex {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
}

.color-card-detail {
  font-size: 0.6rem;
  opacity: 0.7;
}

.color-card-temp {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.65;
  margin-top: 2px;
}

.color-card-temp i {
  width: 10px;
  height: 10px;
}

.color-card-fav {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: 0.5;
  transition: opacity 0.2s, transform 0.2s;
  line-height: 0;
}

.color-card-fav:hover {
  opacity: 1;
  transform: scale(1.2);
}

.color-card-fav i {
  width: 14px;
  height: 14px;
}

/* Large variant for hero/preview blocks */
.color-card-large {
  min-height: 120px;
  padding: 24px 16px;
}

.color-card-large .color-card-hex {
  font-size: 0.9rem;
}

.color-card-large .color-card-label {
  font-size: 0.8rem;
}

/* Grid layout for color card collections */
.color-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

/* ===== TINT, SHADE & TONE ===== */
.tst-section {
  margin-bottom: 24px;
}

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

.tst-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 6px;
}

.tst-section h4 i {
  width: 16px;
  height: 16px;
}

.tst-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.tst-intro {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tst-intro i {
  width: 12px;
  height: 12px;
  color: var(--primary);
  flex-shrink: 0;
}

.tst-controls {
  margin-bottom: 20px;
}

.tst-controls-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  .tst-controls-row {
    grid-template-columns: 1fr;
  }
}

.tst-toggles {
  display: flex;
  gap: 8px;
}

.tst-toggle-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  justify-content: center;
}

.tst-toggle-item:hover {
  border-color: var(--border-light);
}

.tst-toggle-item:has(input:checked) {
  border-color: var(--primary);
  background: rgba(255, 120, 0, 0.1);
}

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

.tst-toggle-item .tst-toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  pointer-events: none;
}

.tst-toggle-item:has(input:checked) .tst-toggle-label {
  color: var(--primary);
}

.tst-toggle-item .tst-toggle-label i {
  width: 14px;
  height: 14px;
}

.tst-empty-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px;
  justify-content: center;
}

.tst-empty-msg i {
  width: 16px;
  height: 16px;
}

/* Export section */
.tst-export-section {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tst-export-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.tst-export-section h4 i {
  width: 16px;
  height: 16px;
}

.tst-export-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.tst-export-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: rgba(255, 120, 0, 0.05);
  border: 1px solid rgba(255, 120, 0, 0.15);
  border-radius: 6px;
}

.tst-export-info i {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

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

@media (max-width: 600px) {
  .tst-export-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

.tst-export-buttons .tool-btn {
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
}

.tst-export-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* Harmony preview strip */
.tst-harmony-preview {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tst-hp-header {
  margin-bottom: 12px;
}

.tst-hp-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  color: var(--primary);
}

.tst-hp-title i {
  width: 14px;
  height: 14px;
}

.tst-hp-colors {
  display: flex;
  gap: 8px;
}

.tst-hp-swatch {
  flex: 1;
  padding: 12px 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s, box-shadow 0.15s;
  min-height: 80px;
  justify-content: center;
}

.tst-hp-swatch:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.tst-hp-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

.tst-hp-hex {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 600;
}

.tst-hp-temp {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.6rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tst-hp-temp i {
  width: 10px;
  height: 10px;
}

@media (max-width: 500px) {
  .tst-hp-colors {
    flex-wrap: wrap;
  }
  .tst-hp-swatch {
    min-width: calc(50% - 4px);
  }
}

/* Group headers (harmony mode) */
.tst-group {
  margin-bottom: 28px;
}

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

.tst-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  margin-bottom: 16px;
}

.tst-group-color {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tst-group-color span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 600;
}

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

.tst-group-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tst-group-temp {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.tst-temp-warm { color: #f59e0b; }
.tst-temp-cool { color: #3b82f6; }
.tst-temp-neutral { color: var(--text-muted); }

/* Palette summary */
.tst-summary-section {
  margin-top: 24px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tst-summary-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.tst-summary-section h4 i {
  width: 16px;
  height: 16px;
}

.tst-summary-strip {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
  height: 32px;
}

.tst-sum-color {
  flex: 1;
  cursor: pointer;
  transition: transform 0.1s;
  min-width: 2px;
}

.tst-sum-color:hover {
  transform: scaleY(1.3);
  z-index: 1;
}

.tst-summary-count {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Colorblind preview */
.tst-cvd-section {
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tst-cvd-section > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.tst-cvd-section > summary::-webkit-details-marker {
  display: none;
}

.tst-cvd-section > summary::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--text-muted);
  margin-left: auto;
  transition: transform 0.2s;
}

.tst-cvd-section[open] > summary::after {
  transform: rotate(180deg);
}

.tst-cvd-section > summary i {
  width: 16px;
  height: 16px;
}

.tst-cvd-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 12px 0;
}

.tst-cvd-row {
  margin-bottom: 14px;
}

.tst-cvd-row:last-child {
  margin-bottom: 0;
}

.tst-cvd-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.tst-cvd-label i {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.tst-cvd-label strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-primary);
}

.tst-cvd-stat {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.tst-cvd-strip {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  height: 24px;
}

.tst-cvd-swatch {
  flex: 1;
  min-width: 1px;
}

/* ===== TINT, SHADE & TONE CSS GENERATOR ===== */
.tst-css-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .tst-css-layout {
    grid-template-columns: 1fr;
  }
}

.tst-css-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tst-css-results {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tst-css-preview-section h4,
.tst-css-code-section h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Orbitron', monospace;
  font-size: 0.85rem;
  color: var(--primary);
  margin-bottom: 12px;
}

.tst-css-preview-section h4 i,
.tst-css-code-section h4 i {
  width: 16px;
  height: 16px;
}

/* Toggle checkboxes */
.tst-css-toggles {
  display: flex;
  gap: 8px;
}

.tst-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  justify-content: center;
}

.tst-toggle:hover {
  border-color: var(--border-light);
}

.tst-toggle:has(input:checked) {
  border-color: var(--primary);
  background: rgba(255, 120, 0, 0.1);
}

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

.tst-toggle-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  pointer-events: none;
}

.tst-toggle:has(input:checked) .tst-toggle-label {
  color: var(--primary);
}

.tst-toggle-label i {
  width: 14px;
  height: 14px;
}

/* Preview strips */
.tst-preview-group {
  margin-bottom: 16px;
}

.tst-preview-group:last-child {
  margin-bottom: 0;
}

.tst-preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tst-preview-label i {
  width: 12px;
  height: 12px;
}

.tst-preview-strip {
  display: flex;
  border-radius: 8px;
  overflow: hidden;
}

.tst-preview-swatch {
  flex: 1;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, z-index 0s;
  position: relative;
}

.tst-preview-swatch:hover {
  transform: scaleY(1.15);
  z-index: 1;
}

.tst-swatch-hex {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.tst-preview-swatch:hover .tst-swatch-hex {
  opacity: 1;
}

.tst-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.tst-empty-state i {
  width: 32px;
  height: 32px;
  opacity: 0.3;
  margin-bottom: 8px;
}

.tst-empty-state p {
  font-size: 0.85rem;
}

/* Cross-reference link */
.tst-css-crossref {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
}

.tst-css-crossref > i {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 2px;
}

.crossref-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.crossref-link {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--secondary);
  cursor: pointer;
  transition: color 0.2s;
  margin-bottom: 4px;
}

.crossref-link:hover {
  color: var(--secondary-light);
}

.crossref-link i {
  width: 14px;
  height: 14px;
}

.crossref-desc {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== HARMONY GENERATOR ===== */
.harmony-colors-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.harmony-color-item {
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s;
}

.harmony-color-item:hover {
  transform: scale(1.02);
}

.harmony-color-name {
  display: block;
  font-size: 0.7rem;
  opacity: 0.8;
  margin-bottom: 4px;
}

.harmony-color-hex {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== CONTRAST CHECKER ===== */
.contrast-preview {
  padding: 20px;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 16px;
}

.contrast-preview span {
  display: block;
  margin: 6px 0;
}

.contrast-preview-large {
  font-size: 24px;
  font-weight: 700;
}

.contrast-preview-normal {
  font-size: 16px;
}

.contrast-preview-small {
  font-size: 12px;
}

.contrast-ratio {
  text-align: center;
  padding: 16px;
  background: var(--bg-input);
  border-radius: 8px;
  margin-bottom: 16px;
}

.ratio-value {
  font-family: 'Orbitron', monospace;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.ratio-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.compliance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 500px) {
  .compliance-grid {
    grid-template-columns: 1fr;
  }
}

.compliance-section h5 {
  font-family: 'Orbitron', monospace;
  font-size: 0.8rem;
  color: var(--secondary);
  margin-bottom: 10px;
}

.compliance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

.compliance-row:last-child {
  border-bottom: none;
}

/* ===== GRADIENT BUILDER ===== */
.gradient-main-container {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .gradient-main-container {
    grid-template-columns: 1fr;
  }
}

.gradient-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.gradient-preview-panel {
  min-width: 0;
}

.gradient-preview {
  width: 100%;
  height: 250px;
  border-radius: 12px;
  margin-bottom: 20px;
  background: linear-gradient(90deg, #FF7800, #00BFFF);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gradient-stops {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gradient-stops label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.gradient-stop {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--bg-input);
  border-radius: 6px;
}

/* Compact hex input for framework generator */
.fw-hex-input {
  width: 80px !important;
  flex: 0 0 80px !important;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.gradient-stop-hex {
  width: 80px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
}

.gradient-stop-hex:focus {
  outline: none;
  border-color: var(--primary);
}

.gradient-stop input[type="number"] {
  width: 60px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 6px 8px;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.gradient-stop span {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.stop-remove {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.stop-remove:hover {
  color: var(--error);
}

.stop-remove i {
  width: 14px;
  height: 14px;
}

.direction-quick-btns {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin-top: 8px;
}

.direction-quick-btns button {
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  transition: all 0.2s;
}

.direction-quick-btns button:hover {
  border-color: var(--primary);
  background: rgba(255, 120, 0, 0.1);
  color: var(--primary);
  transform: scale(1.05);
}

.gradient-presets-section label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: block;
}

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

.preset-btn-small {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
}

.preset-btn-small:hover {
  border-color: var(--primary);
  background: rgba(255, 120, 0, 0.1);
  color: var(--primary);
  transform: scale(1.02);
}

.gradient-variations-section {
  margin-top: 20px;
}

.gradient-variations-section label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: block;
}

.variations-grid-compact {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

@media (max-width: 600px) {
  .variations-grid-compact {
    grid-template-columns: repeat(2, 1fr);
  }
}

.variation-card-small {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.variation-card-small:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.variation-preview-small {
  height: 60px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.variation-name-small {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* ===== COLOR HISTORY & FAVORITES PANEL ===== */
.color-panel {
  position: fixed;
  top: 0;
  right: -320px;
  width: 320px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

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

.color-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 10;
}

.color-panel-title {
  font-family: 'Orbitron', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.color-panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

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

.color-panel-content {
  padding: 20px;
}

.color-panel-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.color-panel-tab {
  flex: 1;
  padding: 8px 12px;
  background: var(--bg-input);
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.color-panel-tab:hover {
  background: var(--bg-card-hover);
}

.color-panel-tab.active {
  background: var(--primary);
  color: #fff;
}

.color-panel-tab i {
  width: 14px;
  height: 14px;
}

.color-panel-section {
  display: none;
}

.color-panel-section.active {
  display: block;
}

.color-grid-simple {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.color-grid-item-simple {
  aspect-ratio: 1;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
}

.color-grid-item-simple:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.favorite-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--bg-input);
  border-radius: 6px;
  margin-bottom: 8px;
  transition: background 0.2s;
}

.favorite-item:hover {
  background: var(--bg-card-hover);
}

.favorite-color {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 6px;
  cursor: pointer;
}

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

.favorite-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.favorite-hex {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.favorite-actions {
  display: flex;
  gap: 4px;
}

.favorite-action-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.favorite-action-btn:hover {
  color: var(--primary);
}

.favorite-action-btn.delete:hover {
  color: var(--error);
}

.favorite-action-btn i {
  width: 14px;
  height: 14px;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.empty-state i {
  width: 48px;
  height: 48px;
  opacity: 0.3;
  margin-bottom: 12px;
}

.empty-state p {
  font-size: 0.85rem;
}

/* ===== FLOATING ACTION BUTTON ===== */
.fab-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(255, 120, 0, 0.4);
  transition: all 0.3s;
  position: relative;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 120, 0, 0.6);
}

.fab i {
  width: 24px;
  height: 24px;
}

.fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--error);
  color: #fff;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

/* ===== TOAST IMPROVEMENTS ===== */
.copy-toast.success {
  border-left: 4px solid var(--success);
}

.copy-toast.error {
  border-left: 4px solid var(--error);
}

.copy-toast.warning {
  border-left: 4px solid #fbbf24;
}

/* ===== KEYBOARD NAVIGATION FOCUS ===== */
.tool-sidebar-item:focus,
.category-btn:focus,
.tool-btn:focus,
.fab:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== SMALL BUTTON VARIANT ===== */
.tool-btn.small {
  padding: 8px 12px;
  font-size: 0.75rem;
}

.tool-btn.small i {
  width: 14px;
  height: 14px;
}

/* ===== MOBILE OPTIMIZATIONS ===== */
@media (max-width: 768px) {
  .color-panel {
    width: 100%;
    right: -100%;
  }

  .fab-container {
    bottom: 16px;
    right: 16px;
  }

  .fab {
    width: 48px;
    height: 48px;
  }

  .gradient-stop {
    flex-wrap: wrap;
  }

  .gradient-stop input[type="color"] {
    width: 100%;
    height: 60px;
  }
}

/* ===== REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== TOUCH TARGETS ===== */
@media (pointer: coarse) {
  .tool-sidebar-item,
  .category-btn,
  .tool-btn,
  button,
  .color-swatch,
  .palette-color {
    min-height: 44px;
    min-width: 44px;
  }
}

/* ===== UNIVERSAL STAR/FAVORITE BUTTONS ===== */
.palette-color {
  position: relative;
  cursor: pointer;
}

.palette-star-btn,
.grid-star-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.palette-star-btn i,
.grid-star-btn i {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
}

.palette-color:hover .palette-star-btn,
.color-grid-item:hover .grid-star-btn {
  opacity: 1;
  transform: scale(1.05);
}

.palette-star-btn:hover,
.grid-star-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff !important;
  transform: scale(1.15);
  box-shadow: 0 0 12px var(--primary);
}

.color-grid-item {
  position: relative;
}

.palette-color-label {
  cursor: pointer;
  user-select: none;
}

/* ===========================================
   UTILITY CLASSES - Reusable Components
   =========================================== */

/* Flex utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-row {
  display: flex;
  gap: 12px;
  align-items: center;
}

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

.flex-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Color swatch utilities */
.color-swatch {
  border-radius: 8px;
  padding: 20px 10px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid var(--border);
}

.color-swatch:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.color-swatch-sm {
  padding: 12px 8px;
  border-radius: 6px;
}

.color-swatch-lg {
  padding: 30px 15px;
  border-radius: 12px;
}

/* Color grid layouts */
.color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}

.color-grid-sm {
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
}

.color-grid-lg {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.color-grid-2col {
  grid-template-columns: repeat(2, 1fr);
}

.color-grid-3col {
  grid-template-columns: repeat(3, 1fr);
}

.color-grid-4col {
  grid-template-columns: repeat(4, 1fr);
}

.color-grid-5col {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 768px) {
  .color-grid-2col,
  .color-grid-3col,
  .color-grid-4col,
  .color-grid-5col {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Preview containers */
.preview-container {
  background: var(--bg-input);
  padding: 40px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  min-height: 120px;
}

.preview-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}

/* Text utilities */
.text-center {
  text-align: center;
}

.text-mono {
  font-family: 'JetBrains Mono', monospace;
}

.text-heading {
  font-family: 'Orbitron', monospace;
}

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

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

.text-muted {
  color: var(--text-muted);
}

/* Button variants */
.btn-success {
  background: var(--success);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.btn-error {
  background: var(--error);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-error:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-warning {
  background: var(--warning);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-warning:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.btn-info {
  background: var(--info);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-info:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Card utilities */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.card-sm {
  padding: 12px;
  border-radius: 8px;
}

.card-lg {
  padding: 30px;
  border-radius: 16px;
}

/* Spacing utilities */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

/* Overflow handling */
.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

.min-w-0 {
  min-width: 0;
}
