/* override table width restrictions to make font size smaller and avoid the scrollbar */

.wy-table-responsive table.wide-table,
.wy-table-responsive table.wide-table th,
.wy-table-responsive table.wide-table td,
.wy-table-responsive table.wide-table th p,
.wy-table-responsive table.wide-table td p {
    font-size: smaller;
}

/* Target all tables generated by Sphinx with high specificity */
.rst-content table.docutils,
.rst-content table.docutils th,
.rst-content table.docutils td {
  border-left: none !important;
  border-right: none !important;
  border-collapse: collapse !important;
}

/* make selected table full width */

.full-width-table {
  width: 100% !important;
}

/* justify all the documentation content */

.section,
.rst-content .section,
.wy-nav-content .section,
.document .documentwrapper .bodywrapper .body .section,
.rst-content .body .section,
.rst-content p,
.rst-content div.body p {
     text-align: justify !important;
}

/* Additional justification for specific content elements */
.rst-content .section > p,
.rst-content .section > div > p,
.rst-content .toctree-wrapper p {
     text-align: justify !important;
}

/* Larger space between paragraph and following list */
.rst-content p + ul,
.rst-content p + ol {
    margin-top: 20px;
}

/* Space for lists inside blockquotes (when text ends with colon) */
.rst-content p + blockquote ul,
.rst-content p + blockquote ol {
    margin-top: 0;
    margin-left: 20px;
}

.rst-content p + blockquote {
    margin-top: 12px;
    margin-bottom: 12px;
    margin-left: 24;
    padding-left: 0;
}

/* Space after list before next paragraph */
.rst-content ul + p,
.rst-content ol + p,
.rst-content blockquote + p {
    margin-top: 24px;
}

