/* Jixie Documentation Custom Styles
 * Modern styling for Confluence-exported documentation
 */

:root {
  --primary-color: #0056b3;
  --secondary-color: #6c757d;
  --background-color: #ffffff;
  --text-color: #333333;
  --border-color: #e9ecef;
  --link-color: #0056b3;
  --link-hover-color: #003d7a;
  --code-bg-color: #f8f9fa;
  --table-header-bg: #f8f9fa;
  --table-border-color: #dee2e6;
  --font-family-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --font-family-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
}

/* Base styles */
body.jixie-docs {
  font-family: var(--font-family-sans);
  color: var(--text-color);
  line-height: 1.6;
  background-color: var(--background-color);
  margin: 0;
  padding: 0;
}

/* Layout */
.jixie-docs #page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  background-color: var(--background-color);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

.jixie-docs #main {
  border: none !important;
  background-color: var(--background-color);
  padding: 0;
}

.jixie-docs #main-header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: #f8f9fa;
}

.jixie-docs #content {
  padding: 2rem;
}

/* Typography */
.jixie-docs h1, 
.jixie-docs h2, 
.jixie-docs h3, 
.jixie-docs h4, 
.jixie-docs h5, 
.jixie-docs h6 {
  margin-top: 1.5em;
  margin-bottom: 0.75em;
  font-weight: 600;
  line-height: 1.3;
  color: #212529;
}

.jixie-docs h1 {
  font-size: 2.25rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.jixie-docs h2 {
  font-size: 1.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.25rem;
}

.jixie-docs h3 {
  font-size: 1.5rem;
}

.jixie-docs h4 {
  font-size: 1.25rem;
}

.jixie-docs h5 {
  font-size: 1.1rem;
}

.jixie-docs h6 {
  font-size: 1rem;
}

.jixie-docs p {
  margin-bottom: 1.5rem;
}

/* Links */
.jixie-docs a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* Code blocks */
.jixie-docs code, 
.jixie-docs pre {
  font-family: var(--font-family-mono);
  background-color: var(--code-bg-color);
  border-radius: 4px;
}

.jixie-docs code {
  padding: 0.2em 0.4em;
  font-size: 0.9em;
}

.jixie-docs pre {
  padding: 1rem;
  overflow: auto;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.jixie-docs pre code {
  padding: 0;
  background-color: transparent;
}

/* Tables */
.jixie-docs table {
  width: 100%;
  margin-bottom: 1.5rem;
  border-collapse: collapse;
}

.jixie-docs th, 
.jixie-docs td {
  padding: 0.75rem;
  vertical-align: top;
  border: 1px solid var(--table-border-color);
}

.jixie-docs th {
  background-color: var(--table-header-bg);
  font-weight: 600;
  text-align: left;
}

.jixie-docs .confluenceTable {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.5rem;
}

.jixie-docs .confluenceTh, 
.jixie-docs .confluenceTd {
  padding: 0.75rem;
  border: 1px solid var(--table-border-color);
}

.jixie-docs .confluenceTh {
  background-color: var(--table-header-bg);
  font-weight: 600;
}

/* Lists */
.jixie-docs ul, 
.jixie-docs ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

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

/* Images */
.jixie-docs img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
}

.jixie-docs .image-center {
  margin-left: auto;
  margin-right: auto;
}

/* Breadcrumbs */
.jixie-docs #breadcrumb-section {
  margin-bottom: 1rem;
}

.jixie-docs #breadcrumbs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
}

.jixie-docs #breadcrumbs li {
  display: inline-block;
  margin-right: 0.5rem;
  margin-bottom: 0;
}

.jixie-docs #breadcrumbs li:after {
  content: "›";
  margin-left: 0.5rem;
  color: var(--secondary-color);
}

.jixie-docs #breadcrumbs li:last-child:after {
  content: "";
}

/* Page title */
.jixie-docs #title-heading {
  margin-top: 0;
  margin-bottom: 1rem;
  border-bottom: none;
}

/* Hide Confluence-specific elements */
.jixie-docs .page-metadata,
.jixie-docs #attachments,
.jixie-docs .pageSection,
.jixie-docs .childpages-macro {
  display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
  .jixie-docs #main-header,
  .jixie-docs #content {
    padding: 1rem;
  }
  
  .jixie-docs h1 {
    font-size: 1.75rem;
  }
  
  .jixie-docs h2 {
    font-size: 1.5rem;
  }
  
  .jixie-docs h3 {
    font-size: 1.25rem;
  }
  
  .jixie-docs table, 
  .jixie-docs .confluenceTable {
    display: block;
    overflow-x: auto;
  }
}

/* Custom button styles */
.jixie-docs .doc-button {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.2s ease;
}

.jixie-docs .doc-button:hover {
  background-color: var(--link-hover-color);
  color: white;
  text-decoration: none;
}

