:root {
  /* Основные цвета */
  --bg-primary:       #0a0a0a;        /* Основной фон */
  --bg-secondary:     #000000a1;      /* Полупрозрачный фон секций */
  --bg-code:          #1e1e1e;        /* Фон для code/pre */
  --bg-code-hover:    #2a2a2a;        /* Фон при наведении на код */
  --row-hover:        #1a1a1a;        /* Фон строки таблицы при hover */

  /* Текст */
  --text-primary:     #e0e0e0;        /* Основной текст */
  --text-secondary:   #a0a0a0;        /* Вторичный текст */
  --text-footer:      #777;           /* Текст в футере */
  --text-link:        #ccc;           /* Ссылки в футере */

  /* Акценты */
  --accent:           #ffe600;        /* Основной акцент (зелёный) */
  --accent-dark:      #ffd000;        /* Темнее акцента */
  --accent-error:     #ff4757;        /* Красный для ошибок/очистки */
  --accent-error-hover: #ff3742;

  /* Границы и элементы */
  --border:           #333333;        /* Цвет рамок */
  --border-light:     #444;           /* Более светлая граница */

  /* Тени */
  --shadow-sm:        rgba(0, 0, 0, 0.2);
  --shadow-md:        rgba(0, 0, 0, 0.3);
  --shadow-lg:        rgba(0, 0, 0, 0.4);
  --copyright:        rgba(255, 51, 0, 0.4);
  --header_h1:        rgba(206, 156, 19, 0.3);
  --shadow-text:      rgba(230, 226, 16, 0.555);

  /* Прозрачность */
  --alpha-30:         rgba(0, 0, 0, 0.3);
  --alpha-37:         rgba(0, 0, 0, 0.37);
  --alpha-50:         rgba(0, 0, 0, 0.5);
  --alpha-70:         rgba(0, 0, 0, 0.7);
  --alpha-90:         rgba(0, 0, 0, 0.9);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-image: url('path/background-image/i.webp');
  background-size: cover;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.container {
  max-width: 1200px;
  min-height: 75vh;
  margin: 0 auto;
  padding: 20px;
  flex: 1;
  width: 100%;
}

/* === Header === */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: var(--alpha-90);
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

header h1 {
  margin: 0;
  font-size: 1.8em;
  color: var(--accent);
  text-shadow: 0 0 10px var(--header_h1);
  flex: 1;
  text-align: right;
  white-space: nowrap;
}

header .nav-links {
  flex: 2;
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 0;
}

header .nav-links a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

header .nav-links a:hover {
  color: var(--accent-dark);
}

/* Заголовки */
b, h2, h3, h4, h5, h6 {
  color: var(--accent);
  text-shadow: 0 0 10px var(--shadow-text);
}

/* Секции */
section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
  transition: transform 0.3s ease;
}

section:hover {
  border-color: var(--accent);
}

/* Footer */
footer {
  width: 100%;
  background: var(--alpha-90);
  text-align: center;
  padding: 30px 0;
  color: var(--text-secondary);
  font-size: 0.9em;
  border-top: 1px solid var(--border);
  margin-top: 40px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  padding: 30px 20px;
  gap: 30px;
}

.footer-section {
  flex: 1;
  min-width: 200px;
}

.footer-section h4 {
  color: var(--accent);
  margin-bottom: 15px;
  font-size: 16px;
}

.footer-section a {
  display: block;
  color: var(--text-link);
  text-decoration: none;
  margin-bottom: 8px;
  font-size: 14px;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: var(--accent);
}

.footer-section p {
  color: var(--text-footer);
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.5;
}

/* Формы */
select,
input,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 1em;
  transition: border-color 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
}

textarea {
  height: 150px;
  font-family: "Courier New", monospace;
  resize: vertical;
}

/* Кнопки */
button {
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  padding: 12px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 1em;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px var(--shadow-sm);
}

button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--shadow-lg);
}

button:disabled {
  background: var(--border);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.clear-btn {
  background: var(--accent-error);
  box-shadow: 0 4px 15px var(--shadow-sm);
}

.clear-btn:hover {
  background: var(--accent-error-hover);
  box-shadow: 0 6px 20px var(--shadow-lg);
}

/* Карточки */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: center;
  margin-top: 20px;
}

.card {
  flex: 1 1 280px;
  min-width: 250px;
  max-width: 350px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  color: var(--text-primary);
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
  box-shadow: 0 4px 12px var(--shadow-md);
  cursor: pointer;
}

