/* ==========================================================================
   CORE SUB-SYSTEM ARCHITECTURE (Slate, Zinc & Emerald Accent)
   ========================================================================== */

:root {
  --sys-bg: #09090b;
  --panel-bg: rgba(24, 24, 27, 0.65);
  --border-muted: rgba(63, 63, 70, 0.4);
  --border-active: rgba(16, 185, 129, 0.4);
  --text-primary: #f4f4f5;
  --text-muted: #71717a;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
}

/* Base Terminal Overrides */
body {
  background-color: var(--sys-bg);
  color: #d4d4d8;
}

/* Custom Tiny Scrollbar to save layout space */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: #09090b;
}
::-webkit-scrollbar-thumb {
  background: #27272a;
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3f3f46;
}

/* ==========================================================================
   ADVANCED TEXT WRAPPING ENGINE (Safe for Long Hex/UUID Strings)
   ========================================================================== */
.code-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-all;
  color: #a1a1aa;
}

.code-field {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Flexbox/Grid Child Constraint Injector */
.grid > *,
main * {
  min-width: 0;
}

/* ==========================================================================
   PREMIUM NEO-BRUTALISM CARDS & PANELS
   ========================================================================== */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-muted);
}

.card-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  background: #18181b;
  border: 1px solid #27272a;
  border-radius: 0.5rem;
  text-align: center;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  color: #e4e4e7;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 80px;
}

.card-action:hover {
  border-color: #3f3f46;
  background: #27272a;
  transform: translateY(-1px);
}

/* ==========================================================================
   HIGH-PERFORMANCE INTERACTIVE COMPONENTS
   ========================================================================== */
.btn-premium-primary {
  background: var(--accent-emerald);
  color: #09090b;
  font-family: ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: 0.025em;
  transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-premium-primary:hover {
  background: #34d399;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.form-input-premium {
  background: #09090b;
  border: 1px solid #27272a;
  border-radius: 0.375rem;
  padding: 0.5rem 0.75rem;
  color: #f4f4f5;
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  outline: none;
  transition: all 150ms ease;
}

.form-input-premium:focus {
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.15);
}

/* ==========================================================================
   ALERTS & NOTIFICATION CORE
   ========================================================================== */
.alert-error {
  background: rgba(244, 63, 94, 0.06);
  border: 1px solid rgba(244, 63, 94, 0.25);
  color: #fca5a5;
  padding: 0.625rem 0.85rem;
  border-radius: 0.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
  padding: 0.625rem 0.85rem;
  border-radius: 0.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
}

/* ==========================================================================
   CLEAN CODELOG SYSTEM (For SSE Stream Modules & Raw Data View)
   ========================================================================== */
pre, code {
  font-family: ui-monospace, "SF Mono", Monaco, Menlo, Consolas, monospace !important;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 999px;
}

/* Details Disclosure Component */
details > summary {
  list-style: none;
  outline: none;
  cursor: pointer;
}
details > summary::-webkit-details-marker {
  display: none;
}
details > summary::before {
  content: "→";
  display: inline-block;
  margin-right: 0.45em;
  font-family: ui-monospace, monospace;
  transition: transform 100ms ease;
  color: var(--text-muted);
}
details[open] > summary::before {
  transform: rotate(90deg);
  color: var(--accent-emerald);
}

/* Modern Backdrop blur configuration */
.backdrop-blur-xs {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
