/* ====================================
   Reset & Base Styles
==================================== */
* {
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  :root {
    /* Обновлённая цветовая схема */
    --primary: #00ff00;      /* Основной цвет (зелёный) */
    --secondary: #1f1f1f;    /* Тёмный фон/оттенок */
    --background: #1f1f1f;   /* Фон */
    --surface: #2c2c2c;      /* Поверхность (слегка светлее фона) */
    --text: #d64306;         /* Основной цвет текста (светлый) */
  }
  
  html {
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: clamp(10px, 1vw + 0.5em, 15px);
  }
  
  body {
    font-family: 'Roboto', Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background: #000 url('web/bodybackground.jpg') no-repeat center center fixed;
    background-size: cover;
    position: relative;
    z-index: 0;
    color: var(--text);
    display: flex;
    flex-direction: column;
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
  }
  
  /* ====================================
     Layout Containers
  ==================================== */
  .container {
    width: 90%;
    max-width: 1200px;
    margin: auto;
    padding: 20px;
    flex: 1;
  }
  
  /* ====================================
     Navigation
  ==================================== */
  nav {
    background: url('./web/header-bg.jpg');
    background-size: cover;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 1),
                inset 0 -5px 15px rgba(0, 0, 0, 0.7);
    border-bottom: black 1px solid;
  }
  
  .nav-title {
    font-size: 1.2em;
    color: var(--text);
    flex-grow: 1;
  }
  
  nav a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
  }
  
  /* Кнопка меню */
  #sidebar-toggle {
    background: url('web/icon.ico') no-repeat center center;
    background-size: contain;
    width: 40px;
    height: 40px;
    border: var(--text) 1px solid;
    border-radius: 42%;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  
  #sidebar-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--primary) 0 0 10px;
    border: var(--primary) 1px solid;
    border-radius: 15px;
  }
  
  #sidebar-toggle:active {
    transform: scale(0.96);
    box-shadow: var(--text) 0 0 15px;
    border: var(--text) 1px solid;
    border-radius: 15px;
  }
  
  /* ====================================
     Sidebar
  ==================================== */
  .sidebar-header {
    padding: 20px 15px 10px;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    color: var(--text);
    font-family: 'Roboto', sans-serif;
    background: url('web/header-bg.jpg') no-repeat 30% center;
    background-size: 300% 500%;
    background-color: var(--primary);
    background-blend-mode: multiply;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
  }
  
  #sidebar {
    position: sticky;
    margin-top: -768px;
    top: 60px;
    left: 0;
    width: 250px;
    height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: repeating-linear-gradient(
        45deg,
        #111 0px,
        #111 10px,
        #1b1b1b 10px,
        #1b1b1b 20px
      ),
      repeating-linear-gradient(
        45deg,
        #0f0f0f 0px,
        #0f0f0f 10px,
        #1a1a1a 10px,
        #1a1a1a 20px
      ),
      radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.05), transparent 50%),
      radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.03), transparent 50%);
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    z-index: 998;
    overflow: auto;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge */
  }
  
  #sidebar::-webkit-scrollbar {
    display: none;
  }
  
  #sidebar.active {
    transform: translateX(0);
    border-right: 2px solid var(--primary);
    box-shadow: 5px 0 20px rgba(0, 255, 0, 0.3);
  }
  
  .sidebar-content {
    flex: 1 1 auto;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: flex-start;
    min-height: 0;
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge */
  }


  .sidebar-content::-webkit-scrollbar {
    display: none;
  }
  
  .sidebar-btn {
    background: url('web/bodybackground.jpg') no-repeat 20% center;
    background-size: 500% 1000%;
    color: var(--text);
    font-size: 0.9em;
    padding: 10px 16px;
    width: 90%;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    margin: 10px auto;
    display: block;
    transition: all 0.15s ease;
  }
  
  .sidebar-btn:hover {
    background-color: var(--primary);
    background-blend-mode: multiply;
  }
  
  .sidebar-btn:active {
    box-shadow: inset 0 0 20px black, 0 0 10px var(--primary);
    transform: scale(0.96);
  }
  
  .sidebar-footer {
    flex-shrink: 0;
    padding: 40px;
    text-align: center;
    background: url('web/logo.png') no-repeat center center;
    background-size: 200%;
    border-radius: 10px;
    border-top: 1px solid var(--primary);
  }
  
  /* ====================================
     Status & Command Log
  ==================================== */
  .ws-status {
    margin: 20px 15px;
    padding: 10px;
    font-size: 0.8em;
    text-align: center;
    font-weight: bold;
    border-radius: 6px;
    width: auto;
    transition: background 0.3s, color 0.3s;
    background-color: rgba(255, 0, 0, 0.2);
    color: #ff5555;
  }
  
  .ws-status.connected {
    color: var(--primary);
    text-shadow: var(--primary);
  }
  
  .ws-status.disconnected {
    color: var(--text);
    text-shadow: var(--text);
  }
  
  .command-log {
    background-color: #000;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    padding: 10px;
    border: 1px solid #00ff00;
    border-radius: 6px;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    line-height: 1.4;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
    scrollbar-width: none;       /* Firefox */
    -ms-overflow-style: none;    /* IE/Edge */
  }
  
  .command-log::-webkit-scrollbar {
    display: none;
  }
  
  .command-log div {
    margin-bottom: 6px;
  }
  
  .command-log::after {
    content: "_";
    animation: blink 1s step-start infinite;
    margin-left: 5px;
  }
  
  /* ====================================
     Preloader & Spinner
  ==================================== */
  #preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
  }
  
  .spinner {
    border: 6px solid rgba(255, 255, 255, 0.1);
    border-top: 6px solid var(--primary);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
  }
  
  /* ====================================
     Accordion
  ==================================== */
  .accordion-section {
    margin-bottom: 15px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--surface);
    box-shadow: 0 0 10px var(--primary);
    transition: all 1s ease-in-out;
    animation: glow 10s infinite;
  }
  
  .accordion-header {
    padding: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease-out;
    background: url('web/bodybackground.jpg') no-repeat center center;
    background-size: cover;
  }
  
  .accordion-header:hover {
    background: linear-gradient(135deg, rgba(0, 255, 0, 0.3), transparent),
                url('web/bodybackground.jpg');
    background-color: var(--primary);
    background-blend-mode: multiply;
    background-position: center;
    background-size: cover;
  }
  
  .accordion-content {
    max-height: 0;
    opacity: 0;
    transform: scaleY(0);
    overflow: hidden;
    transition: max-height 0.5s ease-out, opacity 0.5s ease-out, transform 0.5s ease-out, padding 0.5s ease-out;
    position: relative;
    background: url('web/header-bg.jpg') no-repeat center center;
    background-size: cover;
  }
  
  .accordion-content::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: black;
    opacity: 0.5;
    z-index: -1;
  }
  
  .accordion-header.active + .accordion-content {
    max-height: 1000px;
    opacity: 1;
    transform: scaleY(1);
    padding: 20px;
  }
  
  /* ====================================
     Lists & Typography
  ==================================== */
  ul {
    list-style: none;
    padding: 20px;
  }
  
  li {
    margin: 10px 0 20px 0;
    padding: 20px;
    background: rgba(72, 22, 2, 0.5);
    border-left: 4px solid var(--primary);
    border-radius: 5px;
    transition: all 0.3s ease;
    position: relative;
    color: white;
  }
  
  li:hover {
    transform: translateX(10px);
    background: rgba(72, 22, 2, 0.7);
    box-shadow: 0 0 15px rgba(214, 66, 6, 0.2);
    text-shadow: rgba(0, 0, 0, 0.8);
  }
  
  h1 {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    color: var(--primary);
    text-align: center;
    font-size: 2em;
    border: black solid rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.5);
    text-shadow: 0 0 20px black transparent;
  }
  
  h2 {
    margin: 0;
  }
  
  p,
  span,
  li,
  body,
  h1,
  h2 {
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
  }
  
  code {
    color: var(--primary);
    font-size: 1.2em;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.5);
  }
  
  p {
    color: white;
    margin-right: 10%;
  }
  
  a {
    color: var(--primary);
    text-decoration: none;
    transition: color 1s ease;
  }
  
  a:hover {
    color: white;
    text-shadow: 1px 1px 5px var(--primary);
  }
  
  /* ====================================
     Video & Iframes
  ==================================== */
  .video-section {
    margin: 90px 0;
    text-align: center;
  }
  
  img {
    animation: glow 10s infinite;
    width: 100%;
    border: var(--secondary) solid 1px;
    border-radius: 10px;
  }
  
  iframe {
    animation: glow 10s infinite;
    width: 50%;
    max-width: 100%;
    border: var(--secondary) solid 1px;
    border-radius: 10px;
  }
  
  .small-video {
    margin-top: 15px;
    text-align: center;
  }
  
  .small-video iframe {
    width: 320px;
    height: 180px;
    border: none;
    border-radius: 5px;
  }
  
  /* ====================================
     Footer
  ==================================== */
  footer {
    background: url('web/header-bg.jpg') no-repeat center 65%;
    background-size: cover;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.7);
    border-top: black 2px solid;
    box-shadow: inset 0 10px 10px rgba(0, 0, 0, 1),
                 0 -5px 5px rgba(0, 0, 0, 0.7);
  }
  
  /* ====================================
     Responsive Media Queries
  ==================================== */
  @media (max-width: 768px) {
    body {
      background-attachment: scroll;
      transform: none;
      will-change: auto;
      padding: 0px;
      font-size: 14px;
    }

    .sidebar-header{
        border-radius: 8px;
        animation: glow 10s infinite;
    }
    .sidebar-btn{
        border: var(--primary) 0.5px solid;
    }

    
    .sidebar-footer,
    .command-log {
        width: calc(100% + 40px); /* 40px компенсирует 20px слева и 20px справа */
        margin-left: -20px;
        margin-right: -20px;
    }
  
    nav a {
      padding: 5px 10px;
      gap: 10px;
      box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
      white-space: nowrap;
    }
  
    iframe {
      width: 100%;
    }
  
    footer {
      align-items: center;
    }
  
    ul {
      padding: 10px;
    }
  
    li {
      padding: 10px;
    }
  
    .accordion-header {
      padding: 15px;
    }
  
    .accordion-content {
      padding: 0 10px;
    }
  
    .accordion-header.active + .accordion-content {
      padding: 10px;
    }
  
    .video-section {
      margin: 50px 0;
      text-align: center;
    }
  
    #sidebar {
      position: sticky;
      top: 40px;
      left: 0;
      height: 100vh;
      width: 250px;
      transform: translateX(-100%);
      transition: transform 0.3s ease-in-out;
      z-index: 998;
      overflow-y: auto;
      background-color: rgba(0, 0, 0, 0.9);
      padding: 20px;
      box-shadow: 2px 0 5px rgba(0, 0, 0, 0.5);
    }
  
    #sidebar.active {
      transform: translateX(0);
    }
  }
  .sidebar-content{
    flex: 1;

  }
  
  /* Дополнительный медиа-запрос для очень маленьких экранов */
  @media (max-width: 480px) {
    body {
      font-size: 12px;
    }
    
    nav {
      padding: 5px 10px;
    }
    
    .container {
      padding: 10px;
    }
    
    h1 {
      font-size: 1.8em;
    }
  }
  
  /* ====================================
     Gesture Area for Sidebar
  ==================================== */
  #gesture-area {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 30px;
    z-index: 997;
  }
  
  /* ====================================
     Keyframes & Animations
  ==================================== */
  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
  
  @keyframes blink {
    50% {
      opacity: 0;
    }
  }
  
  @keyframes glow {
    0% {
      box-shadow: 0 0 10px var(--primary);
    }
    25% {
      box-shadow: 0 0 20px black;
    }
    50% {
      box-shadow: 0 0 10px silver;
    }
    75% {
      box-shadow: 0 0 20px black;
    }
    100% {
      box-shadow: 0 0 10px var(--primary);
    }
  }
  
