/* ============================================================
   Shared Shore toolbar
   ------------------------------------------------------------
   The floating clay-dark toolbar used by the sculpting board and
   by every /projects/* page, so the whole site reads as one app.
   Pages own their own canvas/background styling; everything that
   makes the bar look and behave like Shore's lives here.

   Markup contract (see public/index.html for the canonical use):

     <div class="shore-toolbar" id="unified-toolbar">
       <div class="toolbar-drag-handle">⋮⋮</div>
       <div class="mode-buttons"><button class="mode-btn active">…</button></div>
       <button class="icon-button" id="fullscreen-button">⛶</button>
       <button class="icon-button" id="menu-button">☰</button>
     </div>
     <div class="dropdown-menu" id="menu-dropdown">…</div>

   Dropdowns are positioned by public/js/toolbar.js, not by CSS, so
   they can flip above/below the bar wherever it has been dragged.
   ============================================================ */

.shore-toolbar {
  position: fixed;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(31, 28, 25, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  z-index: 200;
  user-select: none;
  -webkit-user-select: none;
  font-family: system-ui, -apple-system, sans-serif;
  transition: box-shadow 0.3s ease, opacity 0.3s ease;
}

.shore-toolbar:hover {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* Drag handle */
.toolbar-drag-handle {
  cursor: grab;
  color: rgba(212, 196, 180, 0.4);
  font-size: 16px;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  margin-left: -0.2rem;
  margin-right: 0.25rem;
  border-radius: 6px;
  transition: all 0.3s;
  letter-spacing: -2px;
  touch-action: none;
}

.toolbar-drag-handle:hover {
  color: rgba(212, 196, 180, 0.6);
  background: rgba(212, 196, 180, 0.03);
}

.toolbar-drag-handle:active,
.shore-toolbar.dragging .toolbar-drag-handle {
  cursor: grabbing;
  color: rgba(212, 196, 180, 0.8);
  background: rgba(212, 196, 180, 0.05);
}

.shore-toolbar.dragging {
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.45);
  transition: none;
}

/* Toolbar separator */
.toolbar-separator {
  display: none;
}

/* Mode Buttons */
.mode-buttons {
  display: flex;
  gap: 0.5rem;
  border: none;
  border-radius: 8px;
  overflow: visible;
}

.mode-btn {
  padding: 8px 14px;
  font-size: 16px;
  font-family: inherit;
  background: transparent;
  color: rgba(212, 196, 180, 0.5);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.mode-btn:hover {
  background: rgba(212, 196, 180, 0.03);
  color: rgba(212, 196, 180, 0.7);
}

.mode-btn.active {
  background: transparent;
  color: #ede0d4;
  box-shadow: 0 0 12px rgba(212, 196, 180, 0.25);
}

/* Text-labelled variant (e.g. pattern presets) — reads as a word, not a glyph */
.mode-btn.text-btn {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 12px;
}

/* Bar Control (for dropdowns) */
.bar-control {
  position: relative;
  outline: none;
  cursor: pointer;
  padding: 0.5rem 0.75rem;
}

/* Dropdown Container */
.bar-dropdown {
  position: fixed;
  background: rgba(31, 28, 25, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  z-index: 201;
  padding: 0 0.75rem 0.75rem 0.75rem;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
}

.dropdown-label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.6;
  color: #ede0d4;
  margin-top: 0.5rem;
  margin-bottom: 0.25rem;
}

/* Icon Button */
.icon-button {
  padding: 8px 14px;
  font-size: 18px;
  font-family: inherit;
  background: transparent;
  color: rgba(212, 196, 180, 0.5);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.icon-button:hover {
  background: rgba(212, 196, 180, 0.03);
  color: rgba(212, 196, 180, 0.8);
  box-shadow: 0 0 8px rgba(212, 196, 180, 0.1);
}

/* Engaged state, e.g. ⛶ while fullscreen */
.icon-button.active {
  background: rgba(212, 196, 180, 0.08);
  color: #ede0d4;
  box-shadow: 0 0 8px rgba(212, 196, 180, 0.15);
}

/* Toggle Button (for Gallery Mode) */
.toggle-button {
  position: relative;
}

.toggle-button.active {
  background: rgba(212, 196, 180, 0.08);
  color: #ede0d4;
  box-shadow: 0 0 8px rgba(212, 196, 180, 0.15);
}

.toggle-button.active .toggle-icon {
  color: #ede0d4;
}

.toggle-icon {
  display: inline-block;
  transition: all 0.3s;
}

/* === MENU DROPDOWN === */
.dropdown-menu {
  position: fixed;
  background: rgba(31, 28, 25, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: none;
  border-radius: 12px;
  padding: 0.5rem;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.25);
  z-index: 201;
  font-family: system-ui, -apple-system, sans-serif;
}

.dropdown-menu button,
.dropdown-menu a {
  display: block;
  width: 100%;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  border-radius: 8px;
  color: #ede0d4;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.3s;
}

.dropdown-menu button:hover,
.dropdown-menu a:hover {
  background: rgba(237, 224, 212, 0.05);
  box-shadow: 0 0 8px rgba(212, 196, 180, 0.1);
}

/* Selected item in a radio-style group (e.g. Speed) */
.dropdown-menu button.active {
  color: #ede0d4;
  background: rgba(237, 224, 212, 0.08);
  box-shadow: 0 0 8px rgba(212, 196, 180, 0.15);
}

.dropdown-separator {
  height: 1px;
  background: rgba(237, 224, 212, 0.1);
  margin: 0.5rem 0.75rem;
}

.menu-toggle-button {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.5rem;
}

.toggle-indicator {
  font-size: 1.2rem;
  transition: all 0.3s;
  color: rgba(212, 196, 180, 0.5);
}

.menu-toggle-button.active .toggle-indicator {
  color: #ede0d4;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .shore-toolbar {
    gap: 0.35rem;
    padding: 0.35rem 0.5rem;
  }

  .mode-btn {
    padding: 4px 8px;
    font-size: 14px;
  }

  .mode-btn.text-btn {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .icon-button {
    padding: 4px 8px;
    font-size: 16px;
  }

  .toolbar-separator {
    margin: 0 0.15rem;
  }
}
