/* layout.css — Toolbar, ruler, canvas, and status bar layout */

/* ── Toolbar ──────────────────────────────────────────── */

#toolbar {
  height: 44px;
  background: #1e1e1e;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 8px;
  gap: 0;
  user-select: none;
  flex-shrink: 0;
}

.tb-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 2px;
}

.tb-btn {
  height: 32px;
  min-width: 32px;
  padding: 0 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #ccc;
  transition: background 0.1s, color 0.1s;
}

.tb-btn:hover {
  background: #2a2a2a;
}

.tb-btn.active {
  background: rgba(37, 99, 235, 0.15);
  color: #60a5fa;
}

.tb-btn svg {
  flex-shrink: 0;
}

.tb-sep {
  width: 1px;
  height: 20px;
  background: #333;
  margin: 0 6px;
  flex-shrink: 0;
}

.tb-select {
  height: 28px;
  padding: 0 6px;
  border-radius: 4px;
  border: 1px solid #333;
  background: #252525;
  font-size: 12px;
  color: #ccc;
  margin: 0 2px;
}

.tb-select:hover {
  border-color: #555;
}

.tb-select:focus {
  border-color: #2563eb;
}

.tb-select option {
  background: #252525;
  color: #ccc;
}

/* Color picker wrappers */
.tb-color-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
}

.tb-color-wrap:hover {
  background: #2a2a2a;
}

.tb-color-wrap input[type="color"] {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.7;
}

.tb-color-wrap input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.tb-color-wrap input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 0 0 3px 3px;
}

.tb-color-label {
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  line-height: 1;
  padding-bottom: 4px;
  color: #ccc;
}

.tb-highlight-label {
  background: #ffff00;
  color: #1a1a1a;
  padding: 0 3px 4px;
  border-radius: 2px;
}

/* ── Ruler ────────────────────────────────────────────── */

#ruler {
  height: 28px;
  background: #1e1e1e;
  border-bottom: 1px solid #2a2a2a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

#ruler-track {
  width: 794px;
  height: 100%;
  position: relative;
}

.ruler-ticks {
  width: 100%;
  height: 100%;
  background-image:
    repeating-linear-gradient(
      to right,
      #444 0px, #444 1px, transparent 1px, transparent 9.34px
    );
  position: relative;
}

.ruler-ticks::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    repeating-linear-gradient(
      to right,
      #666 0px, #666 1px, transparent 1px, transparent 93.4px
    );
}

/* ── Canvas ───────────────────────────────────────────── */

#canvas {
  height: calc(100vh - 44px - 28px - 32px);
  overflow-y: auto;
  background: #141414;
  padding: 40px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

/* Scrollbar styling */
#canvas::-webkit-scrollbar {
  width: 10px;
}

#canvas::-webkit-scrollbar-track {
  background: #141414;
}

#canvas::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 5px;
}

#canvas::-webkit-scrollbar-thumb:hover {
  background: #444;
}

/* ── Status Bar ───────────────────────────────────────── */

#statusbar {
  height: 32px;
  background: #1e1e1e;
  border-top: 1px solid #2a2a2a;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 16px;
  font-size: 12px;
  color: #666;
  user-select: none;
  flex-shrink: 0;
  gap: 8px;
}

.sb-sep {
  color: #333;
}

.sb-spacer {
  flex: 1;
}

.sb-brand {
  font-weight: 600;
  color: #555;
  letter-spacing: 0.5px;
}

/* ── Chat Box ─────────────────────────────────────────── */

#chatbox {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: 480px;
  max-width: calc(100vw - 32px);
  display: flex;
  align-items: center;
  background: #252525;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 0 16px;
  z-index: 1000;
  transition: border-color 0.15s;
}

#chatbox:focus-within {
  border-color: #444;
}

#chat-input {
  flex: 1;
  height: 40px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: #e0e0e0;
  font-family: 'Inter', sans-serif;
}

#chat-input::placeholder {
  color: #555;
}
