@font-face {
  font-family: "NEXT ART Bold";
  src: url("../../fonts/NEXT ART_Bold.otf") format("opentype");
}

/* Scoped styles - don't affect header */
.readme-layout,
.readme-layout *,
.readme-sidebar,
.readme-sidebar *,
.readme-content,
.readme-content * {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* Page background for readme - header has its own fixed background */
body {
  background: linear-gradient(135deg, #0a0b0d 0%, #131417 40%, #0d1520 100%);
  background-attachment: fixed;
  margin: 0;
  padding: 0;
}

/* Using site header from styles.css - no overrides */

/* Layout */
.readme-layout {
  display: flex;
  padding-top: 0;
  min-height: calc(100vh - 80px);
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  background: linear-gradient(135deg, rgba(8, 10, 15, 0.3) 0%, transparent 100%);
}

/* Sidebar */
.readme-sidebar {
  width: 280px;
  position: fixed;
  top: 80px;
  left: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.98) 0%, rgba(6, 10, 18, 0.99) 100%);
  border-right: 1px solid rgba(0, 174, 228, 0.12);
  overflow-y: auto;
  padding: 20px 0;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
}

.readme-sidebar::-webkit-scrollbar {
  width: 5px;
}

.readme-sidebar::-webkit-scrollbar-track {
  background: rgba(0, 174, 228, 0.05);
}

.readme-sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #00aee4 0%, #0088b3 100%);
  border-radius: 3px;
}

/* Sidebar Title */
.readme-sidebar .readme-sidebar__title {
  font-family: "NEXT ART Bold", sans-serif;
  font-size: 15px;
  color: #00aee4;
  padding: 16px 20px 22px 20px;
  margin: 0 0 14px 0;
  text-transform: uppercase;
  letter-spacing: 3px;
  border-bottom: 1px solid rgba(0, 174, 228, 0.15);
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.readme-sidebar .readme-sidebar__title::before {
  content: "";
  width: 4px;
  height: 22px;
  background: linear-gradient(180deg, #00aee4 0%, #0088b3 100%);
  border-radius: 2px;
  flex-shrink: 0;
}

.readme-sidebar .readme-sidebar__title::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 20px;
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, #00aee4 0%, transparent 100%);
}

/* Navigation List */
.readme-sidebar .readme-nav {
  list-style: none;
  margin: 0;
  padding: 0 8px;
}

.readme-sidebar .readme-nav__item {
  border-radius: 6px;
  transition: all 0.2s ease;
  margin-bottom: 1px;
}

.readme-sidebar .readme-nav__item:hover {
  background: rgba(0, 174, 228, 0.06);
}

.readme-sidebar .readme-nav__item.active {
  background: rgba(0, 174, 228, 0.1);
}

/* Navigation Link - GRAY text, BOLD */
.readme-sidebar .readme-nav__link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  text-decoration: none !important;
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s ease;
  line-height: 1.4;
  color: rgba(160, 170, 180, 0.9) !important;
}

.readme-sidebar .readme-nav__link:hover {
  color: rgba(200, 210, 220, 1) !important;
}

.readme-sidebar .readme-nav__item.active .readme-nav__link {
  color: #ffffff !important;
}

/* Number styling - CYAN/BLUE */
.readme-sidebar .readme-nav__link i {
  color: #00aee4 !important;
  font-style: normal;
  font-weight: 700;
  font-size: 15px;
  min-width: 26px;
  text-align: right;
  flex-shrink: 0;
}

.readme-sidebar .readme-nav__item.active .readme-nav__link i {
  color: #4dc8f0 !important;
  text-shadow: 0 0 12px rgba(0, 174, 228, 0.5);
}

/* Main Content */
.readme-content {
  flex: 1;
  margin-left: 280px;
  padding: 16px 20px 20px 20px;
  max-width: calc(100% - 280px);
}

.readme-content__inner {
  max-width: 100%;
  margin: 0;
}

/* Section Cards */
.section-card {
  background: rgba(20, 25, 35, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 174, 228, 0.12);
  border-radius: 8px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.section-card:hover {
  border-color: rgba(0, 174, 228, 0.25);
  box-shadow: 0 2px 12px rgba(0, 174, 228, 0.08);
}

.section-card__header {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 174, 228, 0.03);
  transition: background 0.2s ease;
}

.section-card__header:hover {
  background: rgba(0, 174, 228, 0.08);
}

.section-card__title {
  font-family: "NEXT ART Bold", sans-serif;
  font-size: 14px;
  margin: 0;
  color: #fff;
}

.section-card__title i {
  color: #00aee4;
  font-style: normal;
  margin-right: 8px;
}