.card h3 {
  font-size: 1.4em;
  margin-bottom: 10px;
  color: var(--accent);
  transition: transform 0.2s ease;
}

.card p {
  font-size: 0.95em;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 20px rgba(0, 255, 136, 0.15);
}

/* Стили для кода */
.container code {
  position: relative;
  background-color: var(--bg-code);
  color: var(--accent);
  padding: 4px 8px;
  margin: 0 2px;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.95em;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.container pre {
  position: relative;
  background-color: var(--bg-code);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  margin: 15px 0;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: "Courier New", monospace;
  font-size: 0.95em;
  color: var(--accent);
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.container code:hover {
  background-color: var(--bg-code-hover);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.2);
}

.container pre:hover {
  border-color: var(--accent);
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.25);
}

/* Подсказка при копировании */
.copied-tip {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #000;
  font-size: 0.8em;
  padding: 4px 12px;
  border-radius: 4px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.2s;
  white-space: nowrap;
  pointer-events: none;
}

/* Списки */
.container ul {
  line-height: 1.8;
  margin-bottom: 16px;
}

.container ul ul {
  line-height: 1.6;
  margin-top: 8px;
}

.container li {
  margin-bottom: 6px;
}

.container h4 {
  margin-top: 20px;
  margin-bottom: 10px;
  color: var(--accent);
}

/* Навигация */
.nav-links a {
  color: var(--accent);
  text-decoration: none;
  margin: 0 15px;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent-dark);
}

/* Формы и группы */
.tagline {
  color: var(--text-secondary);
  font-size: 1.1em;
}

.form-group {
  margin-bottom: 25px;
}

/* Результат */
.result {
  margin-top: 25px;
  padding: 20px;
  background: rgba(0, 255, 136, 0.1);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-family: "Courier New", monospace;
  word-break: break-all;
}

.result strong {
  color: var(--accent);
}

/* Группа кнопок */
.encryption-type {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.encryption-type button {
  flex: 1;
  min-width: 120px;
}

.active {
  background: var(--accent-dark);
  box-shadow: 0 6px 20px var(--shadow-lg);
}

/* Авторские права */
.copyright {
  color: var(--accent);
  text-shadow: 0 0 5px var(--copyright);
}

/* Toast-уведомление */
.copied-toast {
  position: fixed;
  top: 20px;
  right: -300px;
  background-color: var(--accent);
  color: #000;
  font-family: "Courier New", monospace;
  font-weight: bold;
  padding: 12px 20px;
  border-radius: 6px;
  box-shadow: 0 4px 12px var(--shadow-md);
  transition: right 0.3s ease-in-out;
  z-index: 1000;
  pointer-events: none;
  white-space: pre;
}

/* Таблицы */
table {
  width: 100%;
  margin-top: 30px;
  border-collapse: collapse;
  font-size: 0.95em;
}

thead {
  background: var(--bg-code);
  color: var(--accent);
}

th, td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

tbody tr:hover {
  background: var(--row-hover);
  border-left: 3px solid var(--accent);
}

tbody td {
  color: var(--text-primary);
}

.result-note {
  margin-top: 20px;
  font-size: 0.9em;
  color: var(--text-secondary);
  text-align: center;
}

/* Поиск */
.search-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

#toggleSearch {
  background: var(--alpha-37);
  color: #000;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px var(--shadow-sm);
  width: 40px;
  height: 40px;
}

#toggleSearch:hover {
  background: var(--accent-dark);
  transform: scale(1.1);
}

/* Анимация поля поиска */
#searchInput {
  margin: 0;
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

#searchInput.visible {
  opacity: 1;
  height: 40px;
  padding: 10px 12px;
  visibility: visible;
  display: block;
}

/* Мобильная адаптация */
@media (max-width: 700px) {
  header {
    flex-direction: column;
    text-align: center;
    padding: 10px;
    align-items: center;
  }

  h1 {
    order: 1;
    margin-bottom: 10px;
  }

  .nav-links {
    order: 2;
    justify-content: center;
  }

  #toggleSearch {
    width: 40px;
    height: 40px;
    font-size: 18px;
    position: absolute;
    right: 10px;
    top: 10px;
  }

  .search-wrapper {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  #searchInput {
    margin-left: 0;
    width: 90%;
  }

  .footer-links {
    flex-direction: column;
    text-align: center;
  }

  .footer-section h4 {
    margin-top: 15px;
  }

  .footer-section a,
  .footer-section p {
    text-align: center;
  }
}