/**
 * Poker Elephant - Range Builder / Painter Stylesheet (GTO Wizard Style Layout)
 */

/* Sidebar Mode Switcher Footer */
.sidebar-mode-switcher {
  padding: 8px;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.4);
}

.mode-tab-btn {
  flex: 1;
  padding: 6px 8px;
  font-size: 0.725rem;
  font-weight: 700;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.mode-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.mode-tab-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* Range Builder Workspace Container */
.builder-workspace {
  width: 100%;
  height: 100%;
  display: flex;
  gap: 14px;
  overflow: hidden;
}

/* Main Content Area (Matrix + Palette Table) */
.builder-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 10px;
  overflow-y: auto;
}

.builder-center-card {
  width: 480px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 13x13 Square Matrix Container */
.builder-matrix-wrapper {
  width: 480px;
  height: 480px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-sizing: border-box;
}

.builder-matrix-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  grid-template-rows: repeat(13, 1fr);
  gap: 2px;
  width: 100%;
  height: 100%;
}

/* Multi-Segment Matrix Cell */
.builder-cell {
  position: relative;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  user-select: none;
  transition: transform 0.1s ease, border-color 0.1s ease;
}

.builder-cell:hover {
  border-color: rgba(255, 255, 255, 0.5);
  z-index: 5;
}

/* Vertical Multi-Action Fill Segments */
.builder-cell-segments {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

.cell-action-segment {
  width: 100%;
}

.builder-cell-text {
  position: relative;
  z-index: 2;
  font-size: 0.725rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Summary Bar Under Matrix */
.builder-summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.builder-summary-highlight {
  color: #fff;
  font-size: 0.9rem;
  font-weight: 800;
}

/* Action Frequency Table & Color Manager Box */
.builder-action-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
}

.action-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.775rem;
}

.action-table th {
  text-align: left;
  padding: 6px 8px;
  color: var(--text-muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.action-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.action-row {
  cursor: pointer;
  transition: background 0.15s ease;
}

.action-row:hover {
  background: rgba(255, 255, 255, 0.04);
}

.action-row.active-brush {
  background: rgba(59, 130, 246, 0.15);
}

/* Color Picker Input */
.action-color-picker {
  width: 18px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  background: none;
}

.action-export-btn {
  padding: 2px 6px;
  font-size: 0.7rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-export-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
}

/* Context Menu for Action Rows */
.action-context-menu {
  position: fixed;
  z-index: 10000;
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 140px;
  backdrop-filter: blur(8px);
}

.context-menu-item {
  padding: 6px 10px;
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-primary);
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s ease;
}

.context-menu-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.context-menu-item.delete {
  color: #fca5a5;
}

.context-menu-item.delete:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Weight Selector Buttons */
.weight-preset-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.weight-preset-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.weight-preset-btn.active {
  background: #3b82f6 !important;
  color: #fff !important;
  border-color: #60a5fa !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Action Table Row Drag & Drop Reordering */
.action-row.dragging-act-row {
  opacity: 0.4;
  background: rgba(59, 130, 246, 0.2) !important;
}

.action-row.drag-over-act-row {
  border-top: 2px solid #3b82f6 !important;
  background: rgba(59, 130, 246, 0.1) !important;
}

/* Text Color Preset Buttons */
.text-color-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: 4px;
  transition: all 0.15s ease;
}

.text-color-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.text-color-btn.active {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #34d399 !important;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}