.section-card__toggle {
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00aee4;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.section-card.active .section-card__toggle {
  transform: rotate(180deg);
}

.section-card__content {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

.section-card.active .section-card__content {
  padding: 12px 16px;
  max-height: 10000px;
}

/* ===========================================
   TYPOGRAPHY - Content Area
   =========================================== */

/* Main section title (h3) */
.readme-layout h3 {
  font-family: "NEXT ART Bold", sans-serif;
  color: #00aee4;
  font-size: 20px;
  margin: 32px 0 16px;
  padding: 0 0 12px 0;
  border-bottom: 1px solid rgba(0, 174, 228, 0.2);
  letter-spacing: 0.5px;
}

.readme-layout h3:first-child {
  margin-top: 0;
}

/* Subsection title (h4) - numbered sections like "7.1 Быстрая настройка" */
.readme-layout h4 {
  font-family: "NEXT ART Bold", sans-serif;
  color: #ffffff;
  font-size: 17px;
  margin: 28px 0 14px;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(0, 174, 228, 0.12) 0%, rgba(0, 174, 228, 0.02) 100%);
  border-left: 3px solid #00aee4;
  border-radius: 0 8px 8px 0;
  letter-spacing: 0.3px;
}

.readme-layout h4:first-child {
  margin-top: 0;
}

/* Hide duplicate numbered h4 inside item-text (except #sys which has 4 sections) */
div.items div.item:not(#sys) div.item-text > h4:first-child {
  display: none;
}

/* Card header number styling */
div.items div.item div.item-header .num {
  color: #00aee4;
  font-weight: 700;
  margin-right: 8px;
  text-shadow: 0 0 15px rgba(0, 174, 228, 0.3);
}

/* Minor subsection (h5) */
.readme-layout h5 {
  font-family: "NEXT ART Bold", sans-serif;
  color: #5cc8ed;
  font-size: 15px;
  margin: 20px 0 10px;
  padding-left: 12px;
  border-left: 2px solid rgba(0, 174, 228, 0.4);
}

/* Paragraphs */
.readme-layout p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 15px;
  line-height: 1.7;
  max-width: 900px;
}

/* General text in item-text */
div.items div.item div.item-text {
  font-size: 15px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.88);
}

/* ===========================================
   LINKS & HIGHLIGHTS
   =========================================== */

/* Links */
.readme-content a {
  color: #00aee4;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
}

.readme-content a:hover {
  color: #5cc8ed;
  border-bottom-color: rgba(92, 200, 237, 0.4);
}

