/* ==========================================================================
   Quantum Coder - Monochrome (Black & White) & Mobile Fit-Out Styling
   ========================================================================== */

:root {
  --app-height: 100dvh;
}

html, body {
  background-color: #000000;
  color: #f4f4f5;
  overflow: hidden;
  height: 100%;
  height: var(--app-height);
  width: 100%;
  margin: 0;
  padding: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* OVERRIDE: Penyeleksian Teks & Smooth Touch Scroll */
#chat-box, 
#history-list,
#sidebar-scroll-container,
.chat-bubble, 
p, 
pre, 
code, 
input, 
textarea {
  user-select: text !important;
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
}

/* Mobile Scroll Fix: Momentum Touch Scrolling & Explicit Pan-Y Routing */
#chat-box, 
#history-list,
#sidebar-scroll-container {
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain;
}

/* Custom Glassmorphism Scrollbar Monochrome */
#chat-box::-webkit-scrollbar,
#history-list::-webkit-scrollbar,
#sidebar-scroll-container::-webkit-scrollbar {
  width: 4px;
}

#chat-box::-webkit-scrollbar-track,
#history-list::-webkit-scrollbar-track,
#sidebar-scroll-container::-webkit-scrollbar-track {
  background: transparent;
}

#chat-box::-webkit-scrollbar-thumb,
#history-list::-webkit-scrollbar-thumb,
#sidebar-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
}

#chat-box::-webkit-scrollbar-thumb:hover,
#history-list::-webkit-scrollbar-thumb:hover,
#sidebar-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* Monochrome Glassmorphism Panels */
.glass-panel {
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.glass-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Mobile Fit-Out Specific Rules (< 768px) */
@media (max-width: 767px) {
  .chat-bubble {
    max-width: 92% !important;
    padding: 0.625rem 0.75rem !important;
    font-size: 0.8125rem !important;
    line-height: 1.4 !important;
  }

  button, input, textarea {
    min-height: 42px;
  }

  main {
    height: 100dvh !important;
  }

  #sidebar {
    height: 100dvh !important;
    max-height: 100dvh !important;
  }
}
