/* ===== VARIABLES ===== */
:root {
  /* Colors */
  --bg: #1b1e21;
  --panel: #2a2d2f;
  --panel-2: #232729;
  --text: #e4eaf1;
  --muted: #9aa3b0;
  --accent: #a67e7e;
  --accent-2: #acc0d8;
  --accent-3: #7dd3b0;
  --danger: #ff6b6b;
  --glass: rgb(98 98 98 / 16%);
  --surface-contrast: rgba(255, 255, 255, 0.035);
  --code-bg: #1b1e21;

  /* Typography */
  --mono: "Space Mono", "SFMono-Regular", "Consolas", "Courier New", monospace;
  --monoCode: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
  --base-font-size: 15px;

  /* Effects */
  --radius: 8px;
  --shadow-1: 0 6px 18px rgb(23 2 2 / 60%);
  --hover-alpha: 0.02;
}

/* ===== RESET & BASE STYLES ===== */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--base-font-size);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

/* ===== LAYOUT ===== */
body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  margin: 0;
}

/* Header */
.header-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  background: var(--bg);
  z-index: 1000;
  /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); */
  display: flex;
  justify-content: center;
}

.header-container {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px;
}

/* Main Content */
.main-wrapper {
  flex: 1;
  margin-top: 80px;
  height: calc(100vh - 80px);
  display: flex;
  justify-content: center;
  overflow: hidden;
}

.main-container {
  display: flex;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 14px;
  height: 100%;
  gap: 14px;
  align-items: flex-start;
}

/* Sidebar */
.container_side {
  position: sticky;
  top: 0;
  width: 250px;
  height: calc(100vh - 100px);
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  overflow-x: hidden;
  /* background: linear-gradient(180deg, var(--panel), rgba(255, 255, 255, 0.01)); */
  background-color: rgba(65, 69, 81, 0.4);
  padding: 10px;
  box-shadow: 0 6px 20px rgba(2, 6, 23, 0.2);
  flex-shrink: 0;
  border-radius: 5px;
}

/* Content Area */
.container_content {
  flex: 1 1 0%;
  min-width: 300px;
  height: calc(100vh - 100px);
  max-height: calc(100vh - 100px); 
  overflow-y: auto;
  background: linear-gradient(180deg, var(--panel-2), rgba(255, 255, 255, 0.01));
  padding: 35px 35px 35px 20px;
  border-radius: 5px;
  box-sizing: border-box;
   overflow-y: overlay; /* Современное решение, если поддерживается */
}

/* ===== NAVIGATION & MENUS ===== */
.main_menu {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 8px;
  background: transparent;
}

.menu_item,
.side_menu_item {
  padding: 3px 10px;
  cursor: pointer;
  border-radius: 6px;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  transition: background 0.12s ease, color 0.12s ease, transform 0.06s;
  background: transparent;
}

.menu_item:hover,
.side_menu_item:hover {
  background: var(--glass);
  transform: translateX(2px);
}

.side_menu_item {
  /* padding-left: 16px; */
  /* color: var(--muted); */
  font-weight: 500;
}

/* Active States */
.header_nav_item__active,
.side_nav_item__active {
  color: var(--accent);
  background-color: rgba(65, 69, 81, 0.4);
  /* background: linear-gradient(90deg, rgba(65, 69, 81, 0.4), transparent); */
}

/* ===== TYPOGRAPHY & TEXT ELEMENTS ===== */
p {
  margin: 0;
  color: var(--muted);
}

h1, h2 {
  font-size: 1.15rem;
  margin: 0 0 8px 0;
  color: var(--text);
}

.no-wrap {
  white-space: nowrap;
}

/* Links */
a {
  color: var(--accent-2);
  text-decoration: none;
}

.menu_item a {
  pointer-events: auto;
}

/* ===== CONTENT COMPONENTS ===== */
/* List Items */
.main_item_name {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text);
  cursor: pointer;
}

.main_item_name:hover {
  background: var(--glass);
  transform: translateX(2px);
}

.main_item__active > .main_item_name:first-child {
  color: var(--accent);
  font-weight: 700;
}

/* Content Items */
.content_item {
  color: var(--text);
}

.descr {
  cursor: pointer;
  color: var(--muted);
}

.content_item_prop {
  display: block;
  color: var(--danger);
}

.content_item_prop_none {
  display: none;
}

