/*
 * Wrooms AI Workspace — full-canvas application shell.
 * Inspired by modern multi-panel product workspaces, but designed around the
 * Wrooms doorway palette: violet #7c3aed, electric blue #2563eb, mint #5eead4,
 * and doorway black #07070a.
 */

.wrooms-workspace-app {
  --ws-black: #07070a;
  --ws-coal: #0a0a0d;
  --ws-panel: #101015;
  --ws-panel-2: #15151c;
  --ws-line: rgba(255, 255, 255, 0.09);
  --ws-line-strong: rgba(255, 255, 255, 0.15);
  --ws-violet: #7c3aed;
  --ws-blue: #2563eb;
  --ws-mint: #5eead4;
  --ws-text: #f5f4f8;
  --ws-muted: #aaa7b1;
  --ws-subtle: #74717d;

  --color-bg: var(--ws-black);
  --color-surface: var(--ws-coal);
  --color-elevated: var(--ws-panel);
  --color-fg: var(--ws-text);
  --color-muted: var(--ws-muted);
  --color-subtle: var(--ws-subtle);
  --color-border: #282832;
  --color-accent: var(--ws-violet);
  --color-accent-fg: white;
  --color-signal: var(--ws-mint);
  --color-ai: #8b5cf6;

  position: relative;
  isolation: isolate;
  display: flex;
  height: 100dvh;
  min-height: 100dvh;
  width: 100%;
  flex-direction: column;
  overflow: hidden;
  color: var(--ws-text);
  background:
    radial-gradient(circle at 18% -18%, rgba(124, 58, 237, 0.22), transparent 34rem),
    radial-gradient(circle at 82% -12%, rgba(37, 99, 235, 0.15), transparent 31rem),
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 100% 48px,
    var(--ws-black);
}

.wrooms-workspace-app::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.36;
  background:
    linear-gradient(90deg, transparent 0 63px, rgba(94, 234, 212, 0.025) 64px, transparent 65px) 0 0 / 256px 100%,
    linear-gradient(120deg, transparent 0 48%, rgba(124, 58, 237, 0.045) 49%, transparent 50%);
}

.workspace-commandbar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto minmax(230px, 1fr);
  align-items: center;
  min-height: 64px;
  gap: 16px;
  padding: max(8px, env(safe-area-inset-top)) 18px 8px;
  border-bottom: 1px solid var(--ws-line);
  background:
    linear-gradient(90deg, rgba(124, 58, 237, 0.1), transparent 26%, transparent 72%, rgba(37, 99, 235, 0.08)),
    rgba(7, 7, 10, 0.94);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(22px) saturate(135%);
}

.workspace-commandbar::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--ws-violet) 26%, var(--ws-blue) 56%, var(--ws-mint) 82%, transparent);
  opacity: 0.58;
}

.workspace-commandbar__brand,
.workspace-commandbar__account,
.workspace-brand-link,
.workspace-commandbar__nav {
  display: flex;
  align-items: center;
}

.workspace-commandbar__brand {
  min-width: 0;
  gap: 12px;
}

.workspace-brand-link {
  min-width: 0;
  gap: 9px;
  color: inherit;
  text-decoration: none;
}

.workspace-brand-door {
  filter: drop-shadow(0 0 14px rgba(124, 58, 237, 0.2));
}

.workspace-wordmark {
  font-size: 1.03rem;
  font-weight: 650;
  letter-spacing: -0.025em;
}

.workspace-commandbar__divider {
  width: 1px;
  height: 24px;
  flex: 0 0 1px;
  background: var(--ws-line-strong);
}

.workspace-commandbar__title {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.workspace-commandbar__title > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.79rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.workspace-commandbar__title > small {
  color: var(--ws-subtle);
  font-family: var(--font-mono, monospace);
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.workspace-commandbar__nav {
  justify-self: center;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--ws-line);
  border-radius: 999px;
  background: rgba(16, 16, 21, 0.84);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.035),
    0 10px 28px rgba(0, 0, 0, 0.16);
}

.workspace-commandbar__nav a,
.workspace-commandbar__nav span {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 13px;
  color: var(--ws-muted);
  font-size: 0.72rem;
  font-weight: 650;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.workspace-commandbar__nav a:hover {
  color: white;
  background: rgba(255, 255, 255, 0.055);
}

.workspace-commandbar__nav [aria-current="page"] {
  color: white;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.3), rgba(37, 99, 235, 0.16));
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.33);
}

.workspace-commandbar__account {
  min-width: 0;
  justify-self: end;
  justify-content: flex-end;
  gap: 7px;
}

