/* ═══════════════════════════════════════════════════════════════
   Editor Layout — 3-column grid: Modes | Dashboard | Workspace
   AI Design Club — v1.0
   ═══════════════════════════════════════════════════════════════ */

/* ── Grid ── */
.aidc-layout--editor-3col {
  display: grid !important;
  grid-template-columns: 220px 300px minmax(0, 1fr);
  gap: 0;
  min-height: calc(100vh - var(--header-h, 64px));
  width: 100%;
  padding: 0;
}
.aidc-layout--editor-3col > * {
  min-width: 0;
  min-height: 0;
}

/* ── Column 1: Modes ── */
.ed-col--modes {
  grid-column: 1;
  border-right: 1px solid rgba(255,255,255,0.06);
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  background: rgba(9,9,16,0.97);
}
.ed-modes-title {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d5d5e2;
  margin-bottom: 2px;
}
.ed-modes-sub {
  font-size: 11px;
  color: #9696aa;
  margin-bottom: 8px;
}

/* Mode items */
.ed-modes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* "↩ Все режимы" reset button — shown when modes are filtered */
.ed-modes-reset-btn {
  display: none;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  color: #b0b0cc;
  font-size: 11px;
  padding: 5px 10px;
  margin: 4px 0 2px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  width: 100%;
  text-align: left;
}
.ed-modes-reset-btn:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
}

/* Group labels (Изображения / Видео) */
.ed-modes-group-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #7a7a9a;
  padding: 6px 4px 2px;
  margin-top: 4px;
  user-select: none;
}
.ed-modes-group-label:first-child {
  margin-top: 0;
}

.ed-mode {
  border-radius: 12px;
  padding: 8px 10px;
  background: rgba(15,15,24,0.96);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ed-mode:hover {
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.03);
}
.ed-mode.active {
  border-color: rgba(255,255,255,0.32);
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,0,140,0.18));
  box-shadow: 0 0 0 1px rgba(255,0,140,0.5);
}
.ed-mode__top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ed-mode__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  color: #b0b0c6;
}
.ed-mode.active .ed-mode__icon {
  color: #ff62c5;
}
.ed-mode__name {
  font-size: 12.5px;
  font-weight: 500;
  color: #f5f5ff;
}
.ed-mode__badge {
  align-self: flex-start;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  font-size: 10px;
  color: #a6a7ba;
  white-space: nowrap;
}
.ed-mode__desc {
  font-size: 11px;
  color: #9696aa;
  line-height: 1.35;
}

/* ── Column 2: Dashboard ── */
.ed-col--dashboard {
  grid-column: 2;
  border-right: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(5,5,12,0.98);
}

/* Dashboard header */
.ed-dash-header {
  padding: 14px 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ed-dash-header__title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d5d5e2;
}

/* Dashboard filters */
.ed-dash-filters {
  display: flex;
  gap: 4px;
  padding: 10px 14px 0;
}
.ed-filter {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: #a6a7ba;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}
.ed-filter:hover {
  border-color: rgba(255,255,255,0.18);
  color: #e0e0f0;
}
.ed-filter.active {
  border-color: rgba(255,0,140,0.4);
  background: rgba(255,0,140,0.08);
  color: #ff8ad8;
}
.ed-filter__icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}

/* Dashboard search */
.ed-dash-search {
  padding: 8px 14px;
}
.ed-dash-search__input {
  width: 100%;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  color: #e8e8f5;
  font-size: 12px;
  outline: none;
  transition: border-color .15s, background .15s;
}
.ed-dash-search__input::placeholder {
  color: #6a6a80;
}
.ed-dash-search__input:focus {
  border-color: #ff62c5;
  background: rgba(255,255,255,0.06);
}

/* Dashboard list */
.ed-dash-list {
  flex: 1 1 0%;
  overflow-y: auto;
  padding: 4px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Project card */
.ed-project-card {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ed-project-card:hover {
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.02);
}
.ed-project-card.is-active {
  border-color: rgba(255,0,140,0.4);
  background: rgba(255,0,140,0.04);
}
.ed-card__thumb {
  width: 68px;
  height: 68px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255,255,255,0.04);
}
.ed-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
  overflow: hidden;
}
.ed-card__name {
  font-size: 12px;
  font-weight: 500;
  color: #f0f0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ed-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #8888a0;
}
.ed-card__steps-badge {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.06);
  font-size: 10px;
  color: #b0b0c6;
}
.ed-card__modes {
  display: flex;
  gap: 3px;
  margin-top: 2px;
}
.ed-card__mode-tag {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255,0,140,0.08);
  border: 1px solid rgba(255,0,140,0.15);
  font-size: 9.5px;
  color: #d48cb8;
}

/* Empty state */
.ed-dash-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #6a6a80;
  font-size: 12px;
  text-align: center;
  padding: 20px;
}
.ed-dash-empty svg {
  opacity: 0.3;
  stroke: currentColor;
  fill: none;
}
.ed-dash-empty__hint {
  font-size: 11px;
  color: #555568;
}

/* New project button */
.ed-dash-new-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 8px 14px 14px;
  padding: 9px 0;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.02);
  color: #b0b0c6;
  font-size: 12px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.ed-dash-new-btn:hover:not(:disabled) {
  border-color: rgba(255,0,140,0.4);
  background: rgba(255,0,140,0.06);
  color: #ff8ad8;
}
.ed-dash-new-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ed-dash-new-btn svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

