/* ==========================================================================
   ГЛОБАЛЬНЫЕ ТЕМЫ (Зеленая Матрица / Янтарный Fallout)
   ========================================================================== */
body, body[data-theme="green"] {
  --primary: #00ff66;
  --bg: #060a07;
  --panel: rgba(12, 22, 16, 0.9);
  --glow: rgba(0, 255, 102, 0.2);
  --text-muted: #00aa44;
}
body[data-theme="amber"] {
  --primary: #ffb000;
  --bg: #0d0800;
  --panel: rgba(26, 17, 0, 0.9);
  --glow: rgba(255, 176, 0, 0.2);
  --text-muted: #aa7500;
}

/* ==========================================================================
   БАЗОВЫЕ СТИЛИ СТРАНИЦЫ
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: var(--bg);
  color: var(--primary);
  font-family: 'Courier New', Courier, monospace;
  min-height: 100vh;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Ретро-эффект CRT монитора */
body::after {
  content: " ";
  display: block;
  position: fixed;
  top: 0; left: 0; bottom: 0; right: 0;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%), 
              linear-gradient(90deg, rgba(255, 0, 0, 0.04), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.04));
  z-index: 99999;
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
}

/* Бегущая линия сканирования радара */
.scanline {
  width: 100%; height: 5px;
  background-color: var(--primary);
  opacity: 0.06;
  position: fixed; top: 0; left: 0;
  animation: scan 8s linear infinite;
  pointer-events: none; z-index: 10000;
}
@keyframes scan { 0% { top: -5px; } 100% { top: 100%; } }

/* ==========================================================================
   СЕТКА И БЛОКИ ИНТЕРФЕЙСА
   ========================================================================== */
.wrapper {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  flex-grow: 1;
}
@media (min-width: 900px) {
  .wrapper { grid-template-columns: 1fr 1fr; }
}

/* Стилизация панелей (блоков) */
.panel {
  background: var(--panel);
  border: 1px solid var(--primary);
  box-shadow: 0 0 15px var(--glow);
  border-radius: 3px;
  padding: 20px;
  position: relative;
}

/* Заголовки блоков */
.panel-title {
  font-size: 16px;
  font-weight: bold;
  border-bottom: 1px solid var(--primary);
  padding-bottom: 8px;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  justify-content: space-between;
}

.panel-title span { opacity: 0.5; font-size: 12px; }

/* Переключатель интерфейсов */
.theme-toggle {
  display: flex; gap: 8px;
}
.theme-btn {
  width: 16px; height: 16px;
  border: 1px solid var(--primary);
  cursor: pointer; background: transparent;
}
.theme-btn[data-theme="green"] { background: #00ff66; }
.theme-btn[data-theme="amber"] { background: #ffb000; }

/* Списки и данные досье */
.dossier-row {
  display: flex; margin-bottom: 10px; font-size: 14px;
}
.dossier-label { width: 140px; color: var(--text-muted); text-transform: uppercase; }
.dossier-value { flex-grow: 1; }

/* ==========================================================================
   ИНТЕРАКТИВНЫЙ ТЕРМИНАЛ И КАРТОЧКИ
   ========================================================================== */
.terminal-output {
  height: 350px;
  overflow-y: auto;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 15px;
  padding-right: 5px;
}
.terminal-output::-webkit-scrollbar { width: 4px; }
.terminal-output::-webkit-scrollbar-thumb { background: var(--primary); }

.terminal-input-row {
  display: flex; align-items: center;
  border-top: 1px dashed rgba(var(--primary), 0.3);
  padding-top: 10px;
}
.terminal-prefix { margin-right: 8px; font-weight: bold; font-size: 14px; }
.terminal-input-row input {
  background: transparent; border: none; outline: none;
  color: var(--primary); font-family: inherit; font-size: 14px; flex-grow: 1;
}

/* Ретро-ссылки и карточки */
.btn-link {
  color: #fff; background: rgba(255,255,255,0.05);
  padding: 4px 8px; text-decoration: none;
  border: 1px solid var(--primary); display: inline-block;
  margin-top: 5px; font-size: 12px; font-weight: bold;
}
.btn-link:hover { background: var(--primary); color: var(--bg); }

.card-block {
  border: 1px dashed var(--primary);
  padding: 10px; margin: 10px 0; background: rgba(0,0,0,0.2);
}

/* Секция подвала (Футер) */
footer {
  max-width: 1200px;
  width: 100%;
  margin: 40px auto 10px auto;
  border-top: 1px dashed rgba(var(--primary), 0.4);
  padding-top: 15px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  opacity: 0.6;
  line-height: 1.6;
}

/* ==========================================================================
   ЭФФЕКТЫ МЕРЦАНИЯ И ПОМЕХ ДЛЯ ЛОГОТИПА BEAR-PC
   ========================================================================== */
.crt-logo {
  color: var(--primary);
  filter: drop-shadow(0 0 4px var(--primary));
  animation: logo-flicker 4s infinite, logo-glitch 8s infinite alternate;
}

/* Изменение яркости (подмигивание лампы) */
@keyframes logo-flicker {
  0%, 19.999%, 22%, 62.999%, 64%, 64.999%, 70%, 100% {
    opacity: 0.95;
    filter: drop-shadow(0 0 4px var(--primary));
  }
  20%, 21.999%, 63%, 63.999%, 65%, 69.999% {
    opacity: 0.4;
    filter: drop-shadow(0 0 1px var(--primary));
  }
}

/* Легкое смещение матрицы (эффект аналоговой помехи) */
@keyframes logo-glitch {
  0%, 93%, 98%, 100% {
    transform: skew(0deg) scale(1);
  }
  94% {
    transform: skew(4deg) scale(1.03);
    opacity: 0.8;
  }
  95% {
    transform: skew(-2deg) scale(0.97);
  }
  96%, 97% {
    transform: skew(0deg) scale(1);
  }
}
/* Добавьте эти строчки в ваш CSS файл туда, где настроены темы оформления */

/* Для зеленой темы (Matrix Mode) */
[data-theme="green"] {
  --sqi-sepia: 100%;
  --sqi-hue: 80deg;
  --sqi-sat: 500%;
}

/* Для оранжевой темы (Fallout Mode) */
[data-theme="amber"] {
  --sqi-sepia: 100%;
  --sqi-hue: 15deg;
  --sqi-sat: 600%;
}
/* Скрытый маркер бренда для ботов */
.core-marker {
    display: inline;
    visibility: hidden;
    font-size: 0;
    width: 0;
    height: 0;
    position: absolute;
    z-index: -1;
}
/* ЭФФЕКТ КРИТИЧЕСКОЙ СИГНАЛИЗАЦИИ ПРИ КОПИРОВАНИИ */
.terminal-alarm {
    animation: alarmFlash 0.5s ease-out;
}

@keyframes alarmFlash {
    0% {
        background-color: rgba(255, 0, 0, 0.4);
        filter: invert(0.2) sepia(1) hue-rotate(320deg) saturate(5);
    }
    100% {
        background-color: transparent;
        filter: none;
    }
}
