/* ==========================================================================
   MEDIA TOOLS — PRODUCTION QUALITY SAAS VIDEO EDITOR DESIGN SYSTEM
   ========================================================================== */

:root {
  --mt-bg-canvas: #09090b;
  --mt-bg-surface: #121217;
  --mt-bg-panel: #181820;
  --mt-bg-card: #1f1f2c;
  --mt-bg-hover: #262638;
  
  --mt-border: #27273a;
  --mt-border-light: #36364f;
  --mt-border-focus: #7c3aed;
  
  --mt-accent: #7c3aed;
  --mt-accent-light: #8b5cf6;
  --mt-accent-glow: rgba(124, 58, 237, 0.35);
  --mt-accent-gradient: linear-gradient(135deg, #6d28d9 0%, #7c3aed 45%, #a855f7 100%);
  
  --mt-text: #f8fafc;
  --mt-text-secondary: #94a3b8;
  --mt-text-muted: #64748b;
  
  --mt-success: #10b981;
  --mt-warning: #f59e0b;
  --mt-danger: #ef4444;
  
  --mt-radius-sm: 8px;
  --mt-radius: 14px;
  --mt-radius-lg: 20px;
  --mt-radius-xl: 28px;
  
  --mt-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  --mt-shadow-glow: 0 0 25px rgba(124, 58, 237, 0.25);
  --mt-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   BASE & PAGE WRAPPER
   ========================================================================== */

.mt-editor-app {
  font-family: var(--mt-font);
  color: var(--mt-text);
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  box-sizing: border-box;
}

.mt-editor-app * {
  box-sizing: border-box;
}

/* ==========================================================================
   PAGE HEADER
   ========================================================================== */

.mt-page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.mt-tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #c4b5fd;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  margin-bottom: 0.75rem;
}

.mt-title {
  font-size: clamp(2rem, 4vw + 1rem, 3.25rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.05;
  color: #0f172a;
  margin: 0 0 0.75rem;
}

.dark .mt-title,
.mt-dark-mode .mt-title {
  color: #f8fafc;
}

.mt-gradient-text {
  background: var(--mt-accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-subtitle {
  color: #64748b;
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ==========================================================================
   CONVERTER-STYLE UPLOAD CARD
   ========================================================================== */

.mt-upload-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--mt-radius-xl);
  padding: 2.5rem 1.5rem;
  box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.05);
  text-align: center;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
}

.mt-upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--mt-radius-lg);
  padding: 3rem 1.5rem;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.mt-upload-dropzone:hover,
.mt-upload-dropzone.drag-active {
  border-color: var(--mt-accent);
  background: #faf5ff;
  transform: scale(1.005);
}

.mt-upload-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #ede9fe;
  color: var(--mt-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.15);
  transition: transform 0.25s ease;
}

.mt-upload-dropzone:hover .mt-upload-icon-circle {
  transform: translateY(-4px) scale(1.05);
}

.mt-upload-btn {
  background: var(--mt-accent-gradient);
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  padding: 0.9rem 2.2rem;
  border-radius: var(--mt-radius);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.25s ease;
}

.mt-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.45);
}

.mt-upload-hints {
  margin-top: 1rem;
  font-size: 0.82rem;
  color: #94a3b8;
}

/* Selected File Pill */
.mt-selected-file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 540px;
  margin: 1.5rem auto 0;
  padding: 0.85rem 1.25rem;
  background: #ede9fe;
  border: 1px solid #ddd6fe;
  border-radius: var(--mt-radius);
  text-align: left;
}

.mt-file-info-group {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.mt-file-name {
  font-weight: 700;
  color: #4c1d95;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mt-file-meta {
  font-size: 0.75rem;
  color: #7c3aed;
  margin-top: 0.15rem;
}

.mt-remove-btn {
  background: #ffffff;
  border: 1px solid #ddd6fe;
  color: #7c3aed;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.mt-remove-btn:hover {
  background: #7c3aed;
  color: #ffffff;
}

/* ==========================================================================
   DARK STUDIO EDITOR SHELL
   ========================================================================== */

.mt-editor-shell {
  background: var(--mt-bg-surface);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 50px -15px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

/* Studio Top Bar */
.mt-top-bar {
  background: var(--mt-bg-panel);
  border-bottom: 1px solid var(--mt-border);
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.mt-top-bar-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mt-change-file-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--mt-border);
  color: var(--mt-text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--mt-radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s;
}

.mt-change-file-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--mt-text);
  border-color: var(--mt-border-light);
}

