﻿/* â”€â”€ Sandbox: Workspace Tab Bar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.workspace-tabs {
  display: none; /* hidden by default; JS adds .visible in Sandbox mode */
  align-items: center;
  gap: 2px;
  padding: 0 10px;
  height: 38px;
  background: var(--clr-surface);
  border-bottom: 1px solid rgba(248, 248, 248, 0.1);
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  scrollbar-width: none;
  position: relative;
  z-index: 2;
}
.workspace-tabs.visible { display: flex; }
.workspace-tabs::-webkit-scrollbar { display: none; }

.workspace-tab {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  height: 30px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 500;
  color: rgba(248, 248, 248, 0.85);
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition);
  flex-shrink: 0;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}
.workspace-tab:hover:not(.workspace-tab--active) {
  background: rgba(248, 248, 248, 0.05);
  color: var(--clr-text);
}
.workspace-tab--active {
  color: var(--clr-saffron);
  border-bottom-color: var(--clr-saffron);
  background: rgba(230, 148, 32, 0.06);
  font-weight: 600;
}

.workspace-tab__label {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-tab__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: rgba(248, 248, 248, 0.5);
  font-size: 0.6rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.workspace-tab__close:hover {
  background: rgba(248, 248, 248, 0.15);
  color: var(--clr-text);
}
/* Hide close button when only one tab remains */
.workspace-tabs[data-count="1"] .workspace-tab__close { display: none; }

.workspace-tab-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248, 248, 248, 0.1);
  background: transparent;
  color: rgba(248, 248, 248, 0.5);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  margin-left: 4px;
  flex-shrink: 0;
  transition: border-color var(--transition), color var(--transition),
              background var(--transition);
}
.workspace-tab-add:hover {
  border-color: var(--clr-saffron);
  color: var(--clr-saffron);
  background: rgba(230, 148, 32, 0.08);
}
.workspace-tab-add:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Brief opacity flash when switching workspaces */
@keyframes ws-flash {
  0%   { opacity: 0.5; }
  100% { opacity: 1; }
}
.flutter-frame.ws-switching { animation: ws-flash 0.18s ease forwards; }

/* â”€â”€ App: Loading Overlay â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.flutter-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--clr-bg);
  z-index: 5;
  transition: opacity 0.5s ease;
}

.flutter-loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-logo {
  width: 52px;
  height: 52px;
  background: var(--clr-saffron);
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--clr-note-text);
  font-family: var(--font);
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 4px;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 2.5px solid rgba(230, 148, 32, 0.18);
  border-top-color: var(--clr-saffron);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--clr-text-muted);
  letter-spacing: 0.05em;
}

/* â”€â”€ App: Connection Status Dot â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--clr-text-muted);
  flex-shrink: 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}

.status-dot.connected {
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.5);
}