/* ── Column 3: Workspace ── */
.ed-col--workspace {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Workspace placeholder */
.ed-workspace-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px 20px;
}
.ed-workspace-placeholder svg {
  opacity: 0.18;
  stroke: #aaa;
  fill: none;
}
.ed-workspace-placeholder h2 {
  font-size: 16px;
  font-weight: 500;
  color: #d5d5e2;
  margin: 0;
}
.ed-workspace-placeholder p {
  font-size: 12px;
  color: #7a7a90;
  margin: 0;
}

/* Timeline bar */
.ed-timeline-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  background: rgba(9,9,16,0.6);
  max-height: 96px;
  transition: max-height .25s ease, padding .25s ease;
}
.ed-timeline-bar.is-collapsed {
  max-height: 28px;
  padding: 4px 12px;
  overflow: hidden;
}
.ed-timeline-bar.is-collapsed .ed-timeline-steps {
  display: none;
}
.ed-timeline-bar::-webkit-scrollbar {
  height: 4px;
}
.ed-timeline-bar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}
/* Toggle button */
.ed-timeline-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  background: transparent;
  color: #8888a0;
  cursor: pointer;
  transition: background .15s, color .15s, transform .25s;
}
.ed-timeline-toggle:hover {
  background: rgba(255,255,255,0.06);
  color: #d0d0e0;
}
.ed-timeline-bar.is-collapsed .ed-timeline-toggle svg {
  transform: rotate(-90deg);
}
.ed-timeline-toggle svg {
  transition: transform .25s ease;
}
.ed-timeline-steps {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ed-tl-step {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
}
.ed-tl-step__thumb {
  width: 72px;
  height: 72px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid transparent;
  transition: border-color .15s;
  background: rgba(255,255,255,0.04);
}
.ed-tl-step.is-active .ed-tl-step__thumb {
  border-color: #ff62c5;
}
.ed-tl-step.is-done .ed-tl-step__thumb {
  border-color: rgba(80,220,120,0.5);
}
.ed-tl-step__label {
  font-size: 10px;
  color: #8888a0;
  white-space: nowrap;
}
/* Delete step button — visible on hover */
.ed-tl-step__del {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: rgba(255,50,50,0.75);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
}
.ed-tl-step:hover .ed-tl-step__del {
  display: flex;
}
.ed-tl-arrow {
  color: rgba(255,255,255,0.15);
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}
.ed-tl-step__number {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 600;
  background: rgba(255,255,255,0.06);
  color: #888;
  flex-shrink: 0;
}
.ed-tl-step.is-active .ed-tl-step__number {
  background: rgba(255,0,140,0.2);
  color: #ff8ad8;
}

/* Tool iframe */
.ed-tool-frame {
  flex: 1 1 0%;
  min-height: 0;
  border: none;
  width: 100%;
}

/* Continue bar */
.ed-continue-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
  background: rgba(9,9,16,0.8);
}
.ed-continue-label {
  font-size: 11px;
  color: #8888a0;
  white-space: nowrap;
  margin-right: 2px;
}
.ed-continue-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  color: #b0b0c6;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
  white-space: nowrap;
}
.ed-continue-btn:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.04);
  color: #e0e0f0;
}
.ed-continue-btn svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
}
.ed-continue-sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.08);
  margin: 0 4px;
  flex-shrink: 0;
}
.ed-continue-btn--export {
  border-color: rgba(80,220,120,0.2);
  color: #72d892;
}
.ed-continue-btn--export:hover {
  border-color: rgba(80,220,120,0.4);
  background: rgba(80,220,120,0.06);
}

/* ── page-editor overrides ── */
.page-editor .shell { padding-bottom: 0; }

/* Card name row with menu */
.ed-project-card {
  position: relative;
}
.ed-card__menu-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 6px;
  background: rgba(10,10,18,0.7);
  color: #9a9ab0;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, background .15s, color .15s;
  backdrop-filter: blur(4px);
}
.ed-project-card:hover .ed-card__menu-btn {
  opacity: 1;
}
.ed-card__menu-btn:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

/* Context menu */
.ed-ctx-menu {
  background: rgba(20,20,32,0.98);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 4px;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  backdrop-filter: blur(12px);
}
.ed-ctx-menu__item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 7px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #d0d0e0;
  font-size: 12px;
  cursor: pointer;
  transition: background .12s;
}
.ed-ctx-menu__item:hover {
  background: rgba(255,255,255,0.06);
}
.ed-ctx-menu__item svg {
  fill: none;
  stroke: currentColor;
  flex-shrink: 0;
}
.ed-ctx-menu__item--danger {
  color: #ff6b6b;
}
.ed-ctx-menu__item--danger:hover {
  background: rgba(255,50,50,0.08);
}

/* ── Responsive ── */
@media (min-width: 1201px) and (max-width: 1440px) {
  .aidc-layout--editor-3col {
    grid-template-columns: 200px 260px minmax(0, 1fr);
  }
}
@media (max-width: 1200px) {
  .aidc-layout--editor-3col {
    grid-template-columns: 1fr;
  }
  .ed-col--modes,
  .ed-col--dashboard {
    display: none;
  }
  /* TODO: mobile drawer / hamburger */
}
