/* GOATLIB Pose Planner - 2026 Design System */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a24;
  --bg-hover: #242430;
  --bg-active: #2d2d3a;
  --border: #2a2a3a;
  --border-light: #3a3a4a;
  --text-primary: #ffffff;
  --text-secondary: #b4b4c8;
  --text-muted: #8888a0;
  --accent: rgb(70, 80, 220);
  --accent-light: rgb(100, 110, 240);
  --accent-hover: rgb(85, 95, 230);
  --accent-glow: rgba(70, 80, 220, 0.4);
  --highlight: #fbbf24;
  --danger: #f87171;
  --success: #4ade80;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 24px;
}

.logo-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--accent-light) 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.coordinates {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 150px;
  text-align: right;
}

.zoom-badge {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(70, 80, 220, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid rgba(70, 80, 220, 0.4);
}

/* Main Layout */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.sidebar {
  width: 300px;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.panel {
  padding: 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-weight: 600;
  font-size: 12px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.panel-subtitle {
  font-weight: 600;
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-light);
  background: rgba(70, 80, 220, 0.25);
  padding: 3px 10px;
  border-radius: 12px;
}

.group-filter {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.group-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.group-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.group-chip:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.group-chip.active {
  background: rgba(70, 80, 220, 0.25);
  border-color: var(--accent-light);
  color: var(--text-primary);
  box-shadow: 0 0 0 1px rgba(70, 80, 220, 0.4);
}

.group-chip .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* Pose List */
.pose-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-tertiary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.pose-list:empty::after {
  content: "Double-click on field to add";
  display: block;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.pose-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: all 0.15s ease;
}

.pose-list li:last-child {
  border-bottom: none;
}

.pose-list li:hover {
  background: var(--bg-hover);
}

.pose-list li.active {
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.pose-list li.active .pose-coords {
  color: rgba(255, 255, 255, 0.8);
}

.pose-name {
  font-weight: 500;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pose-coords {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-left: 10px;
}

.pose-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.2);
  padding: 3px 8px;
  border-radius: 6px;
  margin-left: 8px;
}

.pose-list li.active .pose-tag {
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

/* Buttons */
.button-row {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.btn-small {
  padding: 6px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  flex: 1;
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}

.btn-secondary {
  flex: 1;
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
  color: var(--danger);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
}

.btn-file {
  cursor: pointer;
}

.btn-tool {
  width: 38px;
  height: 38px;
  padding: 0;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.btn-tool.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 12px;
  color: var(--text-primary);
  font-weight: 600;
}

input[type="text"],
select {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.15s ease;
}

input[type="text"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

input[type="text"]:disabled,
select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input[type="text"]::placeholder {
  color: var(--text-muted);
}

/* Sliders */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-input {
  font-family: "SF Mono", Monaco, monospace;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  width: 90px;
  text-align: right;
}

.slider-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.slider-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

input[type="range"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 16px var(--accent-glow);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* File Actions */
.file-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-actions .btn {
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  justify-content: center;
  font-size: 13px;
  padding: 10px 12px;
}

.file-actions .btn-copy {
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  padding: 13px 18px;
  justify-content: center;
  gap: 8px;
}

/* Status */
.status {
  font-size: 12px;
  min-height: 18px;
  padding-top: 4px;
  font-weight: 500;
}

.status.success {
  color: var(--accent);
}

.status.error {
  color: var(--danger);
}

/* Canvas Area */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.toolbar-group {
  display: flex;
  gap: 6px;
}

.canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #080808;
}

canvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
}

/* Overlay */
.overlay-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.overlay-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.overlay-item input {
  accent-color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Selection highlight */
::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  min-width: 340px;
  max-width: 440px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-weight: 600;
  font-size: 16px;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-body input[type="number"] {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}

.modal-body input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-body textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 13px;
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  resize: vertical;
  min-height: 200px;
  transition: all 0.15s ease;
}

.modal-body textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-body textarea::placeholder {
  color: var(--text-muted);
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-footer .btn-primary {
  flex: none;
  padding: 10px 24px;
}

/* Context Menu */
.context-menu {
  position: fixed;
  z-index: 1001;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 140px;
  padding: 6px 0;
}

.context-menu.hidden {
  display: none;
}

.context-menu button {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.context-menu button:hover {
  background: var(--bg-hover);
}

.context-menu button.danger {
  color: var(--danger);
}

.context-menu button.danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* GitHub Integration */
.github-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.github-controls .btn {
  width: 100%;
  justify-content: center;
  font-size: 13px;
  padding: 10px 12px;
}

.github-status {
  font-size: 12px;
  min-height: 18px;
  padding-top: 8px;
  font-weight: 500;
  color: var(--text-secondary);
}

.github-status.success {
  color: var(--success);
}

.github-status.error {
  color: var(--danger);
}

.github-status.loading {
  color: var(--accent);
}

.github-test-result {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: none;
}

.github-test-result.show {
  display: block;
}

.github-test-result.success {
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--success);
}

.github-test-result.error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
}

.form-help {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.form-help code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: "SF Mono", Monaco, monospace;
  font-size: 11px;
}

.form-help a {
  color: var(--accent-light);
  text-decoration: none;
}

.form-help a:hover {
  text-decoration: underline;
}

.modal-body input[type="text"],
.modal-body input[type="password"],
.modal-body select {
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  transition: all 0.15s ease;
}

.modal-body input[type="text"]:focus,
.modal-body input[type="password"]:focus,
.modal-body select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.modal-body select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-body input[type="password"]::placeholder {
  color: var(--text-muted);
}
