/**
 * story-fab — AIVideoEditor Page Styles
 * AI Cinema Studio Design
 */

// Design tokens
@bg-base: #0C0D14;
@bg-surface: #141520;
@bg-elevated: #1C1D2E;
@bg-overlay: #24263A;
@border-subtle: #1E2030;
@border-default: #2A2D42;
@border-strong: #3D4166;
@accent: #FF9F43;
@accent-light: #FFBE76;
@accent-dark: #E8891C;
@accent-glow: rgba(255, 159, 67, 0.2);
@accent-glow-strong: rgba(255, 159, 67, 0.35);
@cyan: #00D4FF;
@cyan-light: #66E3FF;
@cyan-dark: #00A8CC;
@cyan-glow: rgba(0, 212, 255, 0.2);
@text-primary: #F0F0F5;
@text-secondary: #8888A0;
@text-tertiary: #55556A;
@font-display: 'Outfit', system-ui, sans-serif;
@font-body: 'Figtree', system-ui, sans-serif;
@radius-sm: 4px;
@radius-md: 8px;
@radius-lg: 12px;
@radius-xl: 16px;
@transition-fast: 120ms;
@transition-default: 200ms;
@transition-slow: 350ms;

// ── Editor Shell ──

.editorContainer {
  height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  background: @bg-base;
  animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

// ── Three-Zone Layout ──

.editorBody {
  flex: 1;
  display: flex;
  overflow: hidden;
  gap: 0;
}

// ── Left: AI Workflow Panel ──

.workflowPanel {
  width: 260px;
  min-width: 260px;
  background: @bg-surface;
  border-right: 1px solid @border-subtle;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width @transition-slow;
}

.panelHeader {
  padding: 16px 20px;
  border-bottom: 1px solid @border-subtle;
  flex-shrink: 0;

  h3 {
    font-family: @font-display;
    font-size: 13px;
    font-weight: 600;
    color: @text-secondary;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0;
  }
}

// ── Center: Preview Area ──

.previewArea {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: @bg-base;
  padding: 24px;
  gap: 16px;
  overflow: auto;
}

// ── Right: Clip Panel ──

.clipPanel {
  width: 300px;
  min-width: 300px;
  background: @bg-surface;
  border-left: 1px solid @border-subtle;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width @transition-slow;
}

// ── Function Tab Cards ──

.tabHeader {
  padding: 20px 24px;
  background: @bg-surface;
  border-bottom: 1px solid @border-subtle;
}

.functionCards {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.functionCard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: @bg-elevated;
  border: 1px solid @border-default;
  border-radius: @radius-lg;
  cursor: pointer;
  transition: all @transition-default;
  min-width: 220px;

  &:hover {
    border-color: @accent;
    box-shadow: 0 0 16px @accent-glow;
    transform: translateY(-1px);
  }

  &.active {
    border-color: @accent;
    background: rgba(255, 159, 67, 0.08);
    box-shadow: 0 0 20px @accent-glow-strong;

    .functionIcon {
      color: @accent;
    }

    .functionName {
      color: @accent;
    }
  }
}

.functionIcon {
  font-size: 22px;
  color: @text-tertiary;
  transition: color @transition-default;
  flex-shrink: 0;
}

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

.functionName {
  font-family: @font-display;
  font-size: 13px;
  font-weight: 600;
  color: @text-primary;
  transition: color @transition-default;
  white-space: nowrap;
}

.functionDesc {
  font-size: 11px;
  color: @text-tertiary;
  white-space: nowrap;
}

.tabLabel {
  display: flex;
  align-items: center;
  gap: 6px;
}

// ── Steps Panel ──

.stepsPanel {
  padding: 16px;
  flex: 1;
}

.stepItem {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: @radius-md;
  cursor: pointer;
  transition: all @transition-default;
  position: relative;

  &:hover {
    background: @bg-elevated;
  }

  &.active {
    background: rgba(255, 159, 67, 0.08);

    .stepIcon {
      color: @accent;
      box-shadow: 0 0 12px @accent-glow;
    }

    .stepTitle {
      color: @accent;
    }
  }

  &.done {
    .stepIcon {
      color: @cyan;
      background: rgba(0, 212, 255, 0.1);
    }
  }
}

.stepIcon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: @bg-elevated;
  border: 1px solid @border-default;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: @text-tertiary;
  flex-shrink: 0;
  transition: all @transition-default;
}

.stepContent {
  flex: 1;
  min-width: 0;
}

.stepTitle {
  font-family: @font-display;
  font-size: 13px;
  font-weight: 600;
  color: @text-primary;
  transition: color @transition-default;
}

.stepDesc {
  font-size: 11px;
  color: @text-tertiary;
  margin-top: 2px;
}

// ── Clip Cards ──

.clipCard {
  padding: 12px;
  background: @bg-elevated;
  border: 1px solid @border-subtle;
  border-radius: @radius-md;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all @transition-default;

  &:hover {
    border-color: @cyan;
    box-shadow: 0 0 12px @cyan-glow;
  }

  &.selected {
    border-color: @accent;
    box-shadow: 0 0 12px @accent-glow;
  }
}

// ── Responsive ──

@media (max-width: 1280px) {
  .workflowPanel { width: 60px; min-width: 60px; }
  .clipPanel { width: 260px; min-width: 260px; }
  .panelHeader h3 { display: none; }
  .stepContent { display: none; }
  .stepDesc { display: none; }
}

@media (max-width: 1024px) {
  .clipPanel { display: none; }
  .editorBody { justify-content: center; }
}

@media (max-width: 768px) {
  .workflowPanel { display: none; }
  .functionCards { flex-direction: column; align-items: stretch; }
  .functionCard { min-width: unset; }
}
