/*──────────────────────────────────────────────────────────────────────────────
  Reseed Documentation Styles
  Inspired by Snowflake documentation design
──────────────────────────────────────────────────────────────────────────────*/

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Colors */
  --docs-bg: #ffffff;
  --docs-sidebar-bg: #f8f9fa;
  --docs-border: #e5e7eb;
  --docs-text: #1f2937;
  --docs-text-muted: #6b7280;
  --docs-link: #124F6E;
  --docs-link-hover: #0d3a52;
  --docs-accent: #249EDC;
  --docs-code-bg: #f3f4f6;
  --docs-nav-active: #249EDC;
  --docs-sidebar-hover: #e5e7eb;
  --docs-header-bg: #1f2937;
  --docs-header-text: #ffffff;
  
  /* Spacing */
  --sidebar-width: 280px;
  --header-height: 60px;
  --nav-height: 48px;
  --content-max-width: 900px;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + var(--nav-height) + 2rem);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--docs-text);
  background: var(--docs-bg);
}

a {
  color: var(--docs-link);
  text-decoration: none;
}

a:hover {
  color: var(--docs-link-hover);
  text-decoration: underline;
}

/*──────────────────────────────────────────────────────────────────────────────
  Header
──────────────────────────────────────────────────────────────────────────────*/
.docs-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--docs-header-bg);
  color: var(--docs-header-text);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 1000;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.docs-header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--docs-header-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
}

.docs-header-logo:hover {
  color: var(--docs-header-text);
  text-decoration: none;
}

.docs-header-logo img {
  height: 32px;
  width: auto;
}

.docs-header-divider {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.3);
  margin: 0 1rem;
}

.docs-header-title {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.9;
}

.docs-header-links {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
}

.docs-header-links a {
  color: rgba(255,255,255,0.8);
  font-size: 0.875rem;
  transition: color 0.15s;
}

.docs-header-links a:hover {
  color: var(--docs-header-text);
  text-decoration: none;
}

/*──────────────────────────────────────────────────────────────────────────────
  Section Navigation (Top Tabs)
──────────────────────────────────────────────────────────────────────────────*/
.docs-nav {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--docs-bg);
  border-bottom: 1px solid var(--docs-border);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  z-index: 999;
}

.docs-nav-list {
  display: flex;
  list-style: none;
  gap: 0;
  height: 100%;
}

.docs-nav-item {
  height: 100%;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1.25rem;
  color: var(--docs-text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.docs-nav-link:hover {
  color: var(--docs-text);
  text-decoration: none;
  background: var(--docs-sidebar-bg);
}

.docs-nav-link.active {
  color: var(--docs-nav-active);
  border-bottom-color: var(--docs-nav-active);
}

/*──────────────────────────────────────────────────────────────────────────────
  Layout Container
──────────────────────────────────────────────────────────────────────────────*/
.docs-layout {
  display: flex;
  margin-top: calc(var(--header-height) + var(--nav-height));
  min-height: calc(100vh - var(--header-height) - var(--nav-height));
}

/*──────────────────────────────────────────────────────────────────────────────
  Sidebar
──────────────────────────────────────────────────────────────────────────────*/
.docs-sidebar {
  position: fixed;
  top: calc(var(--header-height) + var(--nav-height));
  left: 0;
  width: var(--sidebar-width);
  height: calc(100vh - var(--header-height) - var(--nav-height));
  background: var(--docs-sidebar-bg);
  border-right: 1px solid var(--docs-border);
  overflow-y: auto;
  padding: 1.5rem 0;
}

.docs-sidebar-section {
  margin-bottom: 1.5rem;
}

.docs-sidebar-title {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--docs-text-muted);
  padding: 0 1.5rem;
  margin-bottom: 0.5rem;
}

.docs-sidebar-list {
  list-style: none;
}

.docs-sidebar-link {
  display: block;
  padding: 0.5rem 1.5rem;
  color: var(--docs-text);
  font-size: 0.875rem;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}

.docs-sidebar-link:hover {
  background: var(--docs-sidebar-hover);
  text-decoration: none;
}

.docs-sidebar-link.active {
  background: rgba(36, 158, 220, 0.1);
  border-left-color: var(--docs-nav-active);
  color: var(--docs-nav-active);
  font-weight: 500;
}

.docs-sidebar-sublist {
  list-style: none;
  padding-left: 1rem;
}

.docs-sidebar-sublink {
  display: block;
  padding: 0.35rem 1.5rem;
  color: var(--docs-text-muted);
  font-size: 0.8125rem;
  transition: all 0.15s;
}

.docs-sidebar-sublink:hover {
  color: var(--docs-text);
  text-decoration: none;
}

.docs-sidebar-sublink.active {
  color: var(--docs-nav-active);
}

/*──────────────────────────────────────────────────────────────────────────────
  Main Content
──────────────────────────────────────────────────────────────────────────────*/
.docs-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 2rem 3rem 4rem;
  max-width: calc(var(--content-max-width) + var(--sidebar-width) + 6rem);
}

