/**
 * Visual Debug Console Stylesheet
 *
 * Scoped, responsive, dark-mode styling for the HD Visual Debug Console.
 * Supports desktop drag/resize and mobile full-width responsive constraints.
 *
 * @package HD
 */
#vdc-root {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  box-sizing: border-box;
  line-height: normal;
  -webkit-font-smoothing: antialiased;
}
#vdc-root *,
#vdc-root *::before,
#vdc-root *::after {
  box-sizing: border-box;
}
#vdc-root img.emoji {
  display: inline-block !important;
  vertical-align: middle !important;
  width: 10px !important;
  height: 10px !important;
  min-width: 10px !important;
  min-height: 10px !important;
  margin: 0 !important;
  border: none !important;
  box-shadow: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* --------------------------------------------------
   Floating Badge
   -------------------------------------------------- */
#vdc-badge {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 20px;
  z-index: 999998;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 9999px;
  padding: 8px 14px;
  background: rgba(9, 9, 11, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  cursor: grab;
  -webkit-user-select: none;
          user-select: none;
  touch-action: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s;
}
#vdc-badge:hover {
  transform: scale(1.04);
  background: rgba(24, 24, 27, 0.96);
}
#vdc-badge.is-dragging {
  cursor: grabbing;
  transform: scale(1.06);
  box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.65);
  transition: none;
}
@media (width <= 639px) {
  #vdc-badge {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    left: 14px;
    padding: 6px 12px;
  }
}

#vdc-badge-pulse,
.vdc-accent-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  display: inline-block;
  background-color: #a855f7;
  box-shadow: 0 0 8px #a855f7;
  flex-shrink: 0;
}

#vdc-badge-counts {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 10px;
}

.vdc-emoji-wrapper {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 10px !important;
  height: 10px !important;
  font-size: 8px !important;
  line-height: 1 !important;
}

/* --------------------------------------------------
   Console Panel
   -------------------------------------------------- */
#vdc-panel {
  position: fixed;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  left: 20px;
  z-index: 999999;
  width: 480px;
  height: 420px;
  min-width: 320px;
  min-height: 250px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 80px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(9, 9, 11, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75);
}
#vdc-panel.is-visible {
  display: flex;
}
@media (width <= 639px) {
  #vdc-panel {
    inset: auto 10px calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    height: 72dvh !important;
    max-height: calc(100dvh - 74px) !important;
    min-width: unset;
    border-radius: 12px;
  }
}

/* Resize handle */
#vdc-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  z-index: 10;
  border-top-right-radius: 14px;
  background: linear-gradient(225deg, rgba(255, 255, 255, 0.15) 35%, transparent 35%);
  touch-action: none;
}
@media (width <= 639px) {
  #vdc-resize-handle {
    display: none !important;
  }
}

/* --------------------------------------------------
   Panel Header
   -------------------------------------------------- */
#vdc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: grab;
  -webkit-user-select: none;
          user-select: none;
  touch-action: none;
}
#vdc-header.is-dragging {
  cursor: grabbing;
}

.vdc-header-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #a1a1aa;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  font-family: inherit;
}
.vdc-header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f4f4f5;
}
.vdc-header-btn:active {
  transform: scale(0.97);
}

.vdc-minimize-btn {
  background: none;
  border: none;
  color: #a1a1aa;
  font-size: 16px;
  cursor: pointer;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.vdc-minimize-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
}

/* --------------------------------------------------
   Tabs Bar & Search
   -------------------------------------------------- */
.vdc-tabs-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#vdc-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
#vdc-tabs::-webkit-scrollbar {
  display: none;
}

.vdc-tab {
  background: rgba(255, 255, 255, 0.03);
  color: #a1a1aa;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1;
  min-height: 28px;
}
.vdc-tab:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f4f4f5;
}
.vdc-tab.active {
  background: rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
  border-color: var(--accent, #a855f7);
}
@media (width <= 639px) {
  .vdc-tab {
    min-height: 32px;
    padding: 7px 10px;
  }
}

.vdc-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 6px 10px 6px 28px;
  color: #f4f4f5;
  font-size: 11px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.vdc-search-input:focus {
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.15);
}
.vdc-search-input::placeholder {
  color: #71717a;
}

/* --------------------------------------------------
   Logs Container & Items
   -------------------------------------------------- */
#vdc-logs-container {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}
#vdc-logs-container::-webkit-scrollbar {
  width: 5px;
}
#vdc-logs-container::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
#vdc-logs-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
#vdc-logs-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.vdc-log-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 10px;
  font-size: 11px;
  color: #e4e4e7;
  line-height: 1.4;
  overflow-wrap: break-word;
  transition: background-color 0.15s ease;
}
.vdc-log-item:hover {
  background: rgba(255, 255, 255, 0.035);
}

/* --------------------------------------------------
   Animations
   -------------------------------------------------- */
@keyframes vdc-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}
.vdc-pulsing {
  animation: vdc-pulse 1.8s infinite ease-in-out;
}