.mt-active-tool-title {
  font-weight: 800;
  font-size: 1rem;
  color: var(--mt-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mt-top-bar-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.75rem;
}

.mt-meta-pill {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--mt-border);
  color: var(--mt-text-muted);
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-family: monospace;
}

.mt-top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mt-reset-btn {
  background: transparent;
  border: 1px solid var(--mt-border);
  color: var(--mt-text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--mt-radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.mt-reset-btn:hover {
  color: var(--mt-text);
  border-color: var(--mt-border-light);
}

/* ==========================================================================
   MAIN EDITOR WORKSPACE (70 / 30 SPLIT)
   ========================================================================== */

.mt-workspace {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 580px;
}

@media (max-width: 1024px) {
  .mt-workspace {
    grid-template-columns: 1fr;
  }
}

/* Left / Center Preview Stage */
.mt-stage-area {
  background: var(--mt-bg-canvas);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
}

.mt-canvas-container {
  flex: 1;
  min-height: 400px;
  background: #000000;
  border-radius: var(--mt-radius);
  border: 1px solid var(--mt-border);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.mt-video-player {
  max-width: 100%;
  max-height: 520px;
  display: block;
  object-fit: contain;
  background: #000000;
  border-radius: var(--mt-radius-sm);
}

/* Custom Playback Controls Bar */
.mt-playbar {
  margin-top: 1rem;
  background: var(--mt-bg-panel);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.mt-play-pause-btn {
  background: var(--mt-accent);
  color: #ffffff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s, background 0.2s;
}

.mt-play-pause-btn:hover {
  transform: scale(1.08);
  background: var(--mt-accent-light);
}

.mt-scrubber-track {
  flex: 1;
  position: relative;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  cursor: pointer;
}

.mt-scrubber-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--mt-accent);
  border-radius: 3px;
  pointer-events: none;
}

.mt-time-display {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--mt-text-secondary);
  white-space: nowrap;
}

/* Right Control Panel */
.mt-control-panel {
  background: var(--mt-bg-panel);
  border-left: 1px solid var(--mt-border);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  overflow-y: auto;
}

.mt-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mt-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--mt-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Preset Chips */
.mt-chip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.mt-chip {
  background: var(--mt-bg-card);
  border: 1px solid var(--mt-border);
  color: var(--mt-text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.6rem 0.75rem;
  border-radius: var(--mt-radius-sm);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.mt-chip:hover {
  background: var(--mt-bg-hover);
  color: var(--mt-text);
  border-color: var(--mt-border-light);
}

.mt-chip.active {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--mt-accent);
  color: #c4b5fd;
  box-shadow: 0 0 15px rgba(124, 58, 237, 0.25);
}

/* Sliders */
.mt-range-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.mt-range-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--mt-text-secondary);
}

.mt-range-val {
  font-weight: 700;
  color: var(--mt-text);
  font-family: monospace;
}

.mt-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--mt-bg-card);
  border-radius: 3px;
  outline: none;
}

.mt-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--mt-accent);
  cursor: pointer;
  box-shadow: 0 0 8px var(--mt-accent-glow);
  transition: transform 0.15s;
}

.mt-range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Select Dropdown */
.mt-select {
  width: 100%;
  background: var(--mt-bg-card);
  border: 1px solid var(--mt-border);
  color: var(--mt-text);
  padding: 0.65rem 0.9rem;
  border-radius: var(--mt-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.mt-select:focus {
  border-color: var(--mt-accent);
}

/* Bottom Action Area */
.mt-actions {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--mt-border);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.mt-process-btn {
  background: var(--mt-accent-gradient);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.95rem 1.5rem;
  border-radius: var(--mt-radius);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.25s;
}

.mt-process-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.5);
}

