/* Debug Bar Component */

.debug-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.95);
  border-top: 2px solid var(--accent-primary);
  color: #e2e3ea;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
  font-size: 0.8rem;
  line-height: 1.4;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.3);
}

.debug-bar__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.9);
}

.debug-bar__toggle:hover {
  background: rgba(var(--accent-primary-rgb), 0.1);
}

.debug-bar__toggle svg {
  width: 14px;
  height: 14px;
  color: var(--accent-primary);
}

.debug-bar__toggle-icon {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.debug-bar__toggle.is-open .debug-bar__toggle-icon {
  transform: rotate(-180deg);
}

.debug-bar__content {
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-bar__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1.5rem;
}

/* Below LG (1024px): 3 columns */
@media (max-width: 63.99rem) {
  .debug-bar__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.debug-bar__section {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.debug-bar__section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  margin: 0 0 0.75rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.debug-bar__list {
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.debug-bar__list dt {
  font-weight: 600;
  color: rgba(226, 227, 234, 0.7);
  margin: 0;
  font-size: 0.75rem;
}

.debug-bar__list dd {
  margin: 0 0 0.5rem 0;
  color: #e2e3ea;
  font-size: 0.8rem;
  word-break: break-word;
}

.debug-bar__list dd:last-child {
  margin-bottom: 0;
}

/* Light Theme */
html[data-theme="light"] .debug-bar {
  background: rgba(255, 255, 255, 0.98);
  color: #2f3244;
  border-top-color: var(--accent-primary);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .debug-bar__toggle {
  background: rgba(255, 255, 255, 0.95);
}

html[data-theme="light"] .debug-bar__toggle:hover {
  background: rgba(var(--accent-primary-rgb), 0.05);
}

html[data-theme="light"] .debug-bar__content {
  background: rgba(255, 255, 255, 0.98);
  border-top-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .debug-bar__section {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-theme="light"] .debug-bar__section-title {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .debug-bar__list dt {
  color: rgba(47, 50, 68, 0.7);
}

html[data-theme="light"] .debug-bar__list dd {
  color: #2f3244;
}

/* Below SM (640px): 1 column */
@media (max-width: 39.99rem) {
  .debug-bar__grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .debug-bar__content {
    max-height: 50vh;
  }
}

/* Scrollbar styling for debug bar */
.debug-bar__content::-webkit-scrollbar {
  width: 8px;
}

.debug-bar__content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.debug-bar__content::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-primary-rgb), 0.5);
  border-radius: var(--radius-sm);
}

.debug-bar__content::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-primary-rgb), 0.7);
}

html[data-theme="light"] .debug-bar__content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .debug-bar__content::-webkit-scrollbar-thumb {
  background: rgba(var(--accent-primary-rgb), 0.4);
}

html[data-theme="light"] .debug-bar__content::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--accent-primary-rgb), 0.6);
}
