/**
 * public/css/tools/random-color-generator.css
 * Random Color Generator  —  prefix: rg-
 * Accent: #16A34A (green)
 * Loads after: style.css · desktop.css · tool-cards.css · design-tools-shared.css
 */

/* ── tc-icon--violet ── */
.tc-icon--violet { background: #F5F3FF; color: #7C3AED; }

/* Controls bar */
.rg-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  margin-bottom: 24px;
}

.rg-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .2s cubic-bezier(.34,1.56,.64,1), box-shadow .15s;
  box-shadow: 0 4px 14px rgba(22,163,74,.35), 0 1px 3px rgba(0,0,0,.1);
  min-height: 48px;
}
.rg-generate-btn:hover {
  opacity: .92;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(22,163,74,.4), 0 2px 6px rgba(0,0,0,.12);
}
.rg-generate-btn:active { transform: scale(.97); }

.rg-kbd {
  background: rgba(255,255,255,.22);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: .73rem;
  font-family: monospace;
  border: 1px solid rgba(255,255,255,.3);
}

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

.rg-select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .88rem;
  color: var(--text-primary);
  background: var(--surface);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
  min-height: 42px;
}
.rg-select:focus {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22,163,74,.12);
}

/* Color swatches strip */
.rg-swatches {
  display: flex;
  gap: 0;
  border-radius: 16px;
  overflow: hidden;
  min-height: 240px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.07);
  margin-bottom: 28px;
  border: 1px solid rgba(0,0,0,.06);
}

.rg-swatch {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 10px;
  cursor: pointer;
  position: relative;
  transition: flex .25s cubic-bezier(.34,1.56,.64,1);
  min-width: 0;
}
.rg-swatch:hover { flex: 2; }
.rg-swatch.locked {
  outline: 3px solid rgba(255,255,255,.7);
  outline-offset: -3px;
  z-index: 1;
}

.rg-swatch-hex {
  font-size: .72rem;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  opacity: 0;
  transition: opacity .18s;
  padding: 4px 10px;
  background: rgba(0,0,0,.32);
  border-radius: 6px;
  white-space: nowrap;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  backdrop-filter: blur(4px);
}
.rg-swatch:hover .rg-swatch-hex { opacity: 1; }

.rg-swatch-lock {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(0,0,0,.22);
  backdrop-filter: blur(4px);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s, transform .2s cubic-bezier(.34,1.56,.64,1);
}
.rg-swatch:hover .rg-swatch-lock,
.rg-swatch.locked .rg-swatch-lock { opacity: 1; }
.rg-swatch.locked .rg-swatch-lock { background: rgba(255,255,255,.3); }
.rg-swatch-lock:hover { transform: scale(1.1); }

.rg-copied-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,.65);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: .76rem;
  font-weight: 700;
  display: none;
  pointer-events: none;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.rg-swatch.just-copied .rg-copied-badge { display: block; }

/* History */
.rg-history-section {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
}

.rg-history-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.rg-clear-btn {
  padding: 4px 12px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: .78rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.rg-clear-btn:hover { border-color: #f87171; color: #dc2626; }

.rg-history {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 36px;
}

.rg-hist-item {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .15s cubic-bezier(.34,1.56,.64,1), border-color .12s, box-shadow .15s;
  position: relative;
}
.rg-hist-item:hover {
  transform: scale(1.2) translateY(-2px);
  border-color: rgba(0,0,0,.2);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.rg-hist-item[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a202c;
  color: #fff;
  font-size: .68rem;
  padding: 3px 8px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

@media (max-width: 600px) {
  .rg-swatches { min-height: 180px; border-radius: 12px; }
  .rg-controls { gap: 12px; }
  .rg-generate-btn { min-height: 52px; font-size: 1rem; }
}