.mt-process-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==========================================================================
   PROCESSING STATE
   ========================================================================== */

.mt-processing-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(8px);
  z-index: 50;
  border-radius: var(--mt-radius);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.mt-processing-overlay.show {
  display: flex;
}

.mt-spinner-radar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid rgba(124, 58, 237, 0.2);
  border-top-color: var(--mt-accent);
  animation: mt-spin 0.8s linear infinite;
  margin-bottom: 1.25rem;
  box-shadow: 0 0 25px rgba(124, 58, 237, 0.4);
}

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

.mt-processing-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--mt-text);
  margin-bottom: 0.4rem;
}

.mt-processing-subtitle {
  font-size: 0.85rem;
  color: var(--mt-text-secondary);
  max-width: 320px;
  line-height: 1.5;
}

/* ==========================================================================
   SUCCESS / RESULT CARD
   ========================================================================== */

.mt-result-card {
  display: none;
  background: var(--mt-bg-panel);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-lg);
  padding: 2rem;
  margin-top: 1.5rem;
  text-align: center;
}

.mt-result-card.show {
  display: block;
}

.mt-result-badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--mt-success);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.mt-result-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--mt-text);
  margin-bottom: 0.4rem;
}

.mt-result-preview-video {
  max-width: 100%;
  max-height: 420px;
  border-radius: var(--mt-radius);
  background: #000000;
  margin: 1.25rem auto;
  display: block;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.mt-download-btn {
  background: var(--mt-accent-gradient);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 0.95rem 2.5rem;
  border-radius: var(--mt-radius);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: 0 8px 25px rgba(124, 58, 237, 0.35);
  transition: all 0.25s;
}

.mt-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(124, 58, 237, 0.5);
}

/* ==========================================================================
   TOAST NOTIFICATION (5s Auto-dismiss)
   ========================================================================== */

.mt-toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  background: #1e1b4b;
  border: 1px solid #6366f1;
  color: #e0e7ff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--mt-radius);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  transform: translateY(-12px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.mt-toast.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.mt-toast.error {
  background: #450a0a;
  border-color: #ef4444;
  color: #fef2f2;
}

/* ==========================================================================
   TIMELINE (For Trim & Cut)
   ========================================================================== */

.mt-timeline-container {
  margin-top: 1rem;
  background: var(--mt-bg-panel);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  padding: 1rem 1.25rem;
}

.mt-timeline-track {
  height: 48px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--mt-border);
  user-select: none;
}

.mt-timeline-window {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(124, 58, 237, 0.25);
  border-top: 2px solid var(--mt-accent);
  border-bottom: 2px solid var(--mt-accent);
  cursor: grab;
}

.mt-timeline-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  background: var(--mt-accent);
  cursor: ew-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 4px;
}

.mt-timeline-handle::after {
  content: "";
  width: 2px;
  height: 18px;
  background: #ffffff;
  border-radius: 1px;
}

.mt-handle-left {
  left: 0;
  transform: translateX(-50%);
}

/* ==== INFO CARD STYLING ==== */
.mt-info-cards {
  margin-top: 2rem;
  padding: 1rem 0;
}

.mt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.mt-card {
  background: var(--mt-bg-card);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius);
  padding: 1.25rem;
  text-align: left;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.mt-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
  border-color: var(--mt-accent);
}

.mt-card-icon {
  margin-bottom: 0.75rem;
  color: var(--mt-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.12);
}

.mt-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--mt-text);
  margin-bottom: 0.35rem;
}

.mt-card-description {
  font-size: 0.82rem;
  color: var(--mt-text-secondary);
  line-height: 1.45;
}

/* ==== INSTRUCTION SECTIONS ==== */
.mt-instructions-section {
  margin-top: 2.5rem;
  padding: 1.75rem;
  background: var(--mt-bg-panel);
  border: 1px solid var(--mt-border);
  border-radius: var(--mt-radius-lg);
}

.mt-instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.mt-instruction-col h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--mt-accent);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mt-instruction-col ol,
.mt-instruction-col ul {
  padding-left: 1.25rem;
  color: var(--mt-text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}

.mt-instruction-col li {
  margin-bottom: 0.5rem;
}