/* Custom callout boxes */
.jixie-docs .doc-callout {
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--primary-color);
  background-color: rgba(0, 86, 179, 0.05);
  border-radius: 0 4px 4px 0;
}

.jixie-docs .doc-callout-warning {
  border-left-color: #ffc107;
  background-color: rgba(255, 193, 7, 0.05);
}

.jixie-docs .doc-callout-danger {
  border-left-color: #dc3545;
  background-color: rgba(220, 53, 69, 0.05);
}

.jixie-docs .doc-callout-success {
  border-left-color: #28a745;
  background-color: rgba(40, 167, 69, 0.05);
}

/* Custom navigation */
.jixie-docs .doc-nav {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
}

.jixie-docs .doc-nav-prev,
.jixie-docs .doc-nav-next {
  display: inline-block;
  padding: 0.5rem 0;
}

.jixie-docs .doc-nav-next {
  margin-left: auto;
}

/* Jixie header and footer */
.jixie-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: #f8f9fa;
  border-bottom: 1px solid var(--border-color);
}

.jixie-logo img {
  height: 40px;
  margin: 0;
}

.jixie-nav {
  display: flex;
  gap: 1.5rem;
}

.jixie-nav-link {
  color: var(--text-color);
  text-decoration: none;
  font-weight: 500;
}

.jixie-nav-link:hover {
  color: var(--link-color);
}

.jixie-footer {
  padding: 1.5rem 2rem;
  background-color: #f8f9fa;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

/* Code block features */
.code-block-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.copy-code-button {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.25rem 0.5rem;
  background-color: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-code-button:hover {
  background-color: var(--primary-color);
  color: white;
}

/* External link icon */
.external-link-icon {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.8em;
}

#breadcrumbs li:before {
  content: "" !important;
  display: inline-block;
  padding: 0px;
}

/* Fix for Confluence column layouts */
.jixie-docs .columnLayout.two-equal,
.jixie-docs .columnLayout.two-left-sidebar,
.jixie-docs .columnLayout.two-right-sidebar,
.jixie-docs .columnLayout.three-equal {
  display: block;
  width: 100%;
}

.jixie-docs .columnLayout.two-equal .cell,
.jixie-docs .columnLayout.two-left-sidebar .cell,
.jixie-docs .columnLayout.two-right-sidebar .cell,
.jixie-docs .columnLayout.three-equal .cell {
  display: block;
  width: 100%;
  margin-right: 0;
}

.jixie-docs .columnLayout.two-equal .innerCell,
.jixie-docs .columnLayout.two-left-sidebar .innerCell,
.jixie-docs .columnLayout.two-right-sidebar .innerCell,
.jixie-docs .columnLayout.three-equal .innerCell {
  padding: 0;
  margin: 0;
}

/* Preserve fixed-width layout */
.jixie-docs .columnLayout.fixed-width {
  width: 100%;
  max-width: 100%;
}

/* Fix for excessive borders in Related articles section */
.jixie-docs ul.childpages-macro {
  border: none !important;
  box-shadow: none !important;
}

.jixie-docs .related-articles-section,
.jixie-docs h2[id*="-Relatedarticles"] + p + ul,
.jixie-docs h2[id*="-Relatedarticles"] ~ ul {
  border: none !important;
  border-top: 1px solid var(--border-color) !important;
  border-radius: 0;
  padding: 0;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: none !important;
}

.jixie-docs h2[id*="-Relatedarticles"] ~ ul {
  list-style-type: none;
  padding-left: 0;
}

.jixie-docs h2[id*="-Relatedarticles"] ~ ul li {
  border: none !important;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color) !important;
}

.jixie-docs h2[id*="-Relatedarticles"] ~ ul li:last-child {
  border-bottom: none !important;
}

.jixie-docs h2[id*="-Relatedarticles"] ~ ul li a {
  display: block;
  color: var(--link-color);
  font-weight: 500;
  text-decoration: none;
}

.jixie-docs h2[id*="-Relatedarticles"] ~ ul li a:hover {
  text-decoration: underline;
}

/* Fix for excessive borders in code examples and other nested elements */
.jixie-docs .code.panel,
.jixie-docs .code.panel .codeContent,
.jixie-docs .code.panel .panelContent {
  border: none !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.jixie-docs .code.panel {
  border-radius: 4px;
  margin-bottom: 1.5rem !important;
  overflow: hidden;
}

.jixie-docs .code.panel .codeContent,
.jixie-docs .code.panel .panelContent {
  padding: 0 !important;
}

.jixie-docs .code.panel pre.syntaxhighlighter-pre {
  margin: 0 !important;
  padding: 1rem !important;
  border: none !important;
  border-radius: 0 !important;
}

/* Fix for nested divs with borders */
.jixie-docs .contentLayout2 > div,
.jixie-docs .contentLayout2 > div > div,
.jixie-docs .contentLayout2 > div > div > div {
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}