.workspace-system-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 9px;
  color: var(--ws-mint);
  font-family: var(--font-mono, monospace);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-system-state__dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--ws-mint);
  box-shadow: 0 0 0 3px rgba(94, 234, 212, 0.08), 0 0 12px rgba(94, 234, 212, 0.45);
}

.workspace-account-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--ws-line);
  border-radius: 10px;
  padding: 0 11px;
  color: var(--ws-muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 0.7rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}

.workspace-account-link:hover {
  color: white;
  border-color: rgba(94, 234, 212, 0.28);
  background: rgba(255, 255, 255, 0.055);
  transform: translateY(-1px);
}

.workspace-account-link--primary {
  border-color: rgba(124, 58, 237, 0.48);
  color: white;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.78), rgba(37, 99, 235, 0.66));
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.12);
}

.workspace-stage {
  position: relative;
  z-index: 1;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.workspace-stage [aria-label="Wrooms AI Workspace"] {
  width: 100% !important;
  max-width: none !important;
  height: 100%;
  min-height: 0;
  padding: 0 !important;
}

.workspace-stage [aria-label="Wrooms AI Workspace"] > div {
  height: 100%;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.workspace-stage [aria-label="Wrooms AI Workspace"] > div > div {
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  background: transparent !important;
}

.workspace-stage [aria-label="Wrooms AI Workspace"] > div > div > aside {
  border-color: var(--ws-line) !important;
  background:
    linear-gradient(180deg, rgba(124, 58, 237, 0.045), transparent 16rem),
    rgba(10, 10, 13, 0.94) !important;
  backdrop-filter: blur(20px) saturate(125%);
}

.workspace-stage [aria-label="Wrooms AI Workspace"] > div > div > aside:first-of-type {
  width: 286px !important;
  box-shadow: 14px 0 38px rgba(0, 0, 0, 0.11);
}

.workspace-stage [aria-label="Wrooms AI Workspace"] > div > div > aside:last-of-type {
  width: 352px !important;
  background:
    radial-gradient(circle at 80% 0, rgba(37, 99, 235, 0.08), transparent 18rem),
    rgba(10, 10, 13, 0.95) !important;
  box-shadow: -14px 0 38px rgba(0, 0, 0, 0.1);
}

.workspace-stage main {
  position: relative;
  min-width: 0;
  background:
    radial-gradient(circle at 50% -8%, rgba(124, 58, 237, 0.11), transparent 28rem),
    linear-gradient(180deg, rgba(255, 255, 255, 0.013), transparent 6rem),
    #09090d;
}

.workspace-stage main::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.52;
  background: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px) 0 0 / 100% 44px;
}

.workspace-stage main > * {
  position: relative;
  z-index: 1;
}

.workspace-stage main > header {
  height: 62px !important;
  border-color: var(--ws-line) !important;
  background: rgba(9, 9, 13, 0.82);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(18px) saturate(125%);
}

.workspace-stage main > header::before {
  content: "ACTIVE SURFACE";
  position: absolute;
  left: 16px;
  bottom: -5px;
  padding: 0 7px;
  color: var(--ws-mint);
  background: #09090d;
  font-family: var(--font-mono, monospace);
  font-size: 0.48rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.workspace-stage main > header .rounded-full.border {
  border-color: var(--ws-line-strong) !important;
  background: rgba(16, 16, 21, 0.9) !important;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.workspace-stage main > div:last-child {
  border-top: 1px solid var(--ws-line);
  background:
    linear-gradient(180deg, rgba(9, 9, 13, 0.22), rgba(7, 7, 10, 0.94) 34%),
    rgba(7, 7, 10, 0.94);
  backdrop-filter: blur(18px);
}

.workspace-stage main > div:last-child > div:first-child {
  border-color: rgba(124, 58, 237, 0.32) !important;
  background:
    linear-gradient(145deg, rgba(124, 58, 237, 0.055), transparent 48%),
    #101015 !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.035),
    0 18px 48px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(37, 99, 235, 0.05) !important;
}

.workspace-stage main > div:last-child > div:first-child:focus-within {
  border-color: rgba(94, 234, 212, 0.48) !important;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.045),
    0 18px 54px rgba(0, 0, 0, 0.3),
    0 0 0 3px rgba(37, 99, 235, 0.1),
    0 0 24px rgba(124, 58, 237, 0.11) !important;
}

.workspace-stage textarea {
  color: var(--ws-text);
  caret-color: var(--ws-mint);
}

.workspace-stage textarea::placeholder {
  color: #6f6c78 !important;
}

.workspace-stage button,
.workspace-stage a,
.workspace-commandbar button,
.workspace-commandbar a {
  -webkit-tap-highlight-color: transparent;
}

.workspace-stage button:focus-visible,
.workspace-stage a:focus-visible,
.workspace-commandbar a:focus-visible {
  outline: 2px solid var(--ws-mint);
  outline-offset: 2px;
}

.workspace-stage aside:first-of-type > button {
  border-color: rgba(124, 58, 237, 0.28) !important;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(37, 99, 235, 0.045)) !important;
}

