/* The 2026-11 look refresh — shell. Every rule starts with body.rf (see refresh-base.css).

   Approved in the sample as `nav-side sn-x3b sn-fc sn-lg3 sn-lg3s ph-h1 tc tc-ic
   ic6 lay2 grp2 newic anim an-a sh1 force-motion`:
   - side menu (248px, right): centred logo with the splash's moving line,
     «פרויקט חדש» + «קבוצה חדשה» side by side (white, teal +), projects under
     quiet group headings (folder in the group's colour + count), no
     «פרויקטים» label, ONE footer row: «הגדרות» | «API מחובר» / «שרת פעיל».
   - project header: low, one line (name · ⋮ · undo/redo · stats), the five
     tabs in ONE grey capsule, open tab white raised with a teal icon, a thin
     divider, then «עורך» with a small picture of the film.
   - icons redraw themselves on hover; the motion is kept even when the
     system asks for reduced motion (the user's decision, 11-10). */

body.rf {
  /* brand colours: fixed in both themes, like the logo's own "AI" */
  --rf-brand-1: #0a6b76;
  --rf-brand-2: #12a3b0;
  --rf-brand-3: #e86d2f;
  /* a group's folder colour = hsl(<group hue> var(--rf-g-s) var(--rf-g-l)) */
  --rf-g-s: 64%;
  --rf-g-l: 54%;
  /* the round ▶ on the film's picture */
  --rf-play-bg: rgba(10, 22, 40, 0.72);
  --rf-play-ink: #ffffff;
  --rf-lift: 0 4px 10px rgba(10, 22, 40, 0.25);
}
[data-theme="dark"] body.rf {
  --rf-g-s: 62%;
  --rf-g-l: 66%;
  --rf-play-bg: rgba(0, 0, 0, 0.62);
  --rf-lift: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* ================================================================
   Side menu
   ================================================================ */
body.rf .side-nav {
  padding: 14px 10px;
  border-inline-start: 0;
  border-inline-end: 1px solid var(--divider);
}

/* ── logo: centred, 46px mark, name with a gradient «AI», BY YSTUDIA ── */
body.rf .brand {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2px 0 12px;
  text-align: center;
}
body.rf .brand-logo {
  width: 46px;
  height: 46px;
}
body.rf .brand-logo svg {
  overflow: visible;
}
body.rf .brand-text {
  align-items: center;
  gap: 0;
}
body.rf .brand-name {
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
body.rf .brand-name em {
  font-style: normal;
  background: linear-gradient(90deg, var(--rf-brand-1), var(--rf-brand-2) 50%, var(--rf-brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.rf .brand-by {
  margin-top: 1px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.24em;
  color: var(--text-muted);
  white-space: nowrap;
}
/* the splash's moving line around the box (runs even under reduced motion) */
body.rf .brand-sweep {
  fill: none;
  stroke: url(#brandSweepGrad);
  stroke-dasharray: 0.22 0.78;
  animation: rf-mk-sweep 4.5s linear infinite;
}
@keyframes rf-mk-sweep {
  from { stroke-dashoffset: 0; }
  to { stroke-dashoffset: -1; }
}

/* ── «פרויקט חדש» / «קבוצה חדשה»: two equal white buttons, teal + ── */
body.rf .sidebar-actions {
  display: flex;
  gap: 6px;
  margin: 2px 0 10px;
  flex: none;
}
body.rf .sidebar-actions .sidebar-new-btn {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 0 6px;
  gap: 6px;
  border-radius: 10px;
  background: var(--rf-card);
  border: 1px solid var(--rf-line-2);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: none;
}
body.rf .sidebar-actions .sidebar-new-btn:hover:not(:disabled) {
  background: var(--rf-grey);
  border-color: var(--border-strong);
  color: var(--text);
}
body.rf .sidebar-new-icon {
  display: inline-flex;
  color: var(--accent);
}
body.rf .sidebar-new-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the «פרויקטים» label above the list is gone (approved) */
body.rf .sidebar-section-label {
  display: none;
}

/* ── the list ── */
body.rf .sidebar-projects {
  gap: 2px;
}
body.rf .sidebar-group-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 3px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: normal;
  color: var(--text-3);
  min-width: 0;
}
body.rf .sidebar-group-label:hover:not(.muted) {
  color: var(--text);
}
body.rf .sidebar-group-label.muted:hover {
  color: var(--text-3);
}
body.rf .sidebar-group-icon {
  display: inline-flex;
  flex: none;
  width: 14px;
  height: 14px;
  color: hsl(var(--rf-g-hue, 210) var(--rf-g-s) var(--rf-g-l));
}
body.rf .sidebar-group-label.muted .sidebar-group-icon {
  color: var(--text-muted);
}
body.rf .sidebar-group-icon svg {
  width: 14px;
  height: 14px;
  display: block;
}
body.rf .sidebar-group-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.rf .sidebar-group-count {
  flex: none;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}

body.rf .sidebar-project {
  gap: 9px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
}
body.rf .sidebar-project.active {
  box-shadow: none;
}
body.rf .sidebar-project-thumb {
  width: 24px;
  height: 24px;
  border-radius: 5px;
}

/* ── footer: ONE row — «הגדרות» on one side, the status written out on the other ── */
body.rf .nav-footer {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--divider);
}
body.rf .nav-footer .nav-item-lg {
  order: 1;
  flex: none;
  gap: 8px;
  padding: 7px 12px;
  border-top: 0;
  border: 1px solid var(--rf-line);
  border-radius: 10px;
  background: var(--rf-card);
  box-shadow: none;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}
body.rf .nav-footer .nav-item-lg:hover {
  background: var(--rf-grey);
  color: var(--text);
}
body.rf .nav-footer .nav-item-lg.active {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: var(--rf-raise);
}
body.rf .nav-footer .nav-item-lg .nav-icon {
  width: 18px;
  font-size: 18px;
  color: var(--text-2);
}
body.rf .nav-footer .nav-item-lg.active .nav-icon {
  color: var(--accent);
}
body.rf .nav-footer .nav-item-lg .nav-icon svg {
  width: 18px;
  height: 18px;
}
body.rf .sidebar-status-meta {
  order: 2;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 3px;
  padding: 0;
  min-width: 0;
  font-size: 11px;
  line-height: 1.45;
}
body.rf .sidebar-status-meta .status-bit {
  gap: 5px;
  padding: 0;
  font-size: 11px;
  white-space: nowrap;
}
body.rf .sidebar-status-meta .status-bit-sep {
  display: none;
}

/* the drawer (tablet / phone) keeps its own top room */
@media (max-width: 960px) {
  body.rf .side-nav {
    padding-top: var(--s-6);
    border-inline-end: 0;
  }
}

/* ================================================================
   Project header (workspace)
   ================================================================ */
body.rf .workspace-root .project-header {
  flex-wrap: nowrap;
  gap: 16px;
  padding-block: 8px;
  padding-inline: 12px 18px;
  margin-bottom: 18px;
  background: var(--rf-card);
  border: 0;
  border-radius: 16px;
  box-shadow: var(--rf-shadow);
}

/* title, ⋮, undo/redo and the stats on ONE line */
body.rf .workspace-root .project-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
}
body.rf .workspace-root .project-name-row {
  gap: 2px;
  flex: 0 1 auto;
  min-width: 0;
}
body.rf .workspace-root .project-name-wrapper {
  min-width: 0;
}
body.rf .workspace-root .project-name-editable,
body.rf .workspace-root .ws-sk-project-name {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.45;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.rf .workspace-root .project-name-input {
  font-size: 17px;
  font-weight: 700;
}
body.rf .workspace-root .project-menu-trigger {
  width: 22px;
}
body.rf .workspace-root .project-undo-group {
  gap: 0;
}
body.rf .workspace-root .project-undo-btn {
  color: var(--text-muted);
}
body.rf .workspace-root .project-header-title p.project-stats-row {
  margin: 0;
  min-width: 0;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── the five in ONE grey capsule ── */
body.rf .workspace-root .project-header-bottom {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0;
  padding: 3px;
  border-radius: 12px;
  background: var(--rf-grey);
}
body.rf .workspace-root .project-header-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0;
  border-radius: 0;
  background: transparent;
}
body.rf .workspace-root .project-header-tabs .wtab {
  height: 36px;
  min-height: 0;
  padding: 0 12px;
  gap: 7px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-3);
  background: transparent;
  box-shadow: none;
}
body.rf .workspace-root .project-header-tabs .wtab:hover {
  color: var(--text);
}
body.rf .workspace-root .project-header-tabs .wtab.active {
  background: var(--rf-card);
  color: var(--text);
  box-shadow: var(--rf-raise);
}
body.rf .workspace-root .project-header-tabs .wtab .wtab-icon {
  display: inline-flex;
  opacity: 1;
  color: inherit;
}
body.rf .workspace-root .project-header-tabs .wtab.active .wtab-icon {
  color: var(--accent);
}
body.rf .workspace-root .wtab-svg {
  width: 17px;
  height: 17px;
  display: block;
  overflow: visible;
}
/* the icon draws itself on hover, like the logo */
body.rf .workspace-root .wtab:hover .wtab-svg :is(path, rect) {
  stroke-dasharray: 1;
  animation: rf-ic-draw 0.7s ease both;
}
@keyframes rf-ic-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
/* the loading skeleton's stand-in icon keeps the same box */
body.rf .workspace-root .project-header-tabs .ws-sk-wtab-icon {
  width: 17px;
  height: 17px;
}

/* ── «עורך»: the film's picture beside the word, after a thin divider ── */
body.rf .workspace-root .btn-open-editor {
  position: relative;
  flex: none;
  height: 36px;
  min-height: 0;
  margin: 0;
  margin-inline-start: 9px;
  padding: 0;
  padding-inline: 10px 4px;
  gap: 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
}
body.rf .workspace-root .btn-open-editor:hover:not(:disabled),
body.rf .workspace-root .btn-open-editor:active:not(:disabled) {
  background: transparent;
  color: var(--text);
}
body.rf .workspace-root .btn-open-editor::before {
  content: "";
  position: absolute;
  inset-inline-start: -5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--rf-line-2);
}
body.rf .editor-thumb {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 26px;
  border-radius: 5px;
  overflow: hidden;
  background: var(--rf-grey-2);
  box-shadow: 0 0 0 1.5px var(--text);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
body.rf .editor-thumb-media {
  position: absolute;
  inset: 0;
  display: block;
  background-size: cover;
  background-position: center;
}
body.rf .editor-thumb-media > img,
body.rf .editor-thumb-media > video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}
body.rf .editor-thumb-play {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--rf-play-bg);
  color: var(--rf-play-ink);
}
body.rf .editor-thumb-play svg {
  width: 7px;
  height: 7px;
  display: block;
  margin-inline-end: -1px;
}
/* on hover the picture lifts and its ▶ beats */
body.rf .workspace-root .btn-open-editor:hover .editor-thumb {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1.5px var(--text), var(--rf-lift);
}
body.rf .workspace-root .btn-open-editor:hover .editor-thumb-play {
  animation: rf-ic-pulse 0.8s ease infinite;
}
@keyframes rf-ic-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
/* the loading skeleton's editor stand-in: same box, no teal */
body.rf .workspace-root .ws-sk-open-editor svg {
  display: none;
}

/* ── narrower windows: the header may wrap ── */
@media (max-width: 1100px) {
  body.rf .workspace-root .project-header {
    flex-wrap: wrap;
    row-gap: 8px;
  }
}

/* ── phone: title line, then the capsule across the full width ── */
@media (max-width: 768px) {
  body.rf .workspace-root .project-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  body.rf .workspace-root .project-header-title {
    flex-wrap: wrap;
    row-gap: 0;
    column-gap: 10px;
  }
  body.rf .workspace-root .project-header-bottom {
    width: 100%;
  }
  body.rf .workspace-root .project-header-tabs {
    flex: 1 1 0;
    min-width: 0;
    gap: 1px;
  }
  body.rf .workspace-root .project-header-tabs .wtab {
    flex: 1 1 0;
    height: 34px;
    padding: 0 4px;
  }
  body.rf .workspace-root .btn-open-editor {
    height: 34px;
    gap: 6px;
    padding-inline: 8px 4px;
    font-size: 12.5px;
  }
  body.rf .editor-thumb {
    width: 34px;
    height: 22px;
  }
}