/* CSV / longtable – zawijanie tekstu */
.wy-table-responsive table td,
.wy-table-responsive table th {
    white-space: normal !important;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/*Formatting for "h2" not included in TOC */

.no-toc-sub, .no-toc-sub-2, .no-toc-sub-3 {
    color: #333333;
    margin-top:20px;
    margin-bottom:15px;
    font-weight: 700;
    display: block;
}

.no-toc-sub {
    font-size: 150%; /* this equals the h2 size in the theme.css */
}

.no-toc-sub-2 {
    font-size: 120%;
}

.no-toc-sub-3 {
    font-size: 115%;
}


/* Customize the color for the .. note:: directive - Fudo style */
div.admonition.note {
    background-color: #f8fafb;
    border-bottom: 2px solid #e5e8ed;
    border-right: 2px solid #e5e8ed;
    color: #4A5568; /* Softer text color */
    border-radius: 6px 6px 6px 6px;
    margin-top: 20px;
}

/* Customize the title color inside the note - Fudo style */
div.admonition.note .admonition-title {
    color: white;
    background-color: #6B91C7; /* Muted Fudo blue */
    border-right: 2px solid #e5e8ed;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

/* Customize the color for the .. warning:: directive - Fudo style */
div.admonition.warning {
    background-color: #f8f6fa;
    border-bottom: 2px solid #e5e5ed;
    border-right: 2px solid #e5e5ed;
    color: #4A5568; /* Softer text color */
    border-radius: 6px 6px 6px 6px;
    margin-top: 20px;
}

/* Customize the title color inside the warning - Fudo style */
div.admonition.warning .admonition-title {
    color: white;
    background-color: #B85450; /* Muted red accent */
    border-right: 2px solid #e5e5ed;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

/* Success/Tip admonitions */
div.admonition.tip,
div.admonition.hint,
div.admonition.important {
    background-color: #f8f6fa;
    border-bottom: 2px solid #e5e5ed;
    border-right: 2px solid #e5e5ed;
    color: #4A5568;
    border-radius: 6px;
    margin-top: 20px;
}

div.admonition.tip .admonition-title,
div.admonition.hint .admonition-title,
div.admonition.important .admonition-title {
    color: white;
    background-color: #5A9A5A; /* Muted green accent */
    border-right: 2px solid #e5e5ed;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

/* Caution/Attention admonitions */
div.admonition.caution,
div.admonition.attention {
    background-color: #f8f6fa;
    border-bottom: 2px solid #e5e5ed;
    border-right: 2px solid #e5e5ed;
    color: #4A5568;
    border-radius: 6px;
    margin-top: 20px;
}

div.admonition.caution .admonition-title,
div.admonition.attention .admonition-title {
    color: white;
    background-color: #B8860B; /* Muted orange accent */
    border-right: 2px solid #e5e5ed;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

/* Danger admonitions (for deprecated warnings) */
div.admonition.danger,
.rst-content .danger {
    background-color: #f8f6fa;
    border-bottom: 2px solid #e5e5ed;
    border-right: 2px solid #e5e5ed;
    color: #4A5568;
    border-radius: 6px;
    margin-top: 20px;
}

div.admonition.danger .admonition-title,
.rst-content .danger .admonition-title {
    color: white;
    background-color: #B85450; /* Muted red accent - same as warning */
    border-right: 2px solid #e5e5ed;
    font-weight: 600;
    border-radius: 6px 6px 0 0;
}

/******************** API DOCUMENTATION FORMATTING **********************/
/*Formatting for code block */

code, pre {
    font-size: 14px;
    background-color: #f7f7f9;
    border: 1px solid #d0d0d5;
    border-radius: 6px;
    padding: 10px 14px;
    overflow-x: auto;
    font-family: Menlo, Consolas, "Courier New", monospace;
    line-height: 1.5;
  }

/* For sphinx_copybutton */
/* Hide default SVG or fallback icon */
.copybtn svg {
    display: none;
  }
  
.copybtn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  background: #f7f7f9;
  border-radius: 4px;
  cursor: pointer;
}

.copybtn::before {
    content: "\f0c5"; /* clipboard */
    font: var(--fa-font-regular);
    font-size: 15px;
    color: #126684;
}

/* example/response headers */
.api-request, .api-example, .api-description, .api-response {
    color: #126684;
    margin-top:20px;
    margin-bottom:15px;
    font-weight: 700;
    font-size: 110%;
    display: block;
}

.api-endpoint {
        color: #126684;
        font-family: var(--code-font-family, monospace);
        font-size: 100%;
        margin-top:20px;
        margin-bottom:15px;
        display: block;
        background-color: #f7f7f9;
        padding: 6px 10px;
        border-left: 12px solid #126684;
        border-radius: 4px;
    }

/* NEW sign in TOC */
.badge-new {
  background-color: #e74c3c;
  color: white;
  font-size: 0.7em;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
}

/*/Styles for the DRAFT version banner/*/

.draft-banner {
    background: linear-gradient(to left, #f6f6fb, #dfe4f6, #e62d3014); /* <- soft red tint at the end */
    border-bottom: 1px solid #c8d0f0;
    padding: 12px 20px;
    text-align: left;
    font-weight: 500;
    font-size: 1rem;
    color: #2f3a69;
    font-family: inherit;
    margin-bottom: 20px;
}

.draft-banner i.fa-bell {
    margin-right: 8px;
    color: #2f3a69;
    font-size: 1.1em;
    vertical-align: middle;
    font-style: normal;
}

.draft-banner a {
    color: #2f3a69;
    text-decoration: underline;
    font-weight: 600;
    margin-left: 6px;
}

.draft-banner .draft-icon {
    height: 1.2em;
    width: 1.2em;
    vertical-align: middle;
    margin-right: 8px;
}

/* ===== Fixes for Sphinx 8.2.3 ===== */

/* Fix for Sphinx 8.2.3 - Restore bullet points in admonition boxes only */
.rst-content .admonition ul,
.rst-content .admonition ol {
    margin-left: 24px;
}

/* Fix for Sphinx 8.2.3 - Restore bullet points in content lists */

/* default: list after text */
.rst-content p + ul,
.rst-content p + ul.simple {
    margin-left: 24px;
}

/* exception: if this list is part of an item in another list */
.rst-content li > ul,
.rst-content li > p + ul,
.rst-content li > ul.simple,
.rst-content li > p + ul.simple {
    margin-left: 12px;
}

/* Additional specificity for RTD theme - target simple lists specifically */
.rst-content ul.simple li {
    list-style: disc outside !important;
}

.rst-content ol.simple li {
    list-style: decimal outside !important;
}

/* Ensure logo displays properly */
.wy-side-nav-search img.logo {
    display: block !important;
    max-width: 100%;
    height: auto;
    margin: 0 auto 10px auto;
}

/* ===== FUDO BRAND COLORS ALIGNMENT ===== */

  /* Update sidebar to match Fudo app light theme */
  .wy-nav-side {
      background: #F7F8FC !important;
      border-right: 1px solid #E2E8F0;
  }

  /* Update sidebar text colors */
  .wy-menu-vertical a {
      color: #4A5568 !important;
  }

  .wy-menu-vertical li.current>a,
  .wy-menu-vertical li.on a {
      background: #E6F3FF !important;
      color: #1A73E8 !important;
      border-right: 3px solid #4285F4;
  }

  /* Update search box to match Fudo styling */
  .wy-side-nav-search {
      background: #F7F8FC !important;
      border-bottom: 1px solid #E2E8F0;
  }

  .wy-side-nav-search input[type=text] {
      background: #FFFFFF !important;
      border: 1px solid #E2E8F0 !important;
      border-radius: 6px !important;
      color: #2D3748;
  }

  /* Update primary buttons to match Fudo blue */
  .btn-primary,
  .wy-btn-primary {
      background: #4285F4 !important;
      border-color: #4285F4 !important;
  }

  .btn-primary:hover,
  .wy-btn-primary:hover {
      background: #1A73E8 !important;
      border-color: #1A73E8 !important;
  }

  /* Add Fudo red accent for important elements */
  .rst-content .admonition.warning .admonition-title {
      background: #E53E3E !important;
  }

  /* Update links to match Fudo blue */
  a {
      color: #1A73E8 !important;
  }

  a:hover {
      color: #1557B0 !important;
  }

  /* Update header navigation */
  .wy-nav-top {
      background: #4285F4 !important;
  }

  .wy-nav-top a {
      color: #fff !important;
      text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
  }

  .wy-nav-top a:hover {
      color: #f0f0f0 !important;
  }

  /* Update code blocks with softer styling */
  .rst-content pre,
  .rst-content code {
      background: #F7F8FC !important;
      border: 1px solid #E2E8F0 !important;
      color: #2D3748;
  }

  /* Add Fudo-style shadows and spacing */
  .wy-nav-content-wrap {
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }

  /* Update table styling to match modern Fudo design */
  .wy-table-responsive table th {
      background: #F7F8FC !important;
      color: #2D3748 !important;
      border-bottom: 2px solid #E2E8F0 !important;
  }

  .wy-table-responsive table td {
      border-bottom: 1px solid #E2E8F0 !important;
  }

  /* Modern button styling matching Fudo */
  .btn {
      border-radius: 6px !important;
      font-weight: 500;
      transition: all 0.2s ease;
  }

  /* Update logo area */
  .wy-side-nav-search img.logo {
      padding: 10px 0;
      border-bottom: 1px solid #E2E8F0;
  }

/* ===== DOCUMENTATION SWITCHER ===== */

/* Documentation Switcher Label */
.doc-switcher-label-top,
.toc-label-top,
.search-label-top {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 10px 10px 8px 6px;
    opacity: 0.7;
    text-align: left;
}

.toc-label-top {
    margin-left: 20px;
}

/* Ensure TOC aligns with other elements */
.wy-menu.wy-menu-vertical ul {
    margin-left: 0;
    padding-left: 0;
}

.wy-menu.wy-menu-vertical > ul {
    padding: 0 10px;
}

.doc-switcher {
    margin: 0px 0px 20px 0px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    /* Match search box width */
    width: calc(100%);
}

.doc-switcher-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.08) 0%, rgba(66, 133, 244, 0.03) 100%);
    transition: background 0.2s ease;
}

.doc-switcher-header:hover {
    background: linear-gradient(135deg, rgba(66, 133, 244, 0.15) 0%, rgba(66, 133, 244, 0.08) 100%);
}

.doc-switcher-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4A5568;
    font-weight: 600;
}

.doc-switcher-icon {
    transition: transform 0.3s ease;
    color: #4A5568;
}

.doc-switcher.active .doc-switcher-icon {
    transform: rotate(180deg);
}

.doc-switcher-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: #FFFFFF;
    border-top: 1px solid #E2E8F0;
}

