/* ==========================================
   БАЗОВЫЕ НАСТРОЙКИ
========================================== */

/* box-sizing: border-box для всех элементов и псевдоэлементов
   Чтобы padding и border включались в ширину/высоту */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Сброс отступов и базовые настройки текста для body */
body {
  margin: 0;
  font-family: Arial, sans-serif, -apple-system, BlinkMacSystemFont,
               'Segoe UI', Roboto, 'Helvetica Neue';
  color: #000;
  line-height: 1.5;
  padding: 0 15px;
  display: flex;               /* Вертикальное расположение основных блоков */
  flex-direction: column;
  min-height: 100vh;          /* Чтобы body занимал всю высоту окна */
  background-color: #f3d1c4;  /* Цвет фона */
  background-repeat: no-repeat;
  background-size: cover;
}


/* ==========================================
   ЗАГОЛОВКИ
========================================== */
header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
h1, h2 { margin: 0; }
h1 {
  color: #f3ecec;
}
h2 {
  font-size: 20px;
}
h3 {
  color: #172c8a;
  margin-top: 0;
}

h4 {
  text-align: center;
  margin-top: 50px;
  color: #eae2e2;
  background-color: #33416E;
  padding: 20px;
}

/* ==========================================
   КОНТЕЙНЕРЫ СТРАНИЦЫ И КОЛОНКИ
========================================== */

/* Основной контейнер страницы — центрирование и ограничение ширины */
.main-container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 15px 40px;
  display: flex;
  flex-direction: column; /* Вертикальное расположение внутренних блоков */
  align-items: center;
  gap: 0;
}

/* Левый, средний и правый блоки — колонки с анимацией появления */
.left-block,
.middle-block,
.right-block {
  flex: 1; /* Растягиваются равномерно */
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #324479;
  border-radius: 50px;
  color: white;
  box-shadow: 0 4px 12px rgba(10, 90, 201, 0.6);
  overflow: visible;
  padding: 20px;
  opacity: 0; /* Скрыты изначально для анимации */
  animation: slideIn 1s forwards;
}

