/* ============================================= */
/* == Базовая сцена и фон ====================== */
/* ============================================= */
:root {
  --win98-gray: #c0c0c0;
  --win98-dark: #000080;
  --win98-silver: silver;
}

html, body {
  height: 100%;
}

body {
  background-color: #008080;
  font-family: "MS Sans Serif", "Arial", sans-serif;
  margin: 0;
  padding: 0;
}

.desktop {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#desktop-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================= */
/* == Верхнее меню (ПК) ======================== */
/* ============================================= */
.top-menu-bar {
  background: var(--win98-silver);
  padding: 2px;
  border-bottom: 2px solid #555;
  display: flex;
  flex-shrink: 0;
}

.top-menu-bar > ul {
  list-style: none;
  margin: 0;
  padding: 0 6px;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 2px;
}

.top-menu-bar > ul > li {
  padding: 2px 8px;
  position: relative;
}

.top-menu-bar > ul > li:hover {
  background: var(--win98-dark);
  color: #fff;
}

.top-menu-bar a {
  text-decoration: none;
  color: inherit;
}

.top-menu-bar u { text-decoration: underline; }

.top-menu-bar ul ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--win98-silver);
  border: 1px outset #fff;
  box-shadow: 1px 1px 2px rgba(0,0,0,.5);
  min-width: 160px;
  z-index: 100;
}

.top-menu-bar ul li:hover > ul { display: block; }

