/* ── Top Bar ── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 38px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  z-index: 100;
  gap: 16px;
}

.topbar-brand {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

.topbar-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
}

.topbar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.topbar-nav:hover {
  border-color: var(--border);
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.topbar-nav:active {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: var(--accent);
}

.topbar-nav:disabled {
  opacity: 0.25;
  pointer-events: none;
}

.topbar-file {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}

.topbar-file:hover {
  border-color: var(--border);
  background: var(--bg-tertiary);
}

.topbar-file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-btn {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.topbar-btn:hover {
  background: var(--bg-primary);
  color: var(--text-primary);
  border-color: var(--accent);
}

.topbar-btn.primary {
  border-color: var(--accent);
  color: var(--accent);
}

.topbar-btn.primary:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

.topbar-btn.warn {
  border-color: var(--warn);
  color: var(--warn);
}

.topbar-btn.warn:hover {
  background: var(--warn);
  color: var(--bg-primary);
}

.topbar-btn.success {
  border-color: var(--success);
  color: var(--success);
}

.topbar-btn.success:hover {
  background: var(--success);
  color: var(--bg-primary);
}

/* ── Right Tool Strip ── */
.toolstrip {
  position: fixed;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  opacity: 1;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.toolstrip.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.tool-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
  position: relative;
}

.tool-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.tool-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

.tool-btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-sep {
  height: 1px;
  background: var(--border);
  margin: 2px 3px;
}

.tool-btn .tooltip {
  position: absolute;
  right: 40px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.tool-btn:hover .tooltip { opacity: 1; }

/* ── Bottom Bar ── */
.bottombar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 28px;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 14px;
  z-index: 100;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-dim);
  gap: 16px;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

.bottombar-sep {
  width: 1px;
  height: 12px;
  background: var(--border);
}

/* ── Confirm Dialog ── */
#confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 950;
  align-items: center;
  justify-content: center;
}
#confirm-overlay.visible {
  display: flex;
}
#confirm-dialog {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px 28px;
  text-align: center;
  max-width: 380px;
}
#confirm-dialog p {
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 18px;
  line-height: 1.5;
  font-family: 'JetBrains Mono', monospace;
}
#confirm-dialog .btn-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}
#confirm-dialog button {
  padding: 7px 18px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}
#confirm-dialog button:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}
#confirm-dialog .btn-confirm {
  background: rgba(255,60,60,0.2);
  color: var(--warn);
  border-color: var(--warn);
}
#confirm-dialog .btn-confirm:hover {
  background: var(--warn);
  color: var(--bg-primary);
}
#confirm-dialog .btn-confirm.detox {
  background: rgba(255,160,40,0.2);
  color: #ffbe50;
  border-color: #ffa028;
}
#confirm-dialog .btn-confirm.detox:hover {
  background: #ffa028;
  color: var(--bg-primary);
}

/* ── Toast Notification ── */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 8px 20px;
  border-radius: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
#toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Drop Zone Overlay ── */
.dropzone-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 14, 0.85);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.dropzone-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.dropzone-box {
  width: 420px;
  height: 260px;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--accent-dim);
  box-shadow: 0 0 60px var(--accent-glow);
}

.dropzone-overlay.active .dropzone-box {
  animation: dropPulse 1.5s ease-in-out infinite;
}

.dropzone-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
}

.dropzone-text {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 1px;
}

.dropzone-sub {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ── Loading Spinner ── */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 14, 0.6);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.loader-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.loader-ring {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── About Modal ── */
.about-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 14, 0.7);
  backdrop-filter: blur(4px);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.about-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.about-window {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 32px 48px;
  text-align: center;
  position: relative;
  min-width: 280px;
}

.about-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.15s;
  line-height: 1;
}

.about-close:hover {
  color: var(--text-primary);
}

.about-title {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
}

.about-version {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.about-year {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.about-contact {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
}

.about-links {
  margin-top: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
}

.about-links a {
  color: var(--accent);
  text-decoration: none;
  transition: opacity 0.15s;
}

.about-links a:hover {
  opacity: 0.75;
  text-decoration: underline;
}

.about-link-sep {
  color: var(--text-dim);
  margin: 0 6px;
}

/* ── Panel shared styles ── */
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.panel-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-primary);
}

.panel-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s;
}

.panel-close:hover {
  color: var(--text-primary);
}

.panel-content {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

.panel-section {
  margin-bottom: 16px;
}

.panel-label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Scrollbar */
.panel-content::-webkit-scrollbar {
  width: 6px;
}

.panel-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

.panel-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

.panel-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-dim);
}

/* ── Hidden file input ── */
#file-input, #anim-file-input { display: none; }

/* ── Animations ── */
@keyframes dropPulse {
  0%, 100% { box-shadow: 0 0 40px var(--accent-glow); }
  50% { box-shadow: 0 0 80px var(--accent-glow); }
}

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