/* Анимация появления — сдвиг и плавное появление */
@keyframes slideIn {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Задаём начальное смещение и задержку для каждого блока */
.left-block {
  transform: translateX(-100px);
  animation-delay: 0.3s;
}

.middle-block {
  transform: translateX(100px);
  animation-delay: 0.5s;
}

.right-block {
  transform: translateX(100px);
  animation-delay: 0.7s;
}

/* ==========================================
   КНОПКИ С ЭМОДЗИ
========================================== */

/* Контейнер кнопок с абсолютным позиционированием "лесенкой" */
.buttons-container {
  position: relative;
  max-width: 420px;
  margin: 10px auto 0;
  height: 250px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-start;
  align-self: flex-start;
  margin-left: 100px; /* сдвиг контейнера вправо */
}

/* Стиль каждой кнопки загрузки */
.buttons-container button.loadBtn {
  position: absolute; /* Абсолютное позиционирование для "лесенки" */
  cursor: pointer;
  width: 200px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px; /* Расстояние между текстом и эмодзи */
  font-size: 15px;
  background-color: #3a5ba0;
  color: white;
  border: none;
  border-radius: 6px;
  user-select: none; /* Запрет выделения текста */
  transition: background-color 0.3s;
}

/* Изменение цвета при наведении */
.buttons-container button.loadBtn:hover {
  background-color: #2e4680;
}

/* Расположение кнопок "лесенкой" снизу вверх вправо */
.buttons-container button:nth-child(1) { bottom: 0; left: 0; }
.buttons-container button:nth-child(2) { bottom: 50px; left: 90px; }
.buttons-container button:nth-child(3) { bottom: 100px; left: 180px; }
.buttons-container button:nth-child(4) { bottom: 150px; left: 270px; }
.buttons-container button:nth-child(5) { bottom: 200px; left: 360px; }

/* Панель выбора эмодзи (всплывающая) */
.emoji-picker {
  position: absolute;
  bottom: 100%; /* Над кнопкой */
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 5px 8px;
  display: none; /* По умолчанию скрыта */
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 10;
}

/* Показывать панель при наведении на кнопку или панель */
.buttons-container button.loadBtn:hover .emoji-picker,
.emoji-picker:hover {
  display: block;
}

/* Отдельные смайлики внутри панели */
.emoji-picker span {
  cursor: pointer;
  font-size: 30px;
  margin: 0 4px;
  user-select: none;
  transition: transform 0.2s;
}

/* Увеличение смайлика при наведении */
.emoji-picker span:hover {
  transform: scale(1.3);
}

/* Отображение выбранного смайлика рядом с кнопкой */
.selected-emoji {
  position: absolute;
  top: -28px;
  left: 30%;
  transform: translateX(-50%);
  font-size: 22px;
  pointer-events: none; /* Чтобы не мешал кликам */
  display: none; /* Показывать при выборе */
}

/* ==========================================
   ОБЩИЕ КНОПКИ
========================================== */

/* Универсальный стиль для кнопок */
.btn {
  padding: 7px 10px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  background-color: #973F2B;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
}

.btn:hover {
  background-color: #B1532E;
  transform: scale(1.05);
}

/* ==========================================
   ПОЛЯ ВВОДА
========================================== */

.input-style {
  padding: 10px 15px;
  font-size: 16px;
  border-radius: 8px;
  border: 2px solid #5E1E1C;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
  margin-bottom: 10px;
}

.input-style:focus {
  border-color: #1a0652;
  box-shadow: 0 0 8px rgba(111, 76, 175, 0.5);
}

/* ==========================================
   ЭФФЕКТЫ НАВЕДЕНИЯ
========================================== */

.hover-effect {
  transition: transform 0.3s ease, filter 0.3s ease;
}

.hover-effect:hover {
  transform: scale(1.05);
  filter: brightness(80%);
}

/* ==========================================
   БЛОК С IFRAME (.block-cel)
========================================== */

/* Контейнер iframe, который должен быть под шапкой */
.block-cel {
  height: 270px;
  overflow: hidden;
  padding: 0;
  margin: 50px auto 0; /* Отступ сверху для отделения от шапки */
  border: none;
  color: #f7f1f1;
  max-width: 920px;
  width: 100%;
}

/* iframe внутри блока .block-cel */
.block-cel iframe {
  display: block;
  width: 100%;
  height: 270px;
  border: none;
  border-radius: 6px;
}

/* ==========================================
   ПРАВЫЙ БЛОК С IFRAME
========================================== */

.right-block {
  width: 920px;
  max-width: 100%;
  padding: 10px;
  margin: 20px auto 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  transform: translateX(100px);
  animation: slideIn 1s forwards;
  animation-delay: 0.7s;
  border-radius: 16px;
}

/* iframe в правом блоке */
.right-block iframe {
  width: 900px;
  max-width: 100%;
  height: 600px;
  border: none;
  border-radius: 16px;
  transition: opacity 0.5s ease;
  opacity: 1;
  display: block;
}

/* ==========================================
   КОНТЕЙНЕР ДЛЯ ССЫЛОК С ИЗОБРАЖЕНИЯМИ
========================================== */

.img-ssilki-container {
  display: flex;
  gap: 40px;
  align-items: center;
}

/* Кнопка с изображением */
.img-button {
  display: inline-block;
}

/* Обёртка для изображений */
.image-wrapper {
  max-width: 100%;
  padding: 50px;
}

/* Изображения с рамкой и адаптивным размером */
.image-wrapper img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 2px solid gray;
  border-radius: 15px;
}

/* Отступ сверху для изображений */
.image {
  margin-top: 20px;
}

/* ==========================================
   ТЕКСТОВЫЕ БЛОКИ
========================================== */

/* Общий стиль для блоков с результатами и примерами */
#result, #example {
  padding: 20px 15px;
  margin: 10px 0;
  font-weight: bold;
  color: #fff;
  background-color: #3f265e;
  max-width: 100%;
  word-wrap: break-word;
  border: 1px solid #ccc;
  border-radius: 10px;
  text-align: center;
}

/* Текстовые блоки с рамками и тенями */
.text-block {
  max-width: 900px;
  margin: 15px auto 40px;
  border: 7px solid #973F2B;
  box-shadow: 0 4px 12px rgba(72, 23, 22, 0.6);
  border-radius: 6px;
  padding: 30px 25px;
  background-color: #eddfdb;
  color: #000;
  box-sizing: border-box;
}

.text-block h3 {
  margin-top: 0;
  text-align: center;
  color: #973F2B;
}

/* Текст с изображениями в ряд */
.text-image-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap; /* Чтобы на узких экранах переносились */
  color: #000;
}

