/* Staff Grouping Gutter Styles */
/* Based on proto2.html design */

/* ===== SYSTEM CONTROLS CONTAINER ===== */
/* Positioned outside notation div, to the left */

#editor-container {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
}

.system-controls-container {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 28px;
  min-width: 28px;
  flex-shrink: 0;
  margin-right: 4px;
}

/* Ensure notation editor takes remaining space */
#notation-editor {
  flex: 1;
  min-width: 0;
}

/* Line structure with gutter */
.notation-line {
  display: flex !important;
  flex-direction: row;
  align-items: stretch;
}

/* Gutter column (left side - system marker only) */
.line-gutter {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  cursor: default;
  user-select: none;
  width: 32px;
  padding-top: 20px; /* Match content-wrapper padding for tala space */
  min-height: 48px; /* Match textarea min-height */
}

/* Gutter collapsed state */
.line-gutter.gutter-collapsed {
  min-width: 0 !important;
  padding: 0 !important;
  opacity: 0;
  pointer-events: none;
}

.line-gutter:hover {
  background: #f8f9fa;
}

/* Label column - separate from gutter to avoid layout shifts */
.label-column {
  width: 100px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  padding-top: 20px; /* Match content-wrapper padding for tala space */
}

.label-column .line-label {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #9ca3af;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: right;
  line-height: 48px; /* Match textarea min-height for vertical centering */
}

/* Line content area (cells) */
.line-content {
  flex: 1;
  position: relative;
  min-width: 0;
}

/* Bracket overlay container - positioned outside editor-container */
#bracket-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: visible;
}

/* Group brace overlay (Noto Music curly brace U+1D114) */
.group-brace {
  position: absolute;
  font-family: "Noto Music", "NotationFont", serif;
  font-size: 40px;
  line-height: 1;
  transform-origin: center top;
  color: #000000;
  pointer-events: none;
}

/* Context menu */
.context-menu {
  position: absolute;
  z-index: 1000;
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  min-width: 220px;
  padding: 4px 0;
  font-size: 13px;
  display: none;
}

.context-menu-item {
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}

.context-menu-item:hover {
  background: #eef6ff;
}

.context-menu-item.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.context-menu-item.disabled:hover {
  background: transparent;
}

.context-menu-radio {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #888;
  display: inline-block;
  box-sizing: border-box;
  flex-shrink: 0;
}

.context-menu-radio.checked {
  background: #0057b8;
  border-color: #0057b8;
}


/* ===== SYSTEM MARKER INDICATOR ===== */
/* LilyPond-style << and >> for multi-system grouping */

.system-marker-indicator {
  min-width: 20px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #888;
  cursor: pointer;
  border-radius: 3px;
  border: 1px solid #ddd;
  background-color: #f5f5f5;
  margin-left: auto;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.system-marker-indicator:hover {
  background-color: rgba(0, 87, 184, 0.1);
  border-color: rgba(0, 87, 184, 0.3);
  color: #0057b8;
}

.system-marker-indicator.marker-active {
  color: #0057b8;
  background-color: rgba(0, 87, 184, 0.1);
}

.system-marker-indicator.marker-active:hover {
  background-color: rgba(0, 87, 184, 0.2);
}

/* System marker popup menu */
.system-marker-menu {
  background: #ffffff;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 150px;
  padding: 4px 0;
  font-size: 13px;
  font-family: system-ui, -apple-system, sans-serif;
}

.system-marker-menu-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.1s;
}

.system-marker-menu-item:hover {
  background-color: #eef6ff;
}

.system-marker-menu-item.current {
  background-color: rgba(0, 87, 184, 0.1);
  font-weight: 500;
}

.system-marker-menu-item .menu-icon {
  width: 20px;
  text-align: center;
  font-family: monospace;
  font-weight: 600;
  color: #0057b8;
}