.doc-switcher.active .doc-switcher-content {
    max-height: 300px;
}

.doc-switcher-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none !important;
    color: #4A5568 !important;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.doc-switcher-item:hover {
    background: rgba(66, 133, 244, 0.05);
    color: #1A73E8 !important;
    text-decoration: none !important;
}

.doc-switcher-item.active {
    background: rgba(26, 115, 232, 0.08);
    border-left-color: #1A73E8;
    color: #1A73E8 !important;
}

.doc-item-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    opacity: 0.7;
}

.doc-switcher-item:hover .doc-item-icon {
    opacity: 1;
}

.doc-item-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.doc-item-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 2px;
}

.doc-item-desc {
    font-size: 11px;
    color: #718096;
}

.doc-item-external {
    width: 14px;
    height: 14px;
    margin-left: 8px;
    opacity: 0.4;
    flex-shrink: 0;
}

.doc-switcher-item:hover .doc-item-external {
    opacity: 0.7;
}

/* Animation for smooth transitions */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doc-switcher.active .doc-switcher-content {
    animation: slideDown 0.3s ease-out;
}

/* Divider in documentation switcher */
.doc-switcher-divider {
    height: 1px;
    background-color: #e1e4e8;
    margin: 5px 0;
}

/* PDF download link styling */
.doc-switcher-pdf {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    text-decoration: none;
    color: #333;
    background-color: #f6f8fa;
    transition: background-color 0.2s;
}

