/**
 * bc-mobile.css — Mobile navigation drawer styles for BellerCreatives
 * Used by bc-mobile-nav.js across all BC pages.
 */

/* Dense editor toolbars keep desktop button behavior while gaining mobile groups. */
.bc-mobile-toolbar-cluster {
  display: contents;
}

.bc-mobile-toolbar-cluster > summary {
  display: none;
}

.ws-toolbar-group-label,
.ai-toolbar-cluster > summary.ai-toolbar-group-label {
  cursor: pointer;
}

@media (max-width: 720px) {
  .ai-toolbar[data-mobile-toolbar-groups],
  .ws-toolbar[data-mobile-toolbar-groups] {
    align-items: stretch;
    gap: 0.4rem;
    width: 100%;
  }

  .ai-toolbar[data-mobile-toolbar-groups] .ai-toolbar-sep,
  .ws-toolbar[data-mobile-toolbar-groups] .ws-toolbar-divider,
  .ws-toolbar[data-mobile-toolbar-groups] .ws-toolbar-spacer {
    display: none;
  }

  .bc-mobile-toolbar-cluster {
    align-items: center;
    background: color-mix(in srgb, var(--bc-bg-card, #ffffff) 92%, transparent);
    border: 1px solid var(--bc-border, rgba(49, 95, 114, 0.22));
    border-radius: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    padding: 0.35rem;
    width: 100%;
  }

  .bc-mobile-toolbar-cluster > summary {
    align-items: center;
    color: var(--bc-text-muted, #64748b);
    display: flex;
    font-size: 0.68rem;
    font-weight: 800;
    justify-content: space-between;
    letter-spacing: 0.04em;
    line-height: 1;
    min-height: 1.5rem;
    text-transform: uppercase;
    width: 100%;
  }

  .bc-mobile-toolbar-cluster > summary::after {
    content: "+";
    font-size: 0.9rem;
    line-height: 1;
  }

  .bc-mobile-toolbar-cluster[open] > summary::after {
    content: "-";
  }

  .bc-mobile-toolbar-cluster > summary::-webkit-details-marker {
    display: none;
  }

  .ai-toolbar[data-mobile-toolbar-groups] .ai-toolbar-btn,
  .ws-toolbar[data-mobile-toolbar-groups] .ws-toolbar-btn,
  .ws-toolbar[data-mobile-toolbar-groups] .bc-select {
    flex: 0 0 auto;
    min-height: 2rem;
    max-width: 100%;
    white-space: nowrap;
  }

  .ws-toolbar[data-mobile-toolbar-groups] #ws-save-status {
    display: block;
    padding: 0.15rem 0.35rem;
    width: 100%;
  }
}

/* ── Hamburger button ──────────────────────────────────────────────── */
.bc-mobile-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 6px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  z-index: 1001;
  transition: background 0.15s;
}
.bc-mobile-hamburger:hover,
.bc-mobile-hamburger:focus-visible {
  background: rgba(49, 95, 114, 0.1);
  outline: 2px solid var(--bc-accent, #315f72);
  outline-offset: 2px;
}
.bc-mobile-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--bc-text, #e8e8ee);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.bc-mobile-hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.bc-mobile-hamburger.active span:nth-child(2) {
  opacity: 0;
}
.bc-mobile-hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
  .bc-mobile-hamburger {
    display: flex;
  }
}

/* ── Backdrop overlay ──────────────────────────────────────────────── */
.bc-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1100;
  opacity: 0;
  transition: opacity 0.2s;
}
.bc-drawer-backdrop.open {
  display: block;
  opacity: 1;
}

/* ── Slide-in drawer ───────────────────────────────────────────────── */
.bc-mobile-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 85vw;
  background: var(--bc-bg-card, #12121a);
  border-right: 1px solid var(--bc-border, #1e1e2e);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.bc-mobile-drawer.open {
  transform: translateX(0);
}
.bc-mobile-drawer:focus {
  outline: none;
}

/* ── Drawer header ─────────────────────────────────────────────────── */
.bc-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.75rem;
  border-bottom: 1px solid var(--bc-border, #1e1e2e);
  flex-shrink: 0;
}
.bc-drawer-brand {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bc-text, #e8e8ee);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.bc-drawer-brand span {
  color: var(--bc-accent, #315f72);
}
.bc-drawer-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--bc-text-muted, #9898a8);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}
.bc-drawer-close:hover,
.bc-drawer-close:focus-visible {
  color: var(--bc-text, #e8e8ee);
  background: rgba(255, 255, 255, 0.07);
  outline: 2px solid var(--bc-accent, #315f72);
  outline-offset: 2px;
}

/* ── User info section ─────────────────────────────────────────────── */
.bc-drawer-user {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--bc-border, #1e1e2e);
  flex-shrink: 0;
}
.bc-drawer-user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--bc-text, #e8e8ee);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.bc-drawer-plan-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bc-accent, #315f72);
  color: #fff;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
}
.bc-drawer-project {
  font-size: 0.78rem;
  color: var(--bc-text-muted, #9898a8);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Nav links ─────────────────────────────────────────────────────── */
.bc-drawer-nav {
  flex: 1;
  padding: 0.5rem 0;
  overflow-y: auto;
}
.bc-drawer-nav a {
  display: block;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--bc-text, #e8e8ee);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-left: 2px solid transparent;
}
.bc-drawer-nav a:hover,
.bc-drawer-nav a:focus-visible {
  background: rgba(49, 95, 114, 0.08);
  color: var(--bc-accent, #315f72);
  border-left-color: var(--bc-accent, #315f72);
}
.bc-drawer-nav a.active {
  color: var(--bc-accent, #315f72);
  border-left-color: var(--bc-accent, #315f72);
  background: rgba(49, 95, 114, 0.1);
  font-weight: 600;
}
.bc-drawer-section-label {
  padding: 0.6rem 1rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--bc-text-muted, #9898a8);
}

/* ── Drawer footer ─────────────────────────────────────────────────── */
.bc-drawer-footer {
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--bc-border, #1e1e2e);
  flex-shrink: 0;
}

/* ── Light-mode overrides ──────────────────────────────────────────── */
@media (prefers-color-scheme: light) {
  .bc-mobile-drawer {
    background: #ffffff;
    border-right-color: #e5e2dd;
  }
  .bc-drawer-header {
    border-bottom-color: #e5e2dd;
  }
  .bc-drawer-brand {
    color: #1a1a2e;
  }
  .bc-drawer-close {
    color: #6b6b80;
  }
  .bc-drawer-close:hover {
    color: #1a1a2e;
    background: rgba(0, 0, 0, 0.05);
  }
  .bc-drawer-user {
    border-bottom-color: #e5e2dd;
  }
  .bc-drawer-user-name {
    color: #1a1a2e;
  }
  .bc-drawer-nav a {
    color: #1a1a2e;
  }
  .bc-drawer-footer {
    border-top-color: #e5e2dd;
  }
  .bc-mobile-hamburger span {
    background: #1a1a2e;
  }
  .bc-mobile-hamburger:hover {
    background: rgba(49, 95, 114, 0.07);
  }
}
