/* Storm Summoner Web App Styles */

@font-face {
  font-family: 'Chalet';
  src: url('../assets/chalet-newyork-1960.woff2') format('woff2'),
       url('../assets/chalet-newyork-1960.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Venice';
  src: url('../assets/flyer-venice.woff2') format('woff2'),
       url('../assets/flyer-venice.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --color-primary: #0066FF;
  --color-gold: #FFD700;
  --color-green: #00FF9D;
  --color-red: #FF6B6B;
  --bg-deep: #0a0a0a;
  --bg-card: #141414;
  --bg-hover: #1e1e1e;
  --bg-selected: #282828;
  --bg-input: #1a1a1a;
  --border: #333;
  --border-light: #444;
  --text: #f0f0f0;
  --text-dim: #888;
  --accent: var(--color-primary);
  --accent-glow: rgba(0, 102, 255, 0.3);
  --success: var(--color-green);
  --warning: var(--color-gold);
  --error: var(--color-red);
  --folder: var(--color-gold);
  --file: var(--color-primary);
  --font-title: 'Venice', Georgia, serif;
  --font-body: 'Chalet', system-ui, sans-serif;
  --font-mono: 'Chalet', 'Consolas', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.5;
}

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

.app-header {
  background: linear-gradient(180deg, rgba(20,20,20,0.95) 0%, rgba(20,20,20,0.85) 100%);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.app-logo { display: flex; align-items: center; gap: 0.75rem; }
.app-logo .logo-img { width: 60px; height: 60px; }
.app-logo h1 { font-family: var(--font-title); font-size: 1.5rem; font-weight: normal; margin: 0; }

.connection-controls { display: flex; align-items: center; gap: 1rem; }
.status-indicator { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); transition: all 0.3s; }
.status-dot.connected { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-dot.streaming { background: var(--color-gold); box-shadow: 0 0 8px var(--color-gold); animation: pulse 1s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.tab-container { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
wa-tab-group { flex: 1; display: flex; flex-direction: column; min-height: 0; }
wa-tab-group::part(base) { height: 100%; display: flex; flex-direction: column; }
wa-tab-group::part(nav) { background: var(--bg-card); border-bottom: 1px solid var(--border); }
wa-tab-group::part(body) { flex: 1; overflow: hidden; }
wa-tab-panel { height: 100%; overflow: auto; padding: 0; }
wa-tab-panel::part(base) { height: 100%; padding: 1.5rem; }

.tab-content { max-width: 1200px; margin: 0 auto; height: 100%; display: flex; flex-direction: column; }
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; }

.log-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.log-header { padding: 0.75rem 1rem; background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; display: flex; align-items: center; justify-content: space-between; }
.log-content { padding: 1rem; max-height: 200px; overflow-y: auto; font-family: var(--font-mono); font-size: 0.8rem; line-height: 1.6; }
.log-content:empty::after { content: "No activity yet"; color: var(--text-dim); }
.log-entry { color: var(--text-dim); }
.log-entry.error { color: var(--error); }
.log-entry.success { color: var(--success); }
.log-entry.warning { color: var(--warning); }

.toolbar { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.breadcrumb { flex: 1; font-family: var(--font-mono); font-size: 0.9rem; color: var(--text-dim); display: flex; align-items: center; gap: 0.25rem; min-width: 200px; }
.breadcrumb button { background: none; border: none; color: var(--accent); cursor: pointer; padding: 0.25rem 0.5rem; font-family: inherit; font-size: inherit; }
.breadcrumb button:hover { color: var(--text); }

.file-list { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow-y: auto; flex: 1; min-height: 200px; max-height: 400px; }
.file-header { display: grid; grid-template-columns: 1fr 80px 280px; padding: 0.75rem 1rem; background: rgba(0,0,0,0.3); border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; position: sticky; top: 0; z-index: 1; }
.file-item { display: grid; grid-template-columns: 1fr 80px 280px; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background 0.15s; align-items: center; }
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--bg-hover); }
.file-name { display: flex; align-items: center; gap: 0.75rem; font-family: var(--font-mono); font-size: 0.9rem; }
.file-icon { font-size: 1.25rem; }
.file-icon.folder { color: var(--folder); }
.file-icon.file { color: var(--file); }
.file-size { font-family: var(--font-mono); font-size: 0.85rem; color: var(--text-dim); text-align: right; }
.file-actions { display: flex; gap: 0.5rem; justify-content: flex-end; opacity: 0; transition: opacity 0.15s; }
.file-item:hover .file-actions { opacity: 1; }
.file-actions button { background: transparent; border: 1px solid var(--border); color: var(--text-dim); padding: 0.25rem 0.5rem; border-radius: 4px; cursor: pointer; font-size: 0.75rem; font-family: var(--font-mono); }
.file-actions button:hover { border-color: var(--accent); color: var(--accent); }
.file-actions button.delete:hover { border-color: var(--error); color: var(--error); }

.empty-state { padding: 3rem; text-align: center; color: var(--text-dim); }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 1rem; opacity: 0.3; }

.stats-bar { display: flex; align-items: center; justify-content: space-between; padding: 1rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; margin-top: 1.5rem; font-family: var(--font-mono); font-size: 0.85rem; }
.stats-bar .usage { display: flex; align-items: center; gap: 1rem; }
.usage-bar { width: 200px; height: 6px; background: var(--bg-deep); border-radius: 3px; overflow: hidden; }
.usage-bar-fill { height: 100%; background: linear-gradient(90deg, var(--success) 0%, var(--accent) 100%); transition: width 0.3s; }

.upload-zone { border: 2px dashed var(--border); border-radius: 12px; padding: 3rem; text-align: center; margin-top: 1.5rem; transition: all 0.2s; cursor: pointer; }
.upload-zone:hover, .upload-zone.dragover { border-color: var(--accent); background: var(--accent-glow); }
.upload-zone svg { width: 48px; height: 48px; margin-bottom: 1rem; color: var(--text-dim); }
.upload-zone p { margin: 0; color: var(--text-dim); }
.upload-zone .hint { font-size: 0.85rem; margin-top: 0.5rem; }

.terminal { flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; font-family: var(--font-mono); font-size: 0.875rem; line-height: 1.5; overflow-y: auto; white-space: pre-wrap; word-break: break-word; min-height: 0; }
.terminal .line { margin: 0; }
.terminal .line.input { color: var(--success); }
.terminal .line.output { color: var(--text); }
.terminal .line.system { color: var(--accent); font-style: italic; }
.terminal .line.error { color: var(--error); }
.terminal .line.log-i { color: var(--success); }
.terminal .line.log-w { color: var(--warning); }
.terminal .line.log-e { color: var(--error); }

.input-container { display: flex; gap: 0.5rem; flex-shrink: 0; margin-top: 0.5rem; }
.prompt-label { font-family: var(--font-mono); font-size: 0.875rem; color: var(--success); padding: 0.75rem 0; user-select: none; }
.command-input { flex: 1; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; font-family: var(--font-mono); font-size: 0.875rem; color: var(--text); outline: none; }
.command-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
.command-input:disabled { opacity: 0.5; cursor: not-allowed; }
.command-input::placeholder { color: var(--text-dim); }
.console-hint { font-size: 0.75rem; color: var(--text-dim); text-align: center; padding: 0.5rem; flex-shrink: 0; }
.console-hint kbd { background: var(--bg-input); border: 1px solid var(--border); border-radius: 3px; padding: 0.1rem 0.4rem; font-family: var(--font-mono); font-size: 0.7rem; }

.display-content { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.display-container { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1.5rem; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.display-frame { background: #000; border-radius: 8px; padding: 8px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.5), 0 0 20px rgba(0,102,255,0.1); }
.display-frame canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }
.display-controls { display: flex; gap: 0.75rem; align-items: center; }
.scale-control { display: flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.scale-control select { background: var(--bg-deep); border: 1px solid var(--border); border-radius: 4px; color: var(--text); padding: 0.25rem 0.5rem; }
.stats-panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 1rem 1.5rem; font-family: var(--font-mono); font-size: 0.85rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.stat { display: flex; flex-direction: column; gap: 0.25rem; }
.stat-label { color: var(--text-dim); font-size: 0.75rem; text-transform: uppercase; }
.stat-value { font-size: 1.1rem; color: var(--accent); }

.updater-section { margin-bottom: 1.5rem; }
.updater-section h3 { font-family: var(--font-title); font-size: 1.1rem; font-weight: normal; margin: 0 0 0.5rem 0; }
.updater-section p { margin: 0 0 1rem 0; color: var(--text-dim); font-size: 0.9rem; }
.updater-section code { background: var(--bg-input); padding: 0.2rem 0.4rem; border-radius: 4px; font-family: var(--font-mono); font-size: 0.85rem; }
.progress-bar { height: 20px; background: var(--bg-deep); border-radius: 10px; overflow: hidden; margin-top: 10px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--success) 0%, var(--accent) 100%); width: 0%; transition: width 0.2s; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; opacity: 0; visibility: hidden; transition: all 0.2s; }
.modal-backdrop.open { opacity: 1; visibility: visible; }
.modal { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; min-width: 400px; max-width: 90vw; transform: translateY(-20px); transition: transform 0.2s; }
.modal-backdrop.open .modal { transform: translateY(0); }
.modal h2 { font-family: var(--font-title); margin: 0 0 1.5rem 0; font-weight: normal; }
.modal input[type="text"] { width: 100%; background: var(--bg-deep); border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem 1rem; color: var(--text); font-family: var(--font-mono); font-size: 0.9rem; margin-bottom: 1rem; }
.modal input[type="text"]:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; }

wa-button { --wa-button-font-family: var(--font-mono); }
wa-button[variant="brand"] { --wa-color-brand-600: var(--color-primary); }

/* MIDI Monitor Styles */
.midi-status-info { 
  display: flex; 
  align-items: center; 
  gap: 0.5rem; 
  font-family: var(--font-mono); 
  font-size: 0.85rem; 
  color: var(--text-dim);
}

.toolbar-spacer { flex: 1; }

.midi-list { 
  background: var(--bg-card); 
  border: 1px solid var(--border); 
  border-radius: 12px; 
  overflow-y: auto; 
  flex: 1; 
  min-height: 0;
}

.midi-list-header { 
  display: grid; 
  grid-template-columns: 100px 40px 40px 1fr 120px; 
  padding: 0.75rem 1rem; 
  background: rgba(0,0,0,0.3); 
  border-bottom: 1px solid var(--border); 
  font-family: var(--font-mono); 
  font-size: 0.75rem; 
  color: var(--text-dim); 
  text-transform: uppercase; 
  position: sticky; 
  top: 0; 
  z-index: 1;
}

.midi-item { 
  display: grid; 
  grid-template-columns: 100px 40px 40px 1fr 120px; 
  padding: 0.5rem 1rem; 
  border-bottom: 1px solid var(--border); 
  font-family: var(--font-mono); 
  font-size: 0.85rem;
  align-items: center;
}
.midi-item:last-child { border-bottom: none; }
.midi-item:hover { background: var(--bg-hover); }

.midi-item .time { color: var(--text-dim); font-size: 0.8rem; }
.midi-item .dir { text-align: center; font-size: 0.75rem; }
.midi-item .dir.out { color: var(--accent); }
.midi-item .dir.in { color: var(--success); }
.midi-item .channel { color: var(--accent); text-align: center; }
.midi-item .message { color: var(--text); }
.midi-item .value { color: var(--text-dim); text-align: right; }

/* Message type colors */
.midi-item.cc .message { color: #7dd3fc; }
.midi-item.note .message { color: var(--success); }
.midi-item.pc .message { color: var(--warning); }
.midi-item.mmc .message { color: #a78bfa; }
.midi-item.sysex .message { color: #c4b5fd; }
.midi-item.clock { opacity: 0.5; }
.midi-item.transport .message { color: var(--success); }

.midi-empty-state { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  justify-content: center; 
  gap: 1rem; 
  padding: 4rem 2rem; 
  color: var(--text-dim); 
  text-align: center; 
}
.midi-empty-state wa-icon { font-size: 3rem; opacity: 0.2; }
.midi-empty-state p { margin: 0; }

/* Clock button active state */
wa-button.active { 
  --wa-color-neutral-600: var(--accent); 
  border-color: var(--accent); 
}

.hidden { display: none !important; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

@media (max-width: 768px) {
  .app-header { flex-direction: column; gap: 0.75rem; }
  .connection-controls { width: 100%; justify-content: space-between; }
  .stats-panel { grid-template-columns: repeat(2, 1fr); }
  .file-header, .file-item { grid-template-columns: 1fr 60px; }
  .file-actions { display: none; }
}

/* Settings Tab */
.settings-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  max-height: 60vh;
  overflow-y: auto;
}

.settings-grid {
  display: flex;
  flex-direction: column;
}

.setting-row {
  display: grid;
  grid-template-columns: 200px 1fr 60px;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.setting-row:last-child {
  border-bottom: none;
}

.setting-row:hover {
  background: var(--bg-hover);
}

.setting-key {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.setting-value input,
.setting-value select {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: var(--bg-deep);
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.setting-value input:focus,
.setting-value select:focus {
  outline: none;
  border-color: var(--accent);
}

.setting-value input[readonly] {
  opacity: 0.6;
  cursor: not-allowed;
}

.setting-type {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: right;
}

@media (max-width: 768px) {
  .setting-row {
    grid-template-columns: 1fr 80px;
  }
  .setting-key {
    grid-column: 1 / -1;
    margin-bottom: 0.25rem;
  }
}

/* Config Tab (Schema-driven settings) */
.config-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.config-categories wa-details {
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.config-categories wa-details:last-child {
  border-bottom: none;
}

.config-categories wa-details::part(base) {
  background: var(--bg-card);
  border: none;
}

.config-categories wa-details::part(header) {
  padding: 0.75rem 1rem;
  font-weight: 600;
  background: var(--bg-deep);
  color: var(--text);
}

.config-categories wa-details::part(content) {
  padding: 0;
  background: var(--bg-card);
}

.config-category {
  display: flex;
  flex-direction: column;
}

.config-setting {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.config-setting:last-child {
  border-bottom: none;
}

.config-setting:hover {
  background: var(--bg-hover);
}

.config-setting-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.config-setting-label {
  font-weight: 500;
  color: var(--text);
}

.config-setting-desc {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.config-setting-control {
  min-width: 150px;
  text-align: right;
}

.config-setting-control wa-select {
  min-width: 150px;
}

.config-setting-control wa-input {
  max-width: 120px;
}

.config-calibration-note {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
  font-style: italic;
}

.config-calibration-note wa-icon {
  font-size: 1rem;
}

@media (max-width: 768px) {
  .config-setting {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
  .config-setting-control {
    text-align: left;
  }
}

/* Factory Reset / Danger Zone */
.danger-zone {
  border-color: var(--error);
  background: rgba(239, 68, 68, 0.05);
}

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

.factory-reset-dialog-content {
  text-align: center;
  padding: 1rem 0;
}

.factory-reset-dialog-content .warning-icon {
  font-size: 3rem;
  color: var(--warning);
  margin-bottom: 1rem;
}

.factory-reset-dialog-content p {
  margin: 0.5rem 0;
}

.factory-reset-dialog-content .hint {
  font-size: 0.85rem;
  color: var(--text-dim);
}

wa-dialog[data-updater-target="factoryResetDialog"]::part(footer) {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ============================================================================
   Scenes Tab
   ============================================================================ */

.scenes-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.scenes-section {
  padding: 0;
}

.scenes-section-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}

.scenes-section-header wa-icon {
  color: var(--text-dim);
}

.scenes-section.inactive .scenes-section-header {
  color: var(--text-dim);
}

.scene-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.scene-row {
  display: grid;
  grid-template-columns: auto 40px 1fr auto;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.15s ease;
}

.scene-row:last-child {
  border-bottom: none;
}

.scene-row:hover {
  background: var(--bg-hover);
}

.scene-row.dragging {
  opacity: 0.5;
  background: var(--bg-deep);
}

.scene-row.drag-over {
  border-top: 2px solid var(--brand);
  padding-top: calc(0.75rem - 2px);
}

.scene-drag-handle {
  cursor: grab;
  color: var(--text-dim);
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene-drag-handle:active {
  cursor: grabbing;
}

.scenes-section.inactive .scene-drag-handle {
  visibility: hidden;
}

.scene-position {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-deep);
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dim);
}

.scene-row.current .scene-position {
  background: var(--brand);
  color: white;
}

.scenes-section.inactive .scene-position {
  background: transparent;
  color: var(--text-dim);
  opacity: 0.5;
}

.scene-name {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--text);
  min-width: 0;
}

.scene-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenes-section.inactive .scene-name {
  color: var(--text-dim);
}

.scene-name-input {
  flex: 1;
  min-width: 0;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--brand);
  border-radius: 4px;
  background: var(--bg-deep);
  color: var(--text);
  font-size: inherit;
  font-family: inherit;
}

.scene-name-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

.scene-actions {
  display: flex;
  gap: 0.25rem;
}

.scene-actions wa-button {
  font-size: 0.9rem;
}

.scene-actions wa-button::part(base) {
  color: var(--text-dim);
  padding: 0.25rem;
  min-width: auto;
}

.scene-actions wa-button::part(base):hover {
  color: var(--text);
}

.scene-actions wa-button.danger::part(base):hover {
  color: var(--error);
}

/* Scenes Delete Dialog */
.scenes-delete-dialog-content {
  text-align: center;
  padding: 1rem 0;
}

.scenes-delete-dialog-content .warning-icon {
  font-size: 3rem;
  color: var(--warning);
  margin-bottom: 1rem;
}

.scenes-delete-dialog-content p {
  margin: 0.5rem 0;
}

.scenes-delete-dialog-content .hint {
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* Scenes Name Dialog */
.scenes-name-dialog-content {
  padding: 0.5rem 0;
}

.scenes-name-dialog-content wa-input {
  width: 100%;
}

.scenes-name-dialog-content .name-error {
  color: var(--wa-color-danger-600);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2em;
}

.scenes-name-dialog-content wa-input.shake {
  animation: shake 0.4s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

wa-dialog[data-scenes-target="deleteDialog"]::part(footer),
wa-dialog[data-scenes-target="nameDialog"]::part(footer) {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Empty scenes section */
.scenes-empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
}

/* ==========================================================================
   INFO TAB STYLES
   ========================================================================== */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-bottom: 1px solid var(--border);
}

.info-card-header wa-icon {
  font-size: 1.25rem;
  color: var(--accent);
}

.info-card-header h3 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: normal;
}

.info-card-body {
  padding: 1.25rem;
}

.info-card-body .empty-state {
  padding: 2rem;
}

.info-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.info-value {
  color: var(--text);
  font-size: 0.9rem;
  text-align: right;
}

.info-value.mono {
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.info-card-actions {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ==========================================================================
   PEDALS TAB STYLES
   ========================================================================== */

.pedals-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 1.5rem;
  min-height: 0;
  flex: 1;
}

@media (max-width: 900px) {
  .pedals-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
}

/* Pedal Tree (left panel) */
.pedals-tree {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-y: auto;
  max-height: 600px;
}

.pedals-tree .empty-state {
  padding: 2rem;
}

.pedal-tree {
  padding: 0.5rem;
}

.pedal-tree wa-details {
  margin-bottom: 0.25rem;
}

.pedal-tree wa-details::part(header) {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 6px;
}

.pedal-tree wa-details::part(content) {
  padding: 0.25rem 0 0.5rem 0;
}

.pedal-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pedal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.pedal-item:hover {
  background: var(--bg-hover);
}

.pedal-item.selected {
  background: var(--bg-selected);
  border: 1px solid var(--accent);
}

.pedal-item.current {
  color: var(--success);
}

.pedal-item .pedal-name {
  font-size: 0.875rem;
}

.pedal-item .current-icon {
  color: var(--success);
  font-size: 0.75rem;
}

/* Pedal Detail (right panel) */
.pedals-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow-y: auto;
  max-height: 600px;
}

.pedals-detail .empty-state,
.pedals-detail .loading-state {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-dim);
}

.pedals-detail .loading-state wa-spinner {
  font-size: 2rem;
}

.pedal-detail {
  padding: 1.5rem;
}

.pedal-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.pedal-detail-title h2 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: normal;
}

.pedal-detail-subtitle {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.current-badge {
  background: var(--success);
  color: var(--bg-deep);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.pedal-detail-section {
  margin-bottom: 1.5rem;
}

.pedal-detail-section h3 {
  margin: 0 0 0.75rem 0;
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: normal;
  color: var(--accent);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.detail-item {
  background: rgba(0, 0, 0, 0.15);
  padding: 0.75rem;
  border-radius: 6px;
}

.detail-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--text);
}

/* CC Table */
.cc-table-container {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.cc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.cc-table thead {
  background: rgba(0, 0, 0, 0.3);
}

.cc-table th {
  padding: 0.75rem;
  text-align: left;
  font-weight: normal;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.cc-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.cc-table tbody tr:last-child td {
  border-bottom: none;
}

.cc-table tbody tr:hover {
  background: var(--bg-hover);
}

.cc-table .cc-number {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}

.cc-table .cc-values {
  font-size: 0.8rem;
  color: var(--text-dim);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pedal-detail-actions {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Toolbar search input */
.toolbar wa-input {
  min-width: 200px;
}

.toolbar wa-input::part(base) {
  background: var(--bg-deep);
  border-color: var(--border);
}

.toolbar wa-input::part(input) {
  font-size: 0.875rem;
}
