/* Color Palette from Photo — style.css — Designer Studio */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --secondary: #636E72;
  --accent: #FFEAA7;
  --bg: #0F0F1A;
  --bg-card: rgba(15, 15, 26, 0.92);
  --surface: rgba(30, 30, 55, 0.5);
  --border: rgba(99, 110, 114, 0.1);
  --text: #D0D0E0;
  --text-dim: #808090;
  --text-muted: #404050;
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.25s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; background: var(--bg-card); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100;
}
.header-left { display: flex; align-items: center; gap: 10px; }
.logo { width: 34px; height: 34px; background: linear-gradient(135deg, #E17055, #FFEAA7, #00CEC9, #6C5CE7); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.header h1 { font-size: 15px; font-weight: 600; color: var(--accent); }
.header-right { display: flex; gap: 8px; }

.btn {
  padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: 'Inter', sans-serif;
  font-size: 12px; font-weight: 500; cursor: pointer; transition: var(--transition);
}
.btn:hover { border-color: var(--accent); }
.btn-sm { padding: 5px 10px; font-size: 11px; }

.app { max-width: 800px; margin: 0 auto; padding: 16px; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.card h3 { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-dim); margin-bottom: 10px; }

.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 30px;
  text-align: center; cursor: pointer; transition: var(--transition); font-size: 13px; color: var(--text-dim);
}
.drop-zone:hover { border-color: var(--accent); }
.upload-label { color: var(--accent); cursor: pointer; text-decoration: underline; }

.field-row { display: flex; align-items: center; gap: 8px; }
.field-label { font-size: 10px; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; }
.slider { flex: 1; accent-color: var(--accent); }
.slider-label { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent); min-width: 20px; }

.result-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.preview-wrap canvas { width: 100%; border-radius: var(--radius-sm); display: block; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch {
  width: 48px; height: 48px; border-radius: var(--radius-sm); cursor: pointer;
  transition: transform 0.2s; position: relative; border: 2px solid transparent;
  animation: swatchReveal 0.3s ease backwards;
}
.swatch:hover { transform: scale(1.15); border-color: var(--accent); }
.swatch-label {
  position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%);
  font-family: 'JetBrains Mono', monospace; font-size: 8px; color: var(--text-dim);
  white-space: nowrap;
}

@keyframes swatchReveal { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }

.tabs { display: flex; gap: 2px; margin-bottom: 8px; }
.tab {
  padding: 5px 12px; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface); border: 1px solid var(--border); border-bottom: none;
  color: var(--text-dim); font-size: 11px; cursor: pointer; font-family: 'Inter', sans-serif; transition: var(--transition);
}
.tab.active { background: var(--bg); color: var(--accent); border-color: var(--accent); }

.output {
  background: var(--bg); border: 1px solid var(--border); border-radius: 0 var(--radius-sm) var(--radius-sm) var(--radius-sm);
  padding: 12px; font-family: 'JetBrains Mono', monospace; font-size: 11px;
  white-space: pre-wrap; color: var(--accent); max-height: 200px; overflow-y: auto; margin-bottom: 8px;
}

.contrast-table { width: 100%; border-collapse: collapse; font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.contrast-table td, .contrast-table th { padding: 4px; text-align: center; border: 1px solid var(--border); }
.contrast-pass { color: #00B894; } .contrast-fail { color: #D63031; }

.library-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.library-colors { display: flex; gap: 2px; }
.library-swatch { width: 20px; height: 20px; border-radius: 4px; }

.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 20px; font-size: 13px; opacity: 0; transition: all 0.3s; z-index: 300; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-thumb { background: var(--surface); border-radius: 3px; }

@media (max-width: 600px) { .result-layout { grid-template-columns: 1fr; } }
