@import "css/variables.css";

:root {
  --shufflrr-blue: #0078FF;
}

/* Inline `code` uses highlight.js `.hljs`; tomorrow-night.css gives `.hljs` a
   dark background while light theme uses a dark --inline-code-color — illegible.
   Transparent background keeps readable text without an extra highlight panel. */
.content :not(pre) > .hljs {
  background: transparent;
}

html {
  font-family: "Proxima Vara", "Open Sans", sans-serif;
}

body {
  font-size: 1.7rem;
}

#menu-bar-hover-placeholder {
  pointer-events: none;
}

#theme-toggle {
  display: none;
}

.chapter .spacer {
  height: 1px;
  margin: 1rem 0;
}

.page h1 > a {
  color: white !important;
  background-color: var(--shufflrr-blue);
  padding: 1rem 1.6rem;
  border-radius: 6px;
  margin-left: -1.6rem;
}

.page h2 > a, .page h3 > a, .page h4 > a {
  color: var(--shufflrr-blue) !important;
}

.page h2:not(:nth-child(2))::before {
  display: block;
  margin: 40px auto 30px auto;
  content: "";
  height: 1px;
  width: 80%;
  background: #cccccc;
}

.page blockquote > p:first-child {
  padding-left: 2em;
  background-image: url(bug.svg);
  background-size: auto 100%;
  background-repeat: no-repeat;
}

.player {
  display: flex;
  justify-content: center;
  background: linear-gradient(90deg, rgba(32,56,100,1) 0%, rgba(0,120,255,1) 100%);
  border-radius: 10px;
}

.player iframe {
  border-radius: 5px;
  margin: 10px 0;
}

#header-nav-wrapper {
  position: relative;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-fg);
  z-index: 201;
}

#header-nav-wrapper .header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--page-padding);
}

#header-nav-wrapper .header-nav-left {
  display: flex;
  justify-content: center;
  align-items: center;
}

#header-nav-wrapper .logo {
  width: 160px;
}

#header-nav-wrapper .header-nav-right {
  display: flex;
  align-items: center;
}

#header-nav-wrapper .menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 1.75rem;
  font-weight: bold;
  text-decoration: none;
  color: white;
}

#header-nav-wrapper .menu-item:nth-child(4) {
  background-color: var(--shufflrr-blue);
  padding: 0.5rem 1.1rem;
  border-radius: 3px;
}

#header-nav-wrapper .menu-separator {
  margin-left: 2rem;
  margin-right: 0.25rem;
  border-left: 1px solid white;
  height: 4rem;
}

#header-nav-wrapper .social-icon {
  background-color: white;
  color: #333333;
  margin-left: 1.5rem;
  width: 1rem;
  height: 1rem;
  padding: 1rem;
  border-radius: 50%;
}

#header-nav-wrapper .social-icons {
  display: flex;
  align-items: center;
}

#header-nav-wrapper .linkedin {
  background-color: #00a0dc;
}

#header-nav-wrapper .facebook {
  background-color: rgb(24, 119, 242);
}

#header-nav-wrapper .twitter {
  background-color: rgb(29, 161, 242);
}

#reveal-menu, #header-nav-wrapper label {
  display: none;
}

/* Sidebar: collapsible sections with arrows */
.sidebar .chapter li.chapter-item.has-children {
  display: flex;
  align-items: center;
}
.sidebar .chapter .sidebar-arrow {
  display: inline-block;
  width: 1.2em;
  flex-shrink: 0;
  text-align: center;
  cursor: pointer;
  font-size: 0.7em;
  transition: transform 0.2s ease;
  color: var(--sidebar-fg);
  opacity: 0.9;
  user-select: none;
}
.sidebar .chapter .sidebar-arrow:hover {
  color: var(--sidebar-active);
}
.sidebar .chapter li.chapter-item.has-children.expanded > .sidebar-arrow {
  transform: rotate(90deg);
}
.sidebar .chapter li.chapter-item.has-children > .sidebar-arrow + div,
.sidebar .chapter li.chapter-item.has-children > .sidebar-arrow + a {
  flex: 1;
  min-width: 0;
}

/* Make top-level folder labels readable (non-link sidebar items). */
.sidebar .chapter li.chapter-item > div,
.sidebar .chapter li.chapter-item > span,
.sidebar .chapter li.chapter-item > .chapter-link-wrapper > span {
  color: var(--sidebar-fg);
  opacity: 0.95;
  font-weight: 700;
}

@media (max-width: 1100px) {
  #header-nav-wrapper .header-nav {
    padding: calc(var(--page-padding) * 0.75);
  }

  #header-nav-wrapper .logo {
    width: 120px;
  }

  #header-nav-wrapper .menu-separator, 
  #header-nav-wrapper .slogan {
    display: none;
  }

  #reveal-menu:checked ~ #header-nav-wrapper .header-nav-right {
    display: flex;
  }

  #header-nav-wrapper label {
    display: unset;
  }

  #reveal-menu:checked ~ #header-nav-wrapper label > i {
    padding: 10px 40px;
    background-color: #ef323d;
    border-radius: 3px;
  }

  #header-nav-wrapper .header-nav-right {
    display: none;
    position: fixed;
    flex-direction: column;
    justify-content: space-around;
    padding: 160px 0;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background-color: #000130;
    box-sizing: border-box;
  }
}

.shufflrr-ask-ai {
  border: 1px solid rgba(0, 120, 255, 0.18);
  border-radius: 16px;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(4, 27, 62, 0.14);
}

.shufflrr-ask-ai__messages {
  min-height: 190px;
  max-height: min(56vh, 520px);
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at 90% 0%, rgba(0, 120, 255, 0.06), transparent 35%),
    radial-gradient(circle at 0% 100%, rgba(32, 56, 100, 0.08), transparent 40%);
}

.shufflrr-ask-ai__message {
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
  padding: 10px 12px;
  border: 1px solid transparent;
}

.shufflrr-ask-ai__message--assistant {
  background: rgba(0, 120, 255, 0.09);
  border-color: rgba(0, 120, 255, 0.22);
}

.shufflrr-ask-ai__message--user {
  background: rgba(32, 56, 100, 0.13);
  border-color: rgba(32, 56, 100, 0.28);
}

.shufflrr-ask-ai__refs-title {
  margin-top: 9px;
  font-weight: 700;
  color: var(--links);
}

.shufflrr-ask-ai__refs {
  margin: 6px 0 0;
  padding-left: 18px;
}

.shufflrr-ask-ai__form {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(0, 120, 255, 0.16);
  background: rgba(0, 120, 255, 0.04);
}

.shufflrr-ask-ai__input {
  flex: 1;
  min-width: 0;
  border-radius: 10px;
  border: 1px solid rgba(0, 120, 255, 0.25);
  padding: 10px 12px;
  background: var(--bg);
  color: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shufflrr-ask-ai__input:focus {
  outline: none;
  border-color: #0078ff;
  box-shadow: 0 0 0 3px rgba(0, 120, 255, 0.18);
}

.shufflrr-ask-ai__submit {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  background: linear-gradient(90deg, #203864 0%, #0078ff 100%);
  box-shadow: 0 8px 20px rgba(0, 120, 255, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.shufflrr-ask-ai__submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 120, 255, 0.35);
}

.shufflrr-ask-ai__submit:active {
  transform: translateY(0);
}

/* Typing / loading indicator */
.shufflrr-ask-ai__typing {
  opacity: 0.6;
  font-style: italic;
}

/* Error message */
.shufflrr-ask-ai__error {
  color: #c53030;
}