/* Color classes */
.readme-layout .green { color: #22c55e !important; }
.readme-layout .red { color: #ef4444 !important; }
.readme-layout .yellow { color: #f59e0b !important; }
.readme-layout .grey { color: #9ca3af !important; }

/* Highlighted keywords (i tag) - more subtle */
.readme-content i {
  color: #5cc8ed;
  font-style: normal;
  font-weight: 500;
}

/* Special note/warning styling for yellow class */
.readme-content i.yellow {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.15);
  border-radius: 4px;
  margin-right: 4px;
}

/* Grey text for notes */
.readme-content .grey {
  font-size: 14px;
  line-height: 1.6;
}

/* ===========================================
   IMAGES & SCREENSHOTS
   =========================================== */

.readme-layout img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
}

div.items div.item div.item-text img {
  border: 1px solid rgba(0, 174, 228, 0.2);
  max-width: 100%;
  width: auto;
  height: auto;
  display: block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  margin: 16px 0;
}

/* Screenshot container */
.screen {
  margin: 20px 0;
  padding: 0;
}

.screen img {
  border-radius: 10px;
}

.screen-center {
  text-align: center;
  margin: 24px 0;
}

.screen-center img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

/* Inline blocks (text + image side by side) */
.inline-blocks {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin: 16px 0;
  flex-wrap: wrap;
}

.inline-blocks > div:first-child {
  flex: 1;
  min-width: 300px;
}

.inline-blocks > div:last-child {
  flex-shrink: 0;
}

.inline-blocks img {
  max-width: 100%;
  height: auto;
}

/* Hide dotted decorations */
.dotted {
  display: none;
}

/* Table of Contents - Hidden as it's in sidebar now */
.toc-card {
  display: none;
}

/* ===========================================
   LISTS
   =========================================== */

.readme-layout ul, .readme-layout ol {
  margin: 12px 0 16px;
  padding-left: 24px;
}

.readme-layout li {
  margin-bottom: 8px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
}

.readme-layout li::marker {
  color: #00aee4;
}

/* ===========================================
   CODE & TECHNICAL
   =========================================== */

.readme-layout code {
  background: rgba(0, 174, 228, 0.12);
  padding: 3px 10px;
  border-radius: 5px;
  font-family: "SF Mono", Monaco, "Consolas", monospace;
  font-size: 14px;
  color: #5cc8ed;
  border: 1px solid rgba(0, 174, 228, 0.15);
}

/* ===========================================
   SPECIAL BLOCKS
   =========================================== */

/* Links section inside items (sub-navigation) - now visible and styled */
div.items div.item div.item-text div.links {
  display: block !important;
  background: rgba(0, 174, 228, 0.05);
  border: 1px solid rgba(0, 174, 228, 0.12);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 0 0 24px 0;
  columns: 2;
  column-gap: 24px;
}

div.items div.item div.item-text div.links > div {
  break-inside: avoid;
  margin-bottom: 6px;
}

div.items div.item div.item-text div.links a {
  color: rgba(180, 200, 220, 0.9) !important;
  font-size: 14px;
  display: inline-block;
  padding: 4px 0;
  transition: all 0.2s ease;
}

div.items div.item div.item-text div.links a:hover {
  color: #ffffff !important;
  transform: translateX(4px);
}

div.items div.item div.item-text div.links i {
  color: #00aee4 !important;
  font-weight: 600;
  margin-right: 6px;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
  .readme-sidebar {
    width: 240px;
  }
  
  .readme-content {
    margin-left: 240px;
    max-width: calc(100% - 240px);
    padding: 20px;
  }
}

@media (max-width: 768px) {
  .readme-sidebar {
    display: none;
  }
  
  .readme-content {
    margin-left: 0;
    max-width: 100%;
    padding: 16px;
  }
  
  div.items div.item div.item-header {
    font-size: 13px;
    padding: 14px 16px;
  }
}

@media (max-width: 600px) {
  .section-card__header,
  div.items div.item div.item-header {
    padding: 12px 14px;
    font-size: 12px;
  }
  
  .section-card__content,
  div.items div.item div.item-text {
    padding: 0 14px;
  }
  
  .section-card.active .section-card__content,
  div.items div.item.opened div.item-text {
    padding: 14px;
  }
  
  .readme-layout h3 {
    font-size: 15px;
  }
  
  .readme-layout h4 {
    font-size: 13px;
  }
}

/* Hide old return button */
body > a[style*="position:fixed"] {
  display: none !important;
}

/* ===========================================
   ACCORDION CARDS (Content sections)
   =========================================== */

div.items {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

div.items > div.item:first-child {
  margin-top: 0;
}

div.items div.item {
  background: linear-gradient(135deg, rgba(12, 18, 28, 0.85) 0%, rgba(18, 25, 38, 0.8) 100%);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 174, 228, 0.12);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s ease;
}

div.items div.item:hover {
  border-color: rgba(0, 174, 228, 0.3);
  box-shadow: 0 6px 30px rgba(0, 174, 228, 0.08);
}

/* Card Header */
div.items div.item div.item-header {
  font-family: "NEXT ART Bold", sans-serif;
  padding: 18px 24px;
  text-align: left;
  font-size: 15px;
  cursor: pointer;
  background: linear-gradient(90deg, rgba(0, 174, 228, 0.06) 0%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  transition: all 0.25s ease;
  gap: 0;
  line-height: 1.5;
  color: #fff;
  letter-spacing: 0.3px;
}

div.items div.item div.item-header i {
  display: inline;
  margin: 0 12px;
  color: rgba(0, 174, 228, 0.35);
  font-size: 6px;
}

div.items div.item div.item-header:hover {
  background: linear-gradient(90deg, rgba(0, 174, 228, 0.12) 0%, rgba(0, 174, 228, 0.02) 100%);
}

/* Card Content */
div.items div.item div.item-text {
  padding: 0 28px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
}

div.items div.item.opened div.item-text {
  padding: 28px;
  max-height: 100000px;
  border-top: 1px solid rgba(0, 174, 228, 0.1);
  background: rgba(0, 0, 0, 0.15);
}

div.items div.item div.item-header img {
  display: none;
}

/* Toggle arrow */
div.items div.item div.item-header .section-card__toggle {
  color: #00aee4;
  font-size: 14px;
  transition: all 0.3s ease;
  flex-shrink: 0;
  margin-left: auto;
  opacity: 0.6;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 174, 228, 0.08);
  border-radius: 6px;
}

div.items div.item:hover div.item-header .section-card__toggle {
  opacity: 1;
  background: rgba(0, 174, 228, 0.12);
}

div.items div.item.opened div.item-header .section-card__toggle {
  transform: rotate(180deg);
}

/* Hide TOC section in main content */
div.items div.item#main {
  display: none;
}

/* Links in TOC - Hidden as it's in sidebar now */
div.links {
  display: none;
}

/* Reduce br spacing */
.readme-layout br {
  display: block;
  content: "";
  margin: 4px 0;
}

/* Paragraph spacing - only double br creates space */
div.items div.item div.item-text br {
  display: block;
  content: "";
  margin-bottom: 0;
}

div.items div.item div.item-text br + br {
  margin-bottom: 12px;
}