.docs-content-inner {
  max-width: var(--content-max-width);
}

/*──────────────────────────────────────────────────────────────────────────────
  Typography
──────────────────────────────────────────────────────────────────────────────*/
.docs-content h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--docs-text);
  line-height: 1.2;
}

.docs-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--docs-text);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--docs-border);
  position: relative;
}

.docs-content h2[id],
.docs-content h3[id] {
  position: relative;
  padding-left: 0;
}

.docs-content h2[id] .anchor-link,
.docs-content h3[id] .anchor-link {
  position: absolute;
  left: -1.25rem;
  opacity: 0;
  color: var(--docs-text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: opacity 0.15s;
  padding-right: 0.5rem;
  font-weight: normal;
}

.docs-content h2[id]:hover .anchor-link,
.docs-content h3[id]:hover .anchor-link,
.docs-content h2[id] .anchor-link:focus,
.docs-content h3[id] .anchor-link:focus {
  opacity: 0.6;
}

.docs-content h2[id] .anchor-link:hover,
.docs-content h3[id] .anchor-link:hover {
  opacity: 1;
  color: var(--docs-link);
}

.docs-content h2[id] a,
.docs-content h3[id] a {
  color: inherit;
  text-decoration: none;
}

.docs-content h2[id] a:hover,
.docs-content h3[id] a:hover {
  text-decoration: none;
}

.docs-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--docs-text);
}

.docs-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--docs-text);
}

.docs-content p {
  margin-bottom: 1rem;
}

.docs-content ul,
.docs-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.docs-content li {
  margin-bottom: 0.5rem;
}

