/* logocomper — ettio design system (dark mode) */

/* Ettio tokens (dark) */
:root {
  --black: #141311;
  --charcoal: #1e1c19;
  --graphite: #2e2b26;
  --slate: #4d4943;
  --silver: #8a847a;
  --ash: #c4bdb2;
  --cream: #f2efe8;
  --paper: #f6f4ee;
  --purewhite: #fefdf8;

  --accent: #3b6ca3;
  --accent-400: #5088c4;
  --accent-600: #2d5580;
  --accent-wash: rgba(59, 108, 163, 0.12);

  --error: #a65d4a;
  --success: #2a9185;

  /* Semantic (dark mode) */
  --surface: var(--black);
  --surface-raised: var(--charcoal);
  --surface-overlay: var(--graphite);
  --text: var(--cream);
  --text-muted: var(--ash);
  --text-subtle: var(--silver);
  --text-faint: var(--slate);
  --line: var(--graphite);
  --line-muted: var(--charcoal);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Funnel Sans", ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--surface);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
}

#app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
#sidebar {
  width: 260px;
  min-width: 260px;
  background: var(--surface-raised);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 16px;
  gap: 16px;
}

#sidebar h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: lowercase;
}

#sidebar h2 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-subtle);
  margin-bottom: 8px;
}

.thumb-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
  background: var(--surface-overlay);
}

.thumb:hover {
  border-color: var(--accent);
}

.thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-wash);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.thumb .thumb-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  font-size: 10px;
  padding: 2px 4px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Surfaces panel */
#surfaces-section.hidden {
  display: none;
}

.surface-row {
  background: var(--surface-overlay);
  border-radius: 4px;
  padding: 10px;
  margin-bottom: 8px;
}

.surface-row .surface-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.surface-color-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.surface-label {
  font-size: 13px;
  font-weight: 500;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.surface-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.surface-controls label {
  font-size: 11px;
  color: var(--text-subtle);
}

.surface-controls select,
.surface-controls input[type="range"] {
  width: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--line-muted);
  color: var(--text);
  border-radius: 2px;
  padding: 4px;
  font-size: 12px;
}

.surface-controls select:focus,
.surface-controls input:focus {
  outline: none;
  border-color: var(--accent);
}

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

.control-row label {
  min-width: 60px;
}

.control-row .value-display {
  font-size: 11px;
  color: var(--text-subtle);
  min-width: 30px;
  text-align: right;
}

/* Main area */
#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Toolbar */
#toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--surface-raised);
  border-bottom: 1px solid var(--line);
}

#toolbar button {
  background: var(--surface-overlay);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

#toolbar button:hover:not(:disabled) {
  background: var(--slate);
  border-color: var(--accent);
}

#toolbar button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#toolbar button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--purewhite);
}

#toolbar button.primary:hover:not(:disabled) {
  background: var(--accent-600);
}

#status-text {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-subtle);
}

/* Canvas container */
#canvas-container {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--black);
}

#canvas-placeholder {
  color: var(--text-faint);
  font-size: 16px;
}

#konva-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Preview overlay */
#preview-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#preview-overlay.hidden {
  display: none;
}

#preview-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 14px;
}

#preview-header button {
  background: var(--accent);
  color: var(--purewhite);
  border: none;
  border-radius: 2px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
}

#preview-img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 4px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
}

/* Settings gear button */
#btn-settings {
  font-size: 18px;
  line-height: 1;
  padding: 6px 10px;
}

/* Settings overlay */
#settings-overlay.hidden {
  display: none;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--text-faint);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

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