/* MotionForge Studio - Dark Professional Theme */
:root {
  --bg-root: #090B0A;
  --bg-panel-main: #111512;
  --bg-panel-sub: #171C18;
  --border-color: #293129;
  --accent-brand: #B6FF39;
  --accent-brand-hover: #9ee622;
  --text-main: #F2F5EF;
  --text-muted: #8E9990;
  --color-error: #FF5D5D;
  --color-warning: #FFB547;
  --color-success: #72E06A;

  --font-family: Inter, "Noto Sans TC", -apple-system, BlinkMacSystemFont, sans-serif;
  --radius-lg: 12px;
  --radius-md: 8px;
  --radius-sm: 4px;
  --shadow-main: 0 10px 30px rgba(0, 0, 0, 0.5);
  --transition-fast: 0.2s ease;
}

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

body {
  background-color: var(--bg-root);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--bg-panel-main);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-brand);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 900;
  font-size: 18px;
}

.brand-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-title span {
  color: var(--accent-brand);
}

.brand-tagline {
  font-size: 12px;
  color: var(--text-muted);
}

/* Main Layout */
.main-container {
  flex: 1;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}

@media (max-width: 992px) {
  .main-container {
    grid-template-columns: 1fr;
  }
}

/* Panels */
.panel {
  background: var(--bg-panel-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-main);
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;

}

.panel-title::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--accent-brand);
  border-radius: 2px;
}

/* Left Sidebar Instructions */
.info-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.info-card {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
}

.info-card h4 {
  font-size: 14px;
  color: var(--accent-brand);
  margin-bottom: 6px;
}

.info-card p {
  font-size: 13px;
  color: var(--text-muted);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-main);
}

.feature-badge {
  background: rgba(182, 255, 57, 0.15);
  color: var(--accent-brand);
  border: 1px solid rgba(182, 255, 57, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
}

/* Drop Zone */
.dropzone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 20px;
  text-align: center;
  background: var(--bg-panel-sub);
  cursor: pointer;
  transition: var(--transition-fast);
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--accent-brand);
  background: rgba(182, 255, 57, 0.04);
}

.dropzone-icon {
  font-size: 36px;
  margin-bottom: 12px;
  color: var(--accent-brand);
}

.dropzone-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

.dropzone-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.file-input {
  display: none;
}

/* Controls Grid */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control, .form-select {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent-brand);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.btn-primary {
  background: var(--accent-brand);
  color: #000;
}

.btn-primary:hover {
  background: var(--accent-brand-hover);
  box-shadow: 0 0 15px rgba(182, 255, 57, 0.4);
}

.btn-secondary {
  background: var(--bg-panel-sub);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: rgba(255, 93, 93, 0.15);
  color: var(--color-error);
  border: 1px solid rgba(255, 93, 93, 0.3);
}

.btn-danger:hover {
  background: rgba(255, 93, 93, 0.3);
}

.btn-sm {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-block {
  width: 100%;
}

/* Frame Manager Grid */
.frames-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.frames-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.frame-card {
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: var(--transition-fast);
  user-select: none;
}

.frame-card:hover {
  border-color: var(--accent-brand);
}

.frame-thumb {
  width: 100%;
  height: 90px;
  object-fit: contain;
  background: #000;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}

.frame-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.frame-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: var(--accent-brand);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.frame-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.frame-duration-input {
  width: 50px;
  padding: 2px 4px;
  font-size: 11px;
  text-align: center;
  background: var(--bg-root);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

/* Canvas Preview Window */
.preview-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #000;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  position: relative;
}

canvas#previewCanvas {
  max-width: 100%;
  max-height: 400px;
  border-radius: var(--radius-sm);
  background-image: repeating-linear-gradient(45deg, #181818 25%, transparent 25%, transparent 75%, #181818 75%, #181818), repeating-linear-gradient(45deg, #181818 25%, #111 25%, #111 75%, #181818 75%, #181818);
  background-position: 0 0, 9px 9px;
  background-size: 18px 18px;
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 12px;
  gap: 12px;
}

.player-buttons {
  display: flex;
  gap: 6px;
}

.player-status {
  font-size: 12px;
  color: var(--text-muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-panel-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-main);
  text-align: center;
}

.progress-bar-bg {
  width: 100%;
  height: 10px;
  background: var(--bg-panel-sub);
  border-radius: 5px;
  overflow: hidden;
  margin: 16px 0;
  border: 1px solid var(--border-color);
}

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

/* Footer */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

/* Source Entrance Cards */
.source-card {
  transition: var(--transition-fast);
}

.source-card:hover {
  border-color: var(--accent-brand) !important;
}

.source-card.active {
  border-color: var(--accent-brand) !important;
  background: rgba(182, 255, 57, 0.05) !important;
}

/* ZIP Preview Modal */
.modal-content-lg {
  max-width: 840px !important;
  width: 95% !important;
  text-align: left !important;
}

.zip-entries-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  margin: 16px 0;
  padding-right: 4px;
}

.zip-entry-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-panel-sub);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 13px;
}

.zip-entry-row.disabled {
  opacity: 0.5;
  background: rgba(0, 0, 0, 0.3);
}

.zip-entry-icon {
  width: 32px;
  height: 32px;
  background: #000;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.zip-entry-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.zip-entry-name {
  font-weight: 600;
  color: var(--text-main);
}

.zip-entry-path {
  font-size: 11px;
  color: var(--text-muted);
}