.docs-content li > ul,
.docs-content li > ol {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

/*──────────────────────────────────────────────────────────────────────────────
  Intro/Lead Paragraph
──────────────────────────────────────────────────────────────────────────────*/
.docs-lead {
  font-size: 1.125rem;
  color: var(--docs-text-muted);
  margin-bottom: 2rem;
  line-height: 1.8;
}

/*──────────────────────────────────────────────────────────────────────────────
  Code
──────────────────────────────────────────────────────────────────────────────*/
.docs-content code {
  font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  font-size: 0.875em;
  background: var(--docs-code-bg);
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  color: #059669;
}

.docs-content pre {
  background: var(--docs-header-bg);
  color: #e5e7eb;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.docs-content pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/*──────────────────────────────────────────────────────────────────────────────
  Callouts / Notes
──────────────────────────────────────────────────────────────────────────────*/
.docs-note {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 0 8px 8px 0;
}

.docs-note-title {
  font-weight: 600;
  color: #1e40af;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.docs-note p:last-child {
  margin-bottom: 0;
}

.docs-warning {
  background: #fef3c7;
  border-left-color: #f59e0b;
}

.docs-warning .docs-note-title {
  color: #92400e;
}

.docs-tip {
  background: #ecfdf5;
  border-left-color: #10b981;
}

.docs-tip .docs-note-title {
  color: #065f46;
}

/*──────────────────────────────────────────────────────────────────────────────
  Tables
──────────────────────────────────────────────────────────────────────────────*/
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.docs-content th,
.docs-content td {
  padding: 0.75rem 1rem;
  text-align: left;
  border: 1px solid var(--docs-border);
}

.docs-content th {
  background: var(--docs-sidebar-bg);
  font-weight: 600;
}

.docs-content tr:hover td {
  background: #fafafa;
}

/*──────────────────────────────────────────────────────────────────────────────
  Steps / Procedure
──────────────────────────────────────────────────────────────────────────────*/
.docs-steps {
  counter-reset: step-counter;
  list-style: none;
  padding-left: 0;
}

.docs-step {
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
  counter-increment: step-counter;
}

.docs-step::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  background: var(--docs-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.docs-step-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/*──────────────────────────────────────────────────────────────────────────────
  Cards Grid (for landing page)
──────────────────────────────────────────────────────────────────────────────*/
.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.docs-cards-2col {
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.docs-card {
  background: var(--docs-bg);
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  padding: 1.5rem;
  transition: all 0.2s;
}

.docs-card:hover {
  border-color: var(--docs-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  text-decoration: none;
}

.docs-card-icon {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
}

.docs-card-title {
  font-weight: 600;
  color: var(--docs-text);
  margin-bottom: 0.5rem;
}

.docs-card-desc {
  font-size: 0.875rem;
  color: var(--docs-text-muted);
  margin: 0;
}

/*──────────────────────────────────────────────────────────────────────────────
  Release Notes Specific
──────────────────────────────────────────────────────────────────────────────*/
.docs-release {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--docs-border);
}

.docs-release:last-child {
  border-bottom: none;
}

.docs-release-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.docs-release-version {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--docs-text);
}

.docs-release-date {
  font-size: 0.875rem;
  color: var(--docs-text-muted);
}

.docs-release-tag {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  text-transform: uppercase;
}

.docs-release-tag.new {
  background: #ecfdf5;
  color: #065f46;
}

.docs-release-tag.fix {
  background: #fef3c7;
  color: #92400e;
}

.docs-release-tag.improved {
  background: #eff6ff;
  color: #1e40af;
}

/*──────────────────────────────────────────────────────────────────────────────
  Footer
──────────────────────────────────────────────────────────────────────────────*/
.docs-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--docs-border);
  font-size: 0.875rem;
  color: var(--docs-text-muted);
}

.docs-footer a {
  color: var(--docs-text-muted);
}

.docs-footer a:hover {
  color: var(--docs-text);
}

/*──────────────────────────────────────────────────────────────────────────────
  Mobile Responsive
──────────────────────────────────────────────────────────────────────────────*/
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 240px;
  }
  
  .docs-content {
    padding: 1.5rem 2rem 3rem;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
    --nav-height: 44px;
  }
  
  .docs-header-divider,
  .docs-header-title {
    display: none;
  }
  
  .docs-sidebar {
    display: none;
  }
  
  .docs-content {
    margin-left: 0;
    padding: 1.5rem 1rem 3rem;
  }
  
  .docs-nav {
    padding: 0 0.5rem;
    overflow-x: auto;
  }
  
  .docs-nav-link {
    padding: 0 0.75rem;
    font-size: 0.8125rem;
    white-space: nowrap;
  }
  
  .docs-content h1 {
    font-size: 1.75rem;
  }
  
  .docs-content h2 {
    font-size: 1.25rem;
  }
  
  .docs-cards {
    grid-template-columns: 1fr;
  }
  
  .docs-cards-2col {
    grid-template-columns: 1fr;
  }
}

/* Mobile sidebar toggle (for future enhancement) */
.docs-mobile-toggle {
  display: none;
}

/*──────────────────────────────────────────────────────────────────────────────
  Screenshot Annotations
──────────────────────────────────────────────────────────────────────────────*/
.docs-screenshot {
  position: relative;
  margin: 2rem 0;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--docs-bg);
  /* Container must match image dimensions exactly for percentage-based annotations */
  display: block;
  width: 100%;
  /* Remove any padding that could affect annotation positioning */
  padding: 0;
}

.docs-screenshot img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  /* Image fills container exactly - no gaps */
}

.docs-screenshot-caption {
  padding: 0.75rem 1rem;
  background: var(--docs-sidebar-bg);
  font-size: 0.875rem;
  color: var(--docs-text-muted);
  border-top: 1px solid var(--docs-border);
}

.docs-screenshot-annotation {
  position: absolute;
  pointer-events: none;
}

.docs-screenshot-box {
  border: 2px solid var(--docs-accent);
  background: rgba(36, 158, 220, 0.05);
  border-radius: 4px;
}