.top-menu-bar ul ul li { padding: 4px 10px; }
.top-menu-bar ul ul li:hover { background: var(--win98-dark); color: #fff; }

.top-menu-bar .separator {
  height: 1px;
  background: grey;
  border-bottom: 1px solid #fff;
  margin: 4px 2px;
}

/* ===== Переключатель языка справа (ПК) ===== */
.top-menu-bar .language-switcher-item {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
}

.top-menu-bar .language-switcher-item .lang-switcher-opener {
  background: var(--win98-gray);
  color: #000;
  border: 2px outset #fff;
  padding: 2px 10px;
  font-family: "MS Sans Serif", sans-serif;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.2;
}

.top-menu-bar .language-switcher-item .lang-switcher-opener:active {
  border: 2px inset #fff;
}

/* ============================================= */
/* == Панель задач (если используется) ========= */
/* ============================================= */
.taskbar {
  background: var(--win98-silver);
  padding: 3px;
  border-top: 2px solid #fff;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1000;
}
.taskbar .start-button img { height: 16px; vertical-align: middle; margin-right: 4px; }
.taskbar-tray { margin-left: auto; border: 1px inset; padding: 2px 8px; display: flex; gap: 8px; align-items: center; }

/* ============================================= */
/* == Мобильная шапка/меню ===================== */
/* ============================================= */
.mobile-header {
  display: none;                 /* скрыто на ПК */
  background: var(--win98-silver);
  padding: 5px 10px;
  border-bottom: 2px outset #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
}

.mobile-header-brand { font-weight: bold; display: flex; align-items: center; gap: 6px; }
.mobile-header-brand img { height: 20px; }

#hamburger-btn { font-size: 20px; line-height: 1; }

.mobile-nav {
  display: none;
  position: fixed;
  top: 36px; left: 0; right: 0;
  background: var(--win98-silver);
  border-bottom: 2px outset #fff;
  z-index: 99;
}
.mobile-nav.is-open { display: block; }
.mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.mobile-nav ul li a {
  display: block;
  padding: 12px;
  color: #000;
  text-decoration: none;
  border-bottom: 1px solid grey;
}
.mobile-nav ul li a:hover { background: var(--win98-dark); color: #fff; }

/* ============================================= */
/* == Общие элементы =========================== */
/* ============================================= */
#lang-switcher-btn { text-transform: uppercase; }
#lang-modal {
  display: none;
  position: fixed;
  z-index: 1001;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

/* Окно по центру */
.window.window-center {
  margin: 24px auto;
  width: 640px;
  max-width: 95%;
}

/* Иконка в заголовке окна */
.title-bar-text img {
  width: 20px; height: 20px;
  image-rendering: pixelated;
  vertical-align: middle;
  margin-right: 8px;
}

/* Впадина (sunken panel) */
.sunken-panel {
  border: 2px inset #ffffff;
  background-color: #f0f0f0;
}

/* Win98-кнопка (объёмная) — опционально, когда не используем .button из 98.css */
.btn98{
  display:inline-block;
  padding:6px 14px;
  background: var(--win98-gray);
  color:#000;
  text-decoration:none;
  border:2px solid #000;
  font-weight:700;
  box-shadow:1px 1px 0 #fff inset,-1px -1px 0 #7f7f7f inset;
}
.btn98:hover{ filter:brightness(.95); }
.btn98:active{ box-shadow:-1px -1px 0 #fff inset,1px 1px 0 #7f7f7f inset; }
.btn98:focus{ outline:1px dotted #000; outline-offset:1px; }

/* ============================================= */
/* == Серверы (список/плитка) ================== */
/* ============================================= */
.servers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  padding: 10px;
}

.server-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border: 2px outset var(--win98-gray);
  background: var(--win98-gray);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 12px;
  border: 1px solid #000;
  border-radius: 4px;
  font-weight: bold;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
}
.status-badge.online  { background-color: #008000; }
.status-badge.offline { background-color: #800000; }

/* ============================================= */
/* == Клиенты (иконки) ========================= */
/* ============================================= */
.clients-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 10px;
  border: 2px inset #ffffff;
  background-color: #f0f0f0;
}

.client-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: #000;
  padding: 10px;
  border: 1px solid #c0c0c0;
  cursor: pointer;
}
.client-icon:hover  { background-color: #d6d6d6; border: 1px solid #808080; }
.client-icon:active { background-color: #f0f0f0; border: 1px inset #808080; }
.client-icon img    { width: 48px; height: 48px; margin-bottom: 5px; }
.client-icon span   { font-size: 14px; line-height: 1.2; }

/* ============================================= */
/* == Блок «герой» с иконками/листом =========== */
/* ============================================= */
.features-section {
  background: #001d7e;
  padding: 16px;
  color: #fff;
  border: 2px solid #000;
  box-shadow: 1px 1px 0 #fff inset, -1px -1px 0 #7f7f7f inset;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px 16px;
  align-items: start;
  text-align: center;
}

.feature-item { display: flex; flex-direction: column; align-items: center; }
.feature-item img { display: block; margin: 0 auto 6px; image-rendering: pixelated; height: 48px; width: 48px; }
.feature-item span { display: block; font-weight: 600; line-height: 1.25; }

.features-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 8px 16px;
  margin-top: 14px;
}
.checkmark { color: #00cc66; margin-right: 6px; }

/* ============================================= */
/* == FAQ окна ================================= */
/* ============================================= */
.faq-section { display: grid; gap: 15px; padding: 15px; }
.window-faq {
  background-color: #fff;
  color: #000;
  border: 2px solid #000;
  padding: 10px;
  box-shadow: 2px 2px #000, 3px 3px #808080;
  margin: 16px 0;
}
.window-faq .title-bar {
  background-color: var(--win98-dark);
  color: #fff;
  padding: 5px;
  font-size: 14px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #000;
}
.window-faq .window-body { padding: 10px; }
.window-faq p { margin: 0 0 10px 0; }

/* ============================================= */
/* == Адаптив ================================== */
/* ============================================= */
@media (max-width: 768px) {
  .top-menu-bar, .taskbar { display: none; }
  .mobile-header { display: flex; }
  #desktop-content {
    padding: 8px;
    padding-top: 50px;
    align-items: flex-start;
    justify-content: center;
  }
  .window {
    width: 100% !important;
    max-width: 480px;
    margin-top: 0;
    border: none;
    box-shadow: none;
    background: transparent;
  }
  .window-body { background: var(--win98-silver); }
  /* скрываем десктопную кнопку выбора языка */
  .top-menu-bar .language-switcher-item { display: none; }
}

@media (max-width: 720px) {
  .features-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .features-list { grid-template-columns: 1fr; }
}

@media (max-width: 380px) {
  .window.window-center {
    max-width: calc(100% - 16px);
    margin: 8px auto;
  }
  .features-grid { grid-template-columns: 1fr; }
}
