/* ============================================================
   Bangbayan custom styles
   PKS brand: #fe5000 (orange), #101820 (dark), #213242 (submenu)
   ============================================================ */

/* --- Markdown / prose overrides -------------------------------- */
.bb-markdown {
  line-height: 1.7;
}
.bb-markdown p {
  margin-bottom: 0.75em;
}
.bb-markdown p:last-child {
  margin-bottom: 0;
}
.bb-markdown h1, .bb-markdown h2, .bb-markdown h3,
.bb-markdown h4, .bb-markdown h5, .bb-markdown h6 {
  font-weight: 600;
  margin-top: 1.2em;
  margin-bottom: 0.5em;
  color: #101820;
}
.dark .bb-markdown h1, .dark .bb-markdown h2,
.dark .bb-markdown h3, .dark .bb-markdown h4,
.dark .bb-markdown h5, .dark .bb-markdown h6 {
  color: #fff;
}
.bb-markdown ul, .bb-markdown ol {
  padding-left: 1.5em;
  margin-bottom: 0.75em;
}
.bb-markdown li {
  margin-bottom: 0.25em;
}
.bb-markdown code:not(pre code) {
  background: rgba(254, 80, 0, 0.1);
  color: #fe5000;
  padding: 0.15em 0.4em;
  border-radius: 0.3em;
  font-size: 0.875em;
  font-family: 'Fira Code', ui-monospace, monospace;
}
.dark .bb-markdown code:not(pre code) {
  background: rgba(254, 80, 0, 0.15);
  color: #ff8040;
}
.bb-markdown a {
  color: #fe5000;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bb-markdown blockquote {
  border-left: 3px solid #fe5000;
  padding-left: 1em;
  color: #616f80;
  font-style: italic;
  margin: 0.75em 0;
}
.bb-markdown table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875em;
  margin-bottom: 0.75em;
}
.bb-markdown th {
  background: #efefef;
  font-weight: 600;
  padding: 0.5em 0.75em;
  border: 1px solid #e5e7eb;
  text-align: left;
}
.dark .bb-markdown th {
  background: #213242;
  border-color: #101820;
}
.bb-markdown td {
  padding: 0.5em 0.75em;
  border: 1px solid #e5e7eb;
}
.dark .bb-markdown td {
  border-color: #101820;
}
.bb-markdown tr:nth-child(even) td {
  background: rgba(0,0,0,0.025);
}
.dark .bb-markdown tr:nth-child(even) td {
  background: rgba(255,255,255,0.03);
}

/* --- Code blocks ----------------------------------------------- */
.bb-code-block {
  position: relative;
  margin: 0.75em 0;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #0d1117;
  border: 1px solid rgba(255,255,255,0.08);
}
.bb-code-lang {
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  font-size: 0.7rem;
  font-family: ui-monospace, monospace;
  color: #989ea6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.bb-copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: rgba(254, 80, 0, 0.15);
  color: #fe5000;
  border: 1px solid rgba(254, 80, 0, 0.3);
  border-radius: 0.4rem;
  padding: 0.15rem 0.6rem;
  font-size: 0.7rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  z-index: 2;
}
.bb-copy-btn:hover {
  background: rgba(254, 80, 0, 0.3);
  color: #fff;
}
.bb-code-block pre {
  margin: 0;
  padding: 2.5rem 1rem 1rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.6;
}
.bb-code-block code {
  background: transparent !important;
  color: inherit !important;
  padding: 0 !important;
  font-size: inherit !important;
}

/* --- Typing / loading dots ------------------------------------- */
@keyframes bb-dot-pulse {
  0%, 80%, 100% { transform: scale(0.85); opacity: 0.5; }
  40%            { transform: scale(1.15); opacity: 1;   }
}
.bb-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #fe5000;
  animation: bb-dot-pulse 1.2s infinite;
}

/* --- Spinner --------------------------------------------------- */
@keyframes bb-spin {
  to { transform: rotate(360deg); }
}
.bb-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid #efefef;
  border-top-color: #fe5000;
  border-radius: 9999px;
  animation: bb-spin 0.7s linear infinite;
}
.bb-spinner-sm {
  width: 18px;
  height: 18px;
  border: 2px solid #efefef;
  border-top-color: #fe5000;
  border-radius: 9999px;
  animation: bb-spin 0.7s linear infinite;
}

/* --- Drag-and-drop zone ---------------------------------------- */
.bb-drop-zone-active {
  border-color: #fe5000 !important;
  background: rgba(254, 80, 0, 0.05) !important;
}

/* --- Scrollbar (webkit) ---------------------------------------- */
.bb-scrollbar::-webkit-scrollbar {
  width: 5px;
}
.bb-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}
.bb-scrollbar::-webkit-scrollbar-thumb {
  background: #989ea6;
  border-radius: 9999px;
}
.bb-scrollbar::-webkit-scrollbar-thumb:hover {
  background: #616f80;
}

/* --- Transition helpers ---------------------------------------- */
.bb-fade-in {
  animation: bb-fade-in 0.2s ease-out;
}
@keyframes bb-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0);   }
}

/* --- Mobile adjustments ---------------------------------------- */
@media (max-width: 768px) {
  .bb-markdown pre {
    font-size: 0.75rem;
  }
}