.workspace-stage aside:first-of-type > button:hover {
  border-color: rgba(94, 234, 212, 0.28) !important;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.16), rgba(37, 99, 235, 0.08)) !important;
}

.workspace-stage [class*="bg-ai/10"],
.workspace-stage [class*="bg-ai/15"] {
  box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.1);
}

.workspace-stage main h1 {
  text-shadow: 0 18px 70px rgba(124, 58, 237, 0.12);
}

.workspace-stage main ol {
  padding-top: 4px;
  padding-bottom: 12px;
}

.workspace-stage main ol > li > .rounded-2xl {
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.workspace-stage aside:last-of-type > div:first-child {
  background: rgba(7, 7, 10, 0.44);
}

.workspace-stage aside:last-of-type [class*="border-border"] {
  border-color: rgba(255, 255, 255, 0.085) !important;
}

.workspace-stage aside:last-of-type [class*="bg-bg"] {
  background-color: rgba(8, 8, 11, 0.72) !important;
}

.workspace-stage aside:last-of-type [class*="hover:bg-elevated"]:hover,
.workspace-stage aside:first-of-type [class*="hover:bg-elevated"]:hover {
  background-color: rgba(124, 58, 237, 0.08) !important;
}

.workspace-stage * {
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 58, 237, 0.35) transparent;
}

.workspace-stage *::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.workspace-stage *::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: linear-gradient(var(--ws-violet), var(--ws-blue)) padding-box;
}

.workspace-stage *::-webkit-scrollbar-track {
  background: transparent;
}

@media (max-width: 1180px) {
  .workspace-commandbar {
    grid-template-columns: minmax(220px, 1fr) auto;
  }

  .workspace-commandbar__nav {
    display: none;
  }

  .workspace-stage [aria-label="Wrooms AI Workspace"] > div > div > aside:first-of-type {
    width: 278px !important;
  }
}

@media (max-width: 720px) {
  .workspace-commandbar {
    min-height: 56px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding-inline: 10px;
  }

  .workspace-commandbar__brand {
    gap: 8px;
  }

  .workspace-wordmark,
  .workspace-commandbar__divider,
  .workspace-system-state,
  .workspace-account-link:not(.workspace-account-link--primary) {
    display: none;
  }

  .workspace-commandbar__title > span {
    font-size: 0.75rem;
  }

  .workspace-commandbar__title > small {
    font-size: 0.5rem;
  }

  .workspace-account-link--primary {
    min-height: 32px;
    padding-inline: 10px;
    font-size: 0.65rem;
  }

  .workspace-stage main > header {
    height: 56px !important;
  }

  .workspace-stage main > header::before {
    display: none;
  }

  .workspace-stage main > div:last-child {
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-commandbar__nav a,
  .workspace-account-link {
    transition: none;
  }

  .workspace-account-link:hover {
    transform: none;
  }
}
.workspace-ai-picker {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--ws-line);
  border-radius: 10px;
  padding: 0 9px;
  color: var(--ws-muted);
  background: rgba(16, 16, 21, 0.9);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

.workspace-ai-picker:focus-within {
  border-color: rgba(94, 234, 212, 0.42);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.workspace-ai-picker__label {
  color: var(--ws-mint);
  font-family: var(--font-mono, monospace);
  font-size: 0.56rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.workspace-ai-picker select {
  max-width: 142px;
  border: 0;
  outline: 0;
  color: var(--ws-text);
  background: transparent;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.workspace-ai-picker select option {
  color: #f5f4f8;
  background: #101015;
}

@media (max-width: 940px) {
  .workspace-ai-picker__label {
    display: none;
  }

  .workspace-ai-picker select {
    max-width: 112px;
  }
}

@media (max-width: 720px) {
  .workspace-ai-picker {
    min-height: 32px;
    padding: 0 7px;
  }

  .workspace-ai-picker select {
    max-width: 96px;
    font-size: 0.62rem;
  }
}