/* Направление текста и изображения */

.right-text {
  display: flex;
  flex-direction: row; /* Элементы в строку (у вас уже есть) */
  justify-content: center; /* Выравнивание по горизонтали */
  align-items: center; /* Выравнивание по вертикали */
}
.left-text {
  flex-direction: row-reverse;
}

/* Изображения в текстовых блоках */
.text-image-row img {
  max-width: 200px;
  height: auto;
  flex-shrink: 0;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  user-select: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0.3s ease;
}

/* Увеличение изображения при наведении */
.text-image-row img:hover {
  transform: scale(2.2);
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
  z-index: 10;
}

/* Абзацы внутри текстовых блоков */
.text-image-row p {
  margin: 0;
  flex: 1 1 300px; /* Позволяет тексту занимать доступное место */
  color: #000;
  font-size: 16px;
}

/* Абзацы в блоке истории */
.history-text p {
  margin-bottom: 15px;
}

/* ==========================================
   КНОПКА ЧАТ-БОТА С ИЗОБРАЖЕНИЕМ
========================================== */

/* Стиль изображения с рамкой и тенями */
.styled-image {
  border: 4px solid gray;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  border-radius: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0.3s ease;
}

/* Увеличение изображения при наведении */
.img-button:hover .styled-image {
  transform: scale(2);
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
  z-index: 10;
}

/* Текст поверх картинки */
.overlay-text {
  position: absolute;
  top: 80%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-weight: bold;
  font-size: 20px;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}

/* ==========================================
   ОБЩИЙ СТИЛЬ ДЛЯ IFRAME
========================================== */

iframe {
  z-index: 10000;
  height: 400px; /* базовая высота, переопределяется для конкретных блоков */
}
#myIframe {
  width: 850px; /* нужная ширина iframe */
  height: 550; /* нужная высота iframe */

  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain; /* изображение масштабируется, чтобы полностью поместиться */
  opacity: 1;
  border: none;
}


/* ==========================================
   ШАПКА И МЕНЮ
========================================== */

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-repeat: no-repeat;
  background-size: cover;
  height: 200px;
}

nav {
  background-color: #973F2B;
  border-radius: 10px;
  font-size: 12px;
  font-family: Arial, sans-serif;
  display: flex;
  justify-content: center;
  z-index: 1000;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
}

nav li {
  position: relative;
  cursor: pointer;
}

/* Стили для заблокированных пунктов меню */
nav li.locked > a {
  color: #ccc !important;
  cursor: default;
  user-select: none;
}

nav li.locked:hover > a {
  background-color: #508BC7;
}

nav a {
  display: block;
  color: #fff;
  padding: 14px 20px;
  text-decoration: none;
  user-select: none;
}

nav a:hover {
  background-color: #508BC7;
}

/* Выпадающее меню */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: #c47556;
  min-width: 160px;
  font-size: 12px;
  z-index: 10;
  flex-direction: column;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.dropdown a {
  padding: 12px 16px;
  color: #fff;
  user-select: none;
}
#passwordModa {
  z-index: 10000;
}
/* Запрет клика по ссылкам в заблокированном меню */
nav li.locked > .dropdown a {
  pointer-events: none;
  color: #999 !important;
}
/* ==========================================
   ССЫЛКИ
========================================== */
.fipi {
   background-color: #324479;
  color: white;
  box-shadow: 0 4px 12px rgba(10, 90, 201, 0.6); 
  margin: 30px;
  padding: 10px;
  text-align: center;
  border-radius: 16px;
  gap: 40;
}
.img-button {
  position: relative; /* Для позиционирования дочернего элемента */
  display: inline-block; /* Чтобы элемент корректно обрабатывался */
}

.img-button {
  position: relative; /* Устанавливаем относительное позиционирование */
  display: inline-block; /* Чтобы элемент корректно обрабатывался */
  z-index: 1; /* Начальный z-index */
}

.img-button:hover {
  z-index: 10; /* Увеличиваем z-index при наведении */
}

.tooltip {
  visibility: hidden; /* Скрываем текст по умолчанию */
  width: 120px; /* Ширина подсказки */
  background-color: #324479;/* Цвет фона */
  color: #fff; /* Цвет текста */
  text-align: center; /* Центрируем текст */
  border-radius: 5px; /* Скругленные углы */
  padding: 5px; /* Внутренний отступ */
  position: absolute; /* Абсолютное позиционирование */
  z-index: 1; /* Z-index для tooltip */
  bottom: 125%; /* Позиция над изображением */
  left: 50%; /* Центрируем по горизонтали */
  transform: translateX(-50%); /* Выравнивание по центру */
  opacity: 0; /* Скрываем текст */
  transition: opacity 0.3s; /* Плавный переход */
}

