/* AdalFlow Modern Theme — custom.css */

:root {
  --adal-green: #00FF88;
  --adal-green-dim: rgba(0, 255, 136, 0.15);
  --adal-green-border: rgba(0, 255, 136, 0.3);
  --adal-radius: 8px;
  --adal-transition: 0.2s ease;
}

/* ── Typography ── */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

p {
  font-size: 0.92em;
  line-height: 1.7;
  margin-bottom: 1.15rem;
}

h1 { font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.5rem; font-weight: 600; letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; font-weight: 600; }

/* ── Sidebar Brand (Logo / AdalFlow) ── */
.sidebar-brand-custom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0.5rem;
}

.sidebar-brand-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: opacity var(--adal-transition);
}

.sidebar-brand-logo-link:hover {
  opacity: 0.7;
}

.sidebar-brand-logo-link .sidebar-logo {
  height: 28px !important;
  width: auto !important;
  max-height: 28px !important;
}

.sidebar-brand-separator {
  font-size: 1.3rem;
  font-weight: 300;
  opacity: 0.3;
  user-select: none;
}

.sidebar-brand-text-link {
  text-decoration: none !important;
  color: var(--color-foreground-primary) !important;
  transition: opacity var(--adal-transition);
}

.sidebar-brand-text-link:hover {
  opacity: 0.7;
}

.sidebar-brand-text {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* Hide default Furo brand if it still renders */
.sidebar-brand {
  display: none !important;
}

/* GitHub sidebar link */
.sidebar-github-section {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--color-sidebar-background-border);
}

.sidebar-github-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-foreground-secondary) !important;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  transition: all var(--adal-transition);
}

.sidebar-github-link:hover {
  color: var(--adal-green) !important;
  transform: translateX(2px);
}

.sidebar-github-link i {
  font-size: 1.1rem;
}

/* ── Code blocks ── */
.highlight pre {
  font-size: 0.78em !important;
  line-height: 1.5;
  border-radius: var(--adal-radius);
  padding: 1em 1.2em;
}

.highlight {
  border-radius: var(--adal-radius);
}

code.literal {
  font-size: 0.88em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* ── Content area ── */
.bd-main .bd-content .bd-article-container {
  max-width: 100%;
}

.bd-links__title {
  display: none;
}

/* ── Tables ── */
table {
  width: auto;
  border-radius: var(--adal-radius);
  overflow: hidden;
}

table tr:hover {
  background-color: transparent !important;
}

.caption-text {
  font-size: 13px;
  color: var(--color-foreground-muted);
}

/* ── Cards ── */
.intro-card {
  padding: 24px 16px 20px;
  border-radius: var(--adal-radius);
  transition: transform var(--adal-transition), box-shadow var(--adal-transition);
}

.intro-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.intro-card .sd-card-img-top {
  margin: 10px;
  height: 48px;
  background: none !important;
}

.intro-card .sd-card-title {
  font-size: 1rem;
  font-weight: 600;
  padding: 0.75rem 0 0.4rem;
}

.intro-card .sd-card-footer {
  border: none !important;
}

.intro-card .sd-card-footer p.sd-card-text {
  max-width: 220px;
  margin-left: auto;
  margin-right: auto;
}

.card,
.card img {
  background-color: var(--color-background-primary);
}

/* ── Tabs (sphinx-tabs) ── */
.sphinx-tabs .sphinx-tabs-tab {
  font-size: 0.88em;
  font-weight: 500;
  padding: 0.5em 1em;
  border-radius: var(--adal-radius) var(--adal-radius) 0 0;
  transition: all var(--adal-transition);
}

.sphinx-tabs .sphinx-tabs-tab[aria-selected="true"] {
  font-weight: 600;
}

/* ── Admonitions ── */
.admonition {
  border-radius: var(--adal-radius);
  border-width: 0 0 0 3px;
}

/* ── Links ── */
a {
  transition: color var(--adal-transition);
}

/* ── Signature names (API docs) ── */
.sig-name {
  font-weight: 600;
}

/* ── Search ── */
.search-button-field {
  display: none !important;
}

/* ── Responsive sidebar ── */
.bd-sidebar-primary {
  width: 100%;
}

@media (min-width: 768px) {
  .bd-sidebar-primary {
    width: 260px;
  }
}

/* ── Scrollbar (webkit) ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(128, 128, 128, 0.3);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(128, 128, 128, 0.5);
}

/* ── Theme-specific overrides ── */

/* Unified backgrounds: sidebar matches content */
body[data-theme="light"],
body:not([data-theme="dark"]) {
  --color-sidebar-background: #ffffff;
  --color-sidebar-background-border: #e8e8e8;
  --color-background-primary: #ffffff;
  --pst-color-secondary: #3d3d3d;
  --pst-color-table-row-hover-bg: #f8f9fa;
}

body[data-theme="dark"] {
  --color-sidebar-background: #1a1a1a;
  --color-sidebar-background-border: #2a2a2a;
  --color-background-primary: #1a1a1a;
}

/* Remove hard sidebar border for seamless look */
.sidebar-drawer {
  border-right: 1px solid var(--color-sidebar-background-border) !important;
}

/* ── Announcement banner (legacy, kept for compatibility) ── */
.announcement-banner {
  background-color: #7acef0;
  color: white;
  padding: 10px 20px;
  position: fixed;
  width: 100%;
  z-index: 1000;
  top: 0;
  left: 0;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  font-size: 14px;
}

.announcement-banner p { margin: 0; color: white; }
.announcement-banner a { color: white !important; }
.announcement-banner button {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  margin-left: 10px;
}

.bd-header-announcement,
.bd-header-announcement__content {
  background-color: transparent;
  padding: 0;
  margin: 0;
}