.docs-screenshot-label {
  position: absolute;
  background: var(--docs-accent);
  color: white;
  padding: 0.25rem 0.5rem;
  font-size: clamp(0.625rem, 1.2vw, 0.875rem);
  font-weight: 600;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: auto;
}

/* Responsive font sizing for labels - scales with image container */
.docs-screenshot {
  font-size: 16px; /* Base size for em calculations */
}

.docs-screenshot-label[data-original-font-size] {
  /* Font size will be set inline as percentage, but we ensure minimum readability */
  font-size: clamp(0.625rem, 0.8vw, 1rem);
}

.docs-screenshot-label::after {
  content: "";
  position: absolute;
  border: 4px solid transparent;
}

.docs-screenshot-label.top::after {
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-top-color: var(--docs-accent);
}

.docs-screenshot-label.bottom::after {
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-color: var(--docs-accent);
}

.docs-screenshot-label.left::after {
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-left-color: var(--docs-accent);
}

.docs-screenshot-label.right::after {
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-right-color: var(--docs-accent);
}

.docs-screenshot-arrow {
  position: absolute;
  width: 2px;
  background: var(--docs-accent);
  transform-origin: top left;
}

.docs-screenshot-arrow::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

.docs-screenshot-arrow.horizontal::after {
  right: -6px;
  top: -4px;
  border-width: 4px 0 4px 6px;
  border-color: transparent transparent transparent var(--docs-accent);
}

.docs-screenshot-arrow.vertical::after {
  bottom: -6px;
  left: -4px;
  border-width: 6px 4px 0 4px;
  border-color: var(--docs-accent) transparent transparent transparent;
}

.docs-screenshot-number {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--docs-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  border: 2px solid white;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.docs-screenshot-callout {
  position: absolute;
  background: white;
  border: 2px solid var(--docs-accent);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  max-width: 250px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 10;
}

.docs-screenshot-callout::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-style: solid;
}

.docs-screenshot-callout.top::before {
  top: -8px;
  left: 20px;
  border-width: 0 8px 8px 8px;
  border-color: transparent transparent var(--docs-accent) transparent;
}

.docs-screenshot-callout.bottom::before {
  bottom: -8px;
  left: 20px;
  border-width: 8px 8px 0 8px;
  border-color: var(--docs-accent) transparent transparent transparent;
}

/*──────────────────────────────────────────────────────────────────────────────
  Screenshot Thumbnail & Lightbox
──────────────────────────────────────────────────────────────────────────────*/
.docs-screenshot-thumbnail {
  position: relative;
  margin: 2rem 0;
  cursor: pointer;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--docs-bg);
  transition: all 0.2s;
}

.docs-screenshot-thumbnail:hover {
  border-color: var(--docs-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.docs-screenshot-thumbnail::after {
  content: "Click to enlarge";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 0.5rem;
  font-size: 0.75rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.docs-screenshot-thumbnail:hover::after {
  opacity: 1;
}

.docs-screenshot-thumbnail img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.docs-screenshot-thumbnail .docs-screenshot-annotation {
  opacity: 0.7; /* Show but dimmed in thumbnail */
}

.docs-lightbox .docs-screenshot-annotation {
  opacity: 1; /* Full opacity in lightbox */
}

/* Lightbox Modal */
.docs-lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: 10000;
  padding: 2rem;
  overflow-y: auto;
  cursor: pointer;
}

.docs-lightbox.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.docs-lightbox-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  background: var(--docs-bg);
  border-radius: 8px;
  padding: 1rem;
  cursor: default;
  overflow: auto;
}

.docs-lightbox-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

.docs-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: background 0.2s;
}

.docs-lightbox-close:hover {
  background: rgba(0,0,0,0.9);
}

.docs-lightbox-close::before {
  content: "×";
  line-height: 1;
}

.docs-lightbox-caption {
  padding: 1rem;
  color: var(--docs-text);
  font-size: 0.875rem;
  text-align: center;
}

@media (max-width: 768px) {
  .docs-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    color: var(--docs-header-text);
    cursor: pointer;
    margin-right: 0.5rem;
  }
  
  .docs-screenshot-callout {
    max-width: 200px;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
  }
  
  .docs-lightbox {
    padding: 0.5rem;
  }
  
  .docs-lightbox-content {
    padding: 0.5rem;
  }
}