.img-button:hover .tooltip {
  visibility: visible; /* Показываем текст при наведении */
  opacity: 1; /* Делаем текст видимым */
}


/* ==========================================
   ФУТЕР
========================================== */

#footer-container {
  width: 100%;
  background-color: #1C2956;
  text-align: center;
  padding: 20px 0;
  color: #f9f4f4;
  box-sizing: border-box;
}

#footer-container h3 {
  margin-top: 0;
  color: #f9f4f4;
}

#footer-container p {
  color: #fff;
  margin: 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
  box-sizing: border-box;
}

/* ==========================================
   АДАПТИВ (МЕДИАЗАПРОСЫ)
========================================== */

@media (max-width: 940px) {
  /* iframe в правом блоке становится адаптивным */
  .right-block iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 900 / 540;
  }
  /* Кнопки перестают быть абсолютными */
  .buttons-container {
    height: auto;
    position: static;
    max-width: 100%;
    margin-left: 0;
  }
  .buttons-container button.loadBtn {
    position: static;
    padding: 8px 12px;
  }
}

@media (max-width: 500px) {
  /* Для карусели */
  .carousel-3d figure img {
    width: 180px;
  }
  .carousel-3d {
    height: 220px;
  }
}
  
/* Модальное окно */
#passwordModal {
    display: none; /* Скрыто по умолчанию */
    position: fixed; /* Фиксированное позиционирование */
    top: 0; left: 0; right: 0; bottom: 0; /* Занимает весь экран */
    background: rgba(0,0,0,0.5); /* Полупрозрачный темный фон */
    justify-content: center; /* Центрируем по горизонтали */
    align-items: center; /* Центрируем по вертикали */
    z-index: 1000000; /* Поверх остальных элементов */
}

/* Активное состояние модального окна */
#passwordModal.active {
    display: flex; /* Отображаем как flex-контейнер */
}

/* Содержимое модального окна */
#passwordModal .modal-content {
    background: white; /* Белый фон */
    padding: 20px 30px; /* Внутренние отступы */
    border-radius: 10px; /* Скругление углов */
    max-width: 320px; /* Максимальная ширина */
    width: 90%; /* Адаптивная ширина */
    text-align: center; /* Выравнивание текста */
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); /* Тень */
     z-index: 1000000; /* Поверх остальных элементов */
}

/* Поле ввода в модальном окне */
#passwordModal input {
    width: 100%; /* Ширина на всю доступную */
    padding: 10px; /* Внутренние отступы */
    font-size: 16px; /* Размер шрифта */
    border-radius: 8px; /* Скругление углов */
    border: 2px solid #5E1E1C; /* Рамка */
    margin-bottom: 10px; /* Отступ снизу */
    outline: none; /* Убираем стандартную обводку */
    transition: border-color 0.3s; /* Плавное изменение цвета рамки */
}

/* Фокус на поле ввода */
#passwordModal input:focus {
    border-color: #1a0652; /* Цвет рамки при фокусе */
    box-shadow: 0 0 8px rgba(111, 76, 175, 0.5); /* Тень */
}

/* Кнопка в модальном окне */
#passwordModal button {
    background-color: #973F2B; /* Цвет фона */
    border: none; /* Без рамки */
    color: white; /* Цвет текста */
    padding: 10px 20px; /* Внутренние отступы */
    font-size: 16px; /* Размер шрифта */
    border-radius: 8px; /* Скругление углов */
    cursor: pointer; /* Курсор-указатель */
    transition: background-color 0.3s; /* Плавный переход цвета */
}

/* Наведение на кнопку */
#passwordModal button:hover {
    background-color: #B1532E; /* Темнее фон */
}

/* Сообщение об ошибке */
#passwordError {
    color: red; /* Красный цвет */
    margin-top: 10px; /* Отступ сверху */
    display: none; /* Скрыто по умолчанию */
}

/* Заголовок модального окна */
.modalTitle {
    color: #000; /* Черный цвет */
}

#passwordModal {
  
  z-index: 99999;
}
