/* ==========================================================================
   OVERLAYS, MODALS & TOAST NOTIFICATIONS (v5.5.0)
   Auth Gate, Quick-Switcher (Cmd+K), Shortcuts, Drop Curtain, Toast Stack.
   ========================================================================== */

/* AUTHENTICATION GATE LOCKDOWN SCREEN */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #080808;
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}

.auth-gate-card {
  width: 100%;
  max-width: 440px;
  background: #121212;
  border: 1px solid #242424;
  border-radius: 14px;
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.95);
  animation: qsIn 0.2s ease-out;
}

.auth-gate-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.auth-gate-logo {
  width: 36px;
  height: 36px;
}

.auth-gate-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.auth-gate-version {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  background: #181818;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid #242424;
}

.auth-gate-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 24px;
  max-width: 360px;
}

.auth-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.auth-gate-btn {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.auth-gate-github {
  background: #ffffff;
  color: #000000;
  border: 1px solid #ffffff;
}

.auth-gate-github:hover {
  background: #e6e6e6;
}

.auth-gate-google {
  background: #181818;
  color: #ffffff;
  border: 1px solid #2e2e2e;
}

.auth-gate-google:hover {
  background: #222222;
  border-color: #3e3e3e;
}

.auth-gate-footer {
  margin-top: 24px;
  font-size: 10px;
  color: var(--text-dim);
  line-height: 1.4;
}

/* MODAL OVERLAY PRIMITIVE */
.te-modal-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: #0d0d0d4d;
  backdrop-filter: blur(5px);
  z-index: 99990;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.te-modal-overlay.active {
  display: flex;
  opacity: 1;
}

/* QUICK-SWITCHER PALETTE */
.qs-palette-card {
  width: 90vw;
  max-width: 620px;
  background: #0d0d0d;
  border: 1px solid #222222;
  border-radius: 12px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: qsIn 0.15s ease;
}

@keyframes qsIn {
  from { transform: scale(0.96) translateY(-10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.qs-search-header {
  padding: 12px 14px;
  background: #0a0a0a;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.qs-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
}

.qs-close-btn {
  background: #141414;
  border: 1px solid #242424;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.qs-results-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qs-result-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.1s ease;
}

.qs-result-item:hover, .qs-result-item.selected {
  background: #181818;
  border-color: #282828;
}

.qs-item-icon {
  color: var(--text-dim);
  display: flex;
  align-items: center;
}

.qs-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  overflow: hidden;
}

.qs-item-title {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qs-item-meta {
  font-size: 10px;
  color: var(--text-dim);
}

.qs-item-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.qs-type-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: var(--text-dim, #737373);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: transparent;
  border: none;
  padding: 0 4px;
  user-select: none;
}

.qs-type-tag.active {
  color: var(--status-green-text, #34d399);
}

.qs-branch-inline-btn {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 2px 4px !important;
  color: var(--text-muted, #9e9e9e);
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.12s ease;
  user-select: none;
  line-height: 1;
  box-shadow: none !important;
  outline: none;
}

.qs-branch-inline-btn:hover {
  color: #ffffff;
  background: transparent !important;
}

.qs-branch-inline-btn:hover svg {
  color: #ffffff !important;
}

.qs-branch-select-wrap {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.qs-branch-select {
  background: #0e0e0e;
  border: 1px solid #242424;
  color: var(--status-green-text, #34d399);
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  padding: 1px 18px 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' width='10' height='10' stroke='%23737373' stroke-width='2' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  transition: all 0.12s ease;
}

.qs-branch-select:hover {
  border-color: #333333;
  background-color: #161616;
}

.qs-branch-select:focus {
  border-color: var(--status-green-text, #34d399);
}

.qs-shortcut-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

.qs-footer-bar {
  padding: 8px 14px;
  background: #0a0a0a;
  border-top: 1px solid #1a1a1a;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.qs-footer-bar kbd {
  background: #161616;
  border: 1px solid #262626;
  padding: 1px 4px;
  border-radius: 3px;
  color: var(--text-muted);
}

.qs-empty-state {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* KEYBOARD SHORTCUTS MODAL */
.shortcuts-modal-card {
  width: 90vw;
  max-width: 860px;
  background: #121212;
  border: 2px solid #151515;
  border-radius: 15px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: qsIn 0.15s ease;
}

.shortcuts-header {
  padding: 12px 16px;
  background: #0e0e0e;
  border-bottom: 2px solid #151515;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shortcuts-body {
  padding: 16px;
  background: #0e0e0e;
  max-height: 75vh;
  overflow-y: auto;
}

.shortcuts-domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.shortcuts-domain-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.shortcuts-domain-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--status-green-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-bottom: 4px;
  border-bottom: 1px solid #202020;
  margin-bottom: 2px;
}

.shortcut-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  gap: 8px;
  transition: background 0.1s ease;
}

.shortcut-item:hover {
  background: #161616;
  color: var(--text-main);
}

.shortcut-item span {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shortcut-keys {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.shortcut-keys kbd, .shortcut-keys code {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  background: #161616;
  color: #ffffff;
  border: 1px solid #262626;
  padding: 1px 5px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* LEGACY VAULT MODAL (COMPATIBILITY) */
.vault-modal-card {
  width: 90vw;
  max-width: 600px;
  background: #121212;
  border: 2px solid #151515;
  border-radius: 15px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: qsIn 0.15s ease;
}

.vault-header {
  padding: 12px 16px;
  background: #0e0e0e;
  border-bottom: 2px solid #151515;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vault-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 70vh;
  overflow-y: auto;
}

.vault-add-box {
  background: #000000;
  border: 1px solid #222222;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vault-accounts-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vault-account-card {
  background: #0c0c0c;
  border: 1px solid #141414;
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.12s ease;
}

.vault-account-card.active-account {
  border-color: var(--status-green-text);
  background: rgba(0, 229, 153, 0.03);
}

.vault-account-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vault-account-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: #161616;
  border: 1px solid #262626;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vault-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vault-avatar-placeholder {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #ffffff;
}

.vault-account-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.vault-account-label {
  font-size: 12px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.vault-account-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
}

.vault-account-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* GLOBAL OMNIPRESENT DRAG & DROP CURTAIN */
.global-drop-curtain {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.global-drop-box {
  background: #080808;
  border: 2px dashed var(--status-green-text);
  border-radius: 8px;
  padding: 32px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--status-green-text);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* TOAST NOTIFICATIONS (MINIMAL WHITE CAPSULE, ZERO SHADOW) */
.toast-container {
  position: fixed;
  bottom: 36px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 999999;
  pointer-events: none;
  align-items: flex-end;
}

.toast {
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 20px;
  padding: 5px 13px 5px 9px;
  color: #0a0a0a;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: none !important;
  animation: toastIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-width: 360px;
  letter-spacing: -0.01em;
  user-select: none;
}

.toast:hover {
  background: #f5f5f5;
  border-color: #d4d4d4;
}

.toast svg {
  color: #0a0a0a;
  stroke: #0a0a0a;
  flex-shrink: 0;
}

.toast.success, .toast.warn, .toast.error {
  background: #ffffff;
  border-color: #e5e5e5;
  color: #0a0a0a;
}

.toast.success svg, .toast.warn svg, .toast.error svg {
  color: #0a0a0a;
  stroke: #0a0a0a;
}

@keyframes toastIn {
  from { transform: translateY(8px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateY(0) scale(1); opacity: 1; }
  to { transform: translateY(8px) scale(0.96); opacity: 0; }
}

/* RESPONSIVE OVERRIDES FOR OVERLAYS */
body[data-density="deep"] .qs-palette-card { max-width: 780px; }
body[data-density="deep"] .vault-modal-card { max-width: 740px; }
body[data-density="deep"] .shortcuts-modal-card { max-width: 980px; }