/* Dividers */
.obj_descr::after {
  content: "";
  display: block;
  height: 1px;
  background: var(--surface-contrast);
  margin: 10px 0 18px;
}

.obj_info {
  margin-top: 10px;
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-family: Inter, Arial, sans-serif;
  background: transparent;
  border-radius: 6px;
  overflow: hidden;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--surface-contrast);
  color: var(--muted);
  font-size: 0.95rem;
}

th {
  color: var(--text);
  font-weight: 600;
  background: transparent;
}

/* ===== CODE & TEXT BLOCKS ===== */
/* Code Blocks */
.codeblock-wrapper {
  margin: 14px 0;
  background: var(--code-bg);
  border-radius: 8px;
  padding: 10px;
  overflow: hidden;
}
.codeblock-wrapper {
  margin: 14px 0;
  background: var(--code-bg);
  border-radius: 8px;
  padding: 10px;
  overflow: hidden;
}

pre.codeblock {
  margin: 0;
  padding: 12px;
  background: transparent;
  color: #dbeafe;
  font-family: "Space Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  overflow: auto;
  border-radius: 6px;
}

/* Inline Code */
.codeblock,
.syntaxblock,
.code,
.textblock_code,
code {
  display: block;
  color: #cbd5e1;
  background: transparent;
  font-family: var(--monoCode);
  font-size: 0.9rem;
  white-space: pre;
  overflow: auto;
  padding: 0;
  margin: 0;
  line-height: 1.5;
}

/* Text Blocks */
.textblock {
  color: var(--text);
  white-space: pre-wrap;
  font-family: var(--monoCode);
}

.textblock_title {
  font-size: 1.05rem;
  color: var(--text);
  font-weight: 700;
}

.textblock_sub {
  font-size: small;
  line-height: 1;
  color: var(--muted);
}

/* ===== BUTTONS & INTERACTIVE ELEMENTS ===== */
.clickBtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 6px;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font-size: 0.95rem;
  padding: 8px 12px;
  color: #5e6468;
  transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s;
}

.clickBtn:hover {
  /* transform: translateY(-2px); */
  background: var(--glass);
  /* box-shadow: var(--shadow-1); */
  color: var(--accent-2);
}

.clickBtn:active {
  transform: translateY(0);
}

/* Form Elements */
input {
  position: absolute;
  z-index: -1;
}

input:checked + label > .menu_item {
  background: rgba(87, 182, 255, 0.06);
  color: var(--accent);
}

/* ===== UTILITY CLASSES ===== */
.open {
  cursor: pointer;
}

.Argument,
.Summary {
  color: var(--accent-2);
  font-weight: 600;
}

.success {
  color: var(--accent-3);
}

/* ===== POPUP ===== */
.popup {
  position: absolute;
  min-width: fit-content;
  background: linear-gradient(180deg, #061018, #07121a);
  color: var(--accent-2);
  padding: 8px 10px;
  white-space: pre-wrap;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

/* ===== IMAGES ===== */
img {
  border-radius: 5px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  filter: brightness(0.95);
}

/* ===== SCROLLBARS ===== */
.container {
  /* overflow: auto; */
  margin-bottom: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.06) rgba(255, 255, 255, 0.02);
}

/* WebKit Scrollbars */
.container::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

.container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ===== ACCESSIBILITY ===== */
.menu_item:focus,
.clickBtn:focus,
.side_menu_item:focus {
  outline: 2px solid rgba(88, 166, 255, 0.18);
  outline-offset: 3px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
    padding: 15px 10px 0 10px;
    gap: 10px;
    height: 100%;
  }
  
  .container_side {
    position: sticky;
    top: 0;
    width: 100%;
    max-width: none;
    flex: none;
    height: auto;
    max-height: 200px;
    z-index: 999;
  }
  
  .container_content {
    flex: 1;
    min-width: 0;
    width: 100%;
    height: auto;
    padding: 35px 12px 12px 12px;
    max-height: calc(100vh - 320px);
  }
  
  .main-wrapper {
    margin-top: 70px;
    height: calc(100vh - 70px);
  }
}

@media (max-width: 600px) {
  .container_content {
    min-width: 0;
    padding: 35px 12px 12px 12px;
  }
  
  .header-container {
    padding: 10px 10px 0 10px;
  }
  
  .main-wrapper {
    margin-top: 65px;
    height: calc(100vh - 65px);
  }
}

.main_item__active{
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-1px); }
  to { opacity: 1; transform: translateY(0); }
}