/* Sockbend Web — Dark theme */

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

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface2: #0f3460;
  --accent: #e94560;
  --accent-dim: #c13550;
  --text: #eee;
  --text-dim: #999;
  --border: #333;
  --radius: 8px;
  --gap: 16px;
}

html {
  font-size: 15px;
}

body {
  font-family: "SF Mono", "Cascadia Code", "Fira Code", monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 2rem;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
  color: var(--accent);
}

h1 span {
  color: var(--text-dim);
  font-weight: 400;
  font-size: 0.9rem;
}

h2 {
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: var(--gap);
  font-weight: 400;
}

/* Layout */
.app {
  max-width: 1100px;
  margin: 0 auto;
}

.columns {
  display: flex;
  gap: calc(var(--gap) * 2);
  align-items: flex-start;
}

.col-left {
  flex: 1;
  min-width: 0;
}

.col-right {
  flex: 1;
  min-width: 0;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--surface);
  margin-bottom: var(--gap);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--surface2);
}

.drop-zone p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.drop-zone .filename {
  color: var(--accent);
  font-weight: 600;
  display: block;
  margin-top: 0.5rem;
  word-break: break-all;
}

/* Section panels */
.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--gap);
  margin-bottom: var(--gap);
}

.panel-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

/* Effect cards */
.effect-chain {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.effect-card {
  background: var(--surface2);
  border-radius: var(--radius);
  padding: 12px;
  position: relative;
}

.effect-card .effect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.effect-card .effect-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.effect-card .remove-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}

.effect-card .remove-btn:hover {
  color: var(--accent);
  background: rgba(233, 69, 96, 0.15);
}

.param-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  font-size: 0.8rem;
}

.param-row label {
  flex: 0 0 130px;
  color: var(--text-dim);
  text-align: right;
}

.param-row input[type="range"] {
  flex: 1;
}

.param-row .param-value {
  flex: 0 0 60px;
  text-align: right;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Sweep controls (animation mode) */
.sweep-row {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 0.75rem;
  margin-top: 4px;
}

.sweep-row label {
  color: var(--text-dim);
}

.sweep-row input[type="number"] {
  width: 70px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 2px 6px;
  font-family: inherit;
  font-size: 0.8rem;
}

/* Add effect button */
.add-effect-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.add-effect-row select {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.85rem;
}

.add-effect-row button {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 6px 14px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
}

.add-effect-row button:hover {
  border-color: var(--accent);
}

/* Animate controls */
.animate-controls {
  display: none;
  gap: 12px;
  flex-direction: column;
}

.animate-controls.active {
  display: flex;
}

.anim-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
}

.anim-row label {
  flex: 0 0 110px;
  text-align: right;
  color: var(--text-dim);
}

.anim-row input[type="range"],
.anim-row input[type="number"] {
  flex: 1;
}

.anim-row input[type="number"] {
  max-width: 80px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: inherit;
}

.anim-row .anim-value {
  flex: 0 0 40px;
  text-align: right;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

/* Toggle switch */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.toggle-row label {
  font-size: 0.85rem;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.toggle {
  position: relative;
  width: 40px;
  height: 22px;
}

.toggle input {
  display: none;
}

.toggle .slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.toggle .slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.2s;
}

.toggle input:checked + .slider {
  background: var(--accent);
}

.toggle input:checked + .slider::before {
  transform: translateX(18px);
}

/* Buttons */
.bend-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.bend-btn:hover {
  background: var(--accent-dim);
}

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

/* Progress */
.progress-wrap {
  display: none;
  margin-bottom: var(--gap);
}

.progress-wrap.active {
  display: block;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.2s;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  margin-top: 4px;
}

/* Preview area */
.preview {
  background: var(--surface);
  border-radius: var(--radius);
  padding: var(--gap);
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.preview .placeholder {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.preview img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  image-rendering: pixelated;
}

.download-btn {
  display: none;
  margin-top: 12px;
  padding: 8px 20px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: none;
}

.download-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Advanced textarea */
.raw-args {
  width: 100%;
  min-height: 60px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: 8px;
  font-family: inherit;
  font-size: 0.8rem;
  resize: vertical;
}

.raw-args::placeholder {
  color: var(--text-dim);
}

/* Responsive */
@media (max-width: 768px) {
  .columns {
    flex-direction: column;
  }

  body {
    padding: 1rem;
  }

  .param-row label {
    flex: 0 0 90px;
    font-size: 0.75rem;
  }
}

/* Loading spinner */
.spinner {
  display: none;
  width: 36px;
  height: 36px;
  border: 3px solid var(--surface2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner.active {
  display: block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Error message */
.error-msg {
  display: none;
  background: rgba(233, 69, 96, 0.15);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: var(--gap);
  word-break: break-word;
}

.error-msg.active {
  display: block;
}
