  @import url('https://fonts.googleapis.com/css2?family=Fira+Code&display=swap');

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Fira Code', monospace, Consolas, monospace;
    background: #121212;
    color: #ccc;
    overflow: hidden;
  }
footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: #111;
  color: #ccc;
  padding: 5px 10px;
  font-size: 0.85rem;
  text-align: center;
  z-index: 99;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow-x: auto;
}

footer code.copyable {
  background: #222;
  padding: 2px 4px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}

/* Адаптація під мобільні */
@media (max-width: 480px) {
  footer {
    flex-wrap: wrap;
    font-size: 0.75rem;
    padding: 8px 10px;
  }
  footer span, footer code.copyable {
    white-space: normal;
    flex-basis: 100%;
    text-align: center;
  }
  #copyMsg {
    margin-left: 0;
    width: 100%;
  }
}



  body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
      0deg,
      rgba(100, 255, 100, 0.03),
      rgba(100, 255, 100, 0.03) 1px,
      transparent 1px,
      transparent 3px
    );
    pointer-events: none;
    z-index: 0;
  }

  body::after {
    content: attr(data-code);
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    color: rgba(100, 255, 100, 0.05);
    font-size: 14px;
    line-height: 1.2;
    white-space: pre-wrap;
    overflow: hidden;
    pointer-events: none;
    animation: scrollCode 120s linear infinite;
    user-select: none;
    z-index: 0;
  }

  @keyframes scrollCode {
    0% { transform: translateY(100%); }
    100% { transform: translateY(-100%); }
  }

  #app {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
  }

  #sidebar {
    width: 520px;
    max-width: 820px;
    background: #1c1c1c;
    overflow-y: auto;
    padding: 10px;
    box-sizing: border-box;
    border-right: 1px solid #333;
    z-index: 1;
    flex-shrink: 0;
    transition: all 0.3s ease;
  }

  #sidebar.hidden {
    width: 0;
    padding: 0;
    overflow: hidden;
    border-right: none;
  }

  #content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
    height: 100%;
    transition: all 0.3s ease;
  }

  #toggleSidebarBtn {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #333;
    border: none;
    color: #7fff7f;
    padding: 5px 10px;
    cursor: pointer;
    z-index: 10;
  }

  h2 {
    margin-top: 0;
    font-weight: 600;
    font-size: 1.3rem;
    color: #7fff7f;
  }

  ul {
    list-style: none;
    padding-left: 0;
    font-size: 0.9rem;
  }

  li {
    padding: 5px 8px;
    cursor: pointer;
    border-radius: 4px;
    color: #ccc;
    transition: background-color 0.2s ease;
  }

  li:hover {
    background: #2a2f2a;
  }

  li.active {
    background: #4caf50;
    font-weight: 700;
    color: #0d0;
  }

  li.folder > span {
    font-weight: 600;
    user-select: none;
    color: #90ee90;
  }

  li.folder.collapsed > ul {
    display: none;
  }

  li.video {
    padding-left: 16px;
  }

  ul.root-level > li.folder:not(:last-child) {
    border-bottom: 1px solid #228822;
    margin-bottom: 8px;
    padding-bottom: 8px;
    box-shadow: 0 1px 0 0 #44cc44 inset, 0 2px 0 0 #228822;
  }

  ul.sub-level > li.folder:not(:last-child) {
    border-bottom: 1px dotted #55aa55;
    margin-bottom: 6px;
    padding-bottom: 6px;
    box-shadow: inset 0 -1px 5px 0 #336633aa;
  }

  #videoContainer {
    margin-top: 20px;
    width: 100%;
    height: 100%;
    align-self: stretch;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
  }

  #videoContainer.active video {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    max-width: 100vw;
    object-fit: contain;
  }

  video {
    width: 100%;
    height: 100%;
    max-height: calc(100vh - 120px);
    border-radius: 10px;
    box-shadow: 0 0 12px #1aff1a88;
    background: #000;
  }

  @media (max-width: 768px) {
    #app {
      flex-direction: column;
    }

    #sidebar {
      width: 100%;
      max-height: 50vh;
      border-right: none;
      border-bottom: 1px solid #333;
    }

    #content {
      padding: 10px;
      width: 100%;
    }

    video {
      max-height: 40vh;
    }
  }
