/* =============================================
   DEEPSTACK OS — QUICK ACCESS PANEL
   Vibrant colored buttons, white icons & text
   ============================================= */

/* Backdrop */
#qa-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
#qa-backdrop.qa-visible {
  opacity: 1;
  pointer-events: all;
}

/* Panel */
#qa-panel {
  position: fixed;
  top: 56px;
  right: 16px;
  width: 440px;
  max-height: calc(100vh - 80px);
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 0 0 1px rgba(255,255,255,0.06) inset;
  z-index: 9001;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}
#qa-panel.qa-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}
[data-theme="dark"] #qa-panel {
  background: #0f172a;
  border-color: #1e293b;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04) inset;
}

/* Header */
.qa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.qa-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.qa-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #c78f3d;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qa-icon-wrap i { color: white !important; }
.qa-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.qa-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}
.qa-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 120ms;
}
.qa-close:hover {
  background: var(--bg);
}

/* Body */
.qa-body {
  padding: 12px 16px 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Group */
.qa-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding: 0 2px;
}
.qa-group-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Grid — 3 columns */
.qa-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

/* Item button — VIBRANT solid colors */
.qa-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 6px 12px;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 140ms ease;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.qa-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  filter: brightness(1.1);
}
.qa-item:active {
  transform: translateY(0);
  filter: brightness(0.95);
}

/* Active item — white ring */
.qa-item-active {
  box-shadow: 0 0 0 2px white, 0 4px 16px rgba(0,0,0,0.2) !important;
}

/* War Mode item — pulsing glow */
.qa-item-war {
  animation: qa-war-pulse 2s ease-in-out infinite;
}
@keyframes qa-war-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(245,158,11,0.3); }
  50% { box-shadow: 0 4px 24px rgba(245,158,11,0.5); }
}

/* Item icon — always white */
.qa-item-icon {
  width: 20px;
  height: 20px;
  color: white !important;
  flex-shrink: 0;
}

/* Item label — always white */
.qa-item-label {
  font-size: 11px;
  font-weight: 600;
  color: white !important;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* Footer */
.qa-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}
.qa-footer-hint {
  font-size: 11px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 4px;
}
.qa-footer-hint kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
}

/* Quick Access header button — VIBRANT */
#qa-header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: #c78f3d;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: all 160ms ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
#qa-header-btn i { color: white !important; }
#qa-header-btn:hover {
  background: #a67830;
  box-shadow: 0 4px 16px rgba(245,158,11,0.4);
  transform: translateY(-1px);
}
#qa-header-btn:active {
  transform: translateY(0);
}
[data-theme="dark"] #qa-header-btn {
  background: #c78f3d;
  box-shadow: 0 2px 12px rgba(245,158,11,0.25);
}
[data-theme="dark"] #qa-header-btn:hover {
  background: #a67830;
  box-shadow: 0 4px 20px rgba(245,158,11,0.35);
}

/* Mobile */
@media (max-width: 768px) {
  #qa-panel {
    top: 0;
    right: 0;
    left: 0;
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .qa-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
  .qa-item {
    padding: 10px 4px 8px;
  }
  .qa-item-label {
    font-size: 10px;
  }
  #qa-header-btn span.qa-btn-label {
    display: none;
  }
  #qa-header-btn {
    padding: 5px 8px;
  }
}