.doc-switcher-pdf:hover {
    background-color: #e9ecef;
}

/* Mobile Responsive */
@media screen and (max-width: 768px) {
    /* Fix for side navigation width on mobile */
    .wy-nav-side.shift {
        width: 300px !important;
        max-width: 85%;
    }

    .wy-side-scroll {
        width: 100% !important;
        overflow-y: auto !important;
    }

    /* Fix content margin when menu is open */
    .wy-nav-content-wrap.shift {
        left: 300px !important;
        min-width: calc(100% - 300px) !important;
    }

    .doc-switcher {
        margin: 15px 10px;
        width: calc(100% - 20px);
    }

    .doc-switcher-header {
        padding: 10px 12px;
    }

    .doc-switcher-item {
        padding: 10px 12px;
    }

    .doc-item-title {
        font-size: 13px;
    }

    .doc-item-desc {
        font-size: 10px;
    }
}

/* ===== API Documentation Enhanced Navigation Indentation ===== */

/* Make group titles (captions) more prominent */
.wy-menu-vertical .caption-text {
    font-weight: 600 !important;
    font-size: 13px !important;
    color: #2D3748 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 12px !important;
    margin-bottom: 6px !important;
    padding-left: 0 !important;
    background: linear-gradient(90deg, rgba(66, 133, 244, 0.08) 0%, transparent 100%);
    padding: 6px 12px !important;
    border-radius: 4px;
    margin-left: -12px !important;
    margin-right: -12px !important;
}

/* First caption should not have excessive top margin */
.wy-menu-vertical > ul > p.caption:first-child .caption-text {
    margin-top: 8px !important;
}

/* Indent all lists that come after a caption (groups) */
.wy-menu-vertical p.caption + ul {
    margin-left: 25px !important;
    padding-left: 10px !important;
    border-left: 2px solid #E2E8F0;
}

/* Style for level 1 items within captioned groups */
.wy-menu-vertical p.caption + ul > li.toctree-l1 > a {
    padding-left: 15px !important;
    font-size: 13px;
}

/* Style for level 2 items (sub-items of l1 within groups) */
.wy-menu-vertical p.caption + ul li.toctree-l2 > a {
    padding-left: 45px !important;
    font-size: 12px;
}

/* Style for level 3 items (sub-items) */
.wy-menu-vertical p.caption + ul li.toctree-l3 > a {
    padding-left: 60px !important;
    font-size: 12px;
}

/* Style for level 4 items (deeper sub-items) */
.wy-menu-vertical p.caption + ul li.toctree-l4 > a {
    padding-left: 75px !important;
    font-size: 12px;
}

/* Add visual separation between main groups */
.wy-menu-vertical > ul > li.toctree-l1 {
    border-bottom: 1px solid rgba(226, 232, 240, 0.2);
    padding-bottom: 4px;
    margin-bottom: 4px;
}

/* Remove border from last item */
.wy-menu-vertical > ul > li.toctree-l1:last-child {
    border-bottom: none;
}

/* Highlight current/active items more clearly */
.wy-menu-vertical li.current > a,
.wy-menu-vertical li.toctree-l2.current > a,
.wy-menu-vertical li.toctree-l3.current > a {
    background: #E6F3FF !important;
    font-weight: 500;
    border-left: 3px solid #4285F4;
    margin-left: -3px;
}

/* Add hover effect for better interactivity */
.wy-menu-vertical li.toctree-l2 > a:hover {
    background: rgba(66, 133, 244, 0.05) !important;
    padding-left: 37px !important;
    transition: all 0.2s ease;
}

.wy-menu-vertical li.toctree-l3 > a:hover {
    padding-left: 52px !important;
}

.wy-menu-vertical li.toctree-l4 > a:hover {
    padding-left: 67px !important;
}

/* Ensure expand/collapse arrows are visible and properly positioned */
.wy-menu-vertical li.toctree-l1.has-children > a:before,
.wy-menu-vertical li.toctree-l2.has-children > a:before {
    content: "▶";
    position: absolute;
    left: 10px;
    font-size: 10px;
    color: #718096;
    transition: transform 0.2s ease;
}

.wy-menu-vertical li.toctree-l1.current.has-children > a:before,
.wy-menu-vertical li.toctree-l2.current.has-children > a:before {
    transform: rotate(90deg);
}

/* Additional spacing for better visual hierarchy */
.wy-menu-vertical li.toctree-l1 > ul {
    margin-top: 4px;
}

.wy-menu-vertical li.toctree-l2 > ul {
    margin-left: 15px !important;
}
