/* Windows 95 Explorer Treeview */
.win95-tree {
  font-family: "MS Sans Serif", Tahoma, Arial, sans-serif;
  font-size: 11px;
  color: #000000;
  user-select: none;
  line-height: 16px;
  background: #ffffff;
  padding: 4px;
}

.win95-tree ul {
  list-style: none;
  margin: 0;
  padding: 0 0 0 16px;
  position: relative;
}

.win95-tree > ul {
  padding-left: 0;
}

.win95-tree li {
  position: relative;
  margin: 0;
  padding: 1px 0 1px 18px;
}

/* Пунктирные соединительные линии */
.win95-tree li::before {
  content: '';
  position: absolute;
  top: 9px;
  left: 0;
  width: 16px;
  height: 0;
  border-top: 1px dotted #808080;
}

.win95-tree li::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-left: 1px dotted #808080;
}

.win95-tree li:last-child::after {
  height: 9px;
}

.win95-tree > ul > li::after {
  top: 9px;
}

.win95-tree > ul > li:first-child::after {
  top: 9px;
}

/* Элемент строки дерева */
.win95-tree-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 1px 3px;
  text-decoration: none;
  color: #000000;
}

.win95-tree-item:hover {
  text-decoration: none;
}

.win95-tree-item.active {
  background-color: #000080;
  color: #ffffff;
  outline: 1px dotted #ffffff;
}

/* Кнопка переключения [+] и [-] */
.win95-tree-toggle {
  position: absolute;
  left: -5px;
  top: 5px;
  width: 9px;
  height: 9px;
  background: #ffffff;
  border: 1px solid #808080;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-size: 9px;
  line-height: 7px;
  cursor: pointer;
  z-index: 2;
  box-sizing: border-box;
}

.win95-tree-toggle::before {
  content: '+';
  color: #000;
  font-weight: bold;
}

.win95-tree li.open > .win95-tree-toggle::before {
  content: '−';
}

.win95-tree li > ul {
  display: none;
}

.win95-tree li.open > ul {
  display: block;
}

/* Иконки в стиле Win95 */
.win95-icon {
  width: 16px;
  height: 16px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  flex: none;
}

/* Папка закрытая */
.win95-icon-folder {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M1 2h5l2 2h7v10H1z'/%3E%3Cpath fill='%23fff' d='M2 3h3.5l2 2H14v8H2z'/%3E%3Cpath fill='%23fc0' d='M2 5h12v7H2z'/%3E%3Cpath fill='%23ffe880' d='M3 6h10v5H3z'/%3E%3C/svg%3E");
}

/* Папка открытая */
.win95-tree li.open > .win95-tree-item > .win95-icon-folder,
.win95-icon-folder-open {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M1 2h5l2 2h7v3H6L4 14H1z'/%3E%3Cpath fill='%23ffe880' d='M2 3h3.5l2 2H14v2H6L4 13H2z'/%3E%3Cpath fill='%23000' d='M4 7h11l-3 7H1z'/%3E%3Cpath fill='%23fc0' d='M5 8h9l-2.5 5H3z'/%3E%3C/svg%3E");
}

/* Диск C: / жесткий диск */
.win95-icon-drive {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M1 5h14v7H1z'/%3E%3Cpath fill='%23c0c0c0' d='M2 6h12v5H2z'/%3E%3Cpath fill='%23fff' d='M2 6h12v1H2zM2 6h1v5H2z'/%3E%3Cpath fill='%23808080' d='M13 7h1v4h-1zM2 10h12v1H2z'/%3E%3Crect x='10' y='8' width='2' height='1' fill='%2300f000'/%3E%3Crect x='3' y='8' width='5' height='1' fill='%23000'/%3E%3C/svg%3E");
}

/* CD-ROM */
.win95-icon-cd {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='%23808080' stroke='%23000'/%3E%3Ccircle cx='8' cy='8' r='5' fill='%23e0e0e0'/%3E%3Cpath d='M8 1a7 7 0 0 1 7 7h-2a5 5 0 0 0-5-5z' fill='%230ff' opacity='0.4'/%3E%3Cpath d='M8 15a7 7 0 0 1-7-7h2a5 5 0 0 0 5 5z' fill='%23f0f' opacity='0.4'/%3E%3Ccircle cx='8' cy='8' r='2' fill='%23fff' stroke='%23000'/%3E%3C/svg%3E");
}

/* Файл текстовый TXT / DOC */
.win95-icon-file {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M2 1h8l4 4v10H2z'/%3E%3Cpath fill='%23fff' d='M3 2h6v4h4v9H3z'/%3E%3Cpath fill='%23000' d='M4 7h6v1H4zM4 9h7v1H4zM4 11h5v1H4z'/%3E%3C/svg%3E");
}

/* Исполняемый файл EXE */
.win95-icon-exe {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Crect x='1' y='2' width='14' height='12' fill='%23000080' stroke='%23000'/%3E%3Crect x='2' y='3' width='12' height='2' fill='%23fff'/%3E%3Crect x='2' y='6' width='12' height='7' fill='%23c0c0c0'/%3E%3Cpath fill='%23000' d='M4 8l2 3h1l2-3h-1l-1.5 2.2L5 8zm5 0v3h3v-1h-2v-2z'/%3E%3C/svg%3E");
}

/* Панель управления / Настройки */
.win95-icon-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M1 2h5l2 2h7v10H1z'/%3E%3Cpath fill='%23fc0' d='M2 5h12v7H2z'/%3E%3Cpath fill='%23000' d='M8 7l2 4h-4z' fill='%23000080'/%3E%3C/svg%3E");
}
