/* =========================================
   ОСНОВНЫЕ СТИЛИ BODY
========================================= */
body {
  font-family: "Segoe UI", Roboto, Arial, sans-serif; /* шрифт по умолчанию */
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  color: #333; /* цвет текста по умолчанию */
  background: #ececec; /* серый фон */
}
.pylon-time-input {
width: 114px;    top: 177px;
    position: absolute;
    margin: 4px auto 0;
    display: block;
    font-size: 12px;
    text-align: center;border: 1px solid #bbb;    
}

/* =========================================
   СОРТИРОВКА (DRAG & DROP)
========================================= */
.sortable {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 2 колонки */
  gap: 10px; /* расстояние между миниатюрами */
  max-height: 535px; /* высота контейнера, подставь свою */
  overflow-y: auto; /* вертикальный скролл при переполнении */
  padding: 5px;
  border: 1px solid #eee;
  background: #fafafa;
  border-radius: 8px;
  margin-top: 10px;
}

.sortable .item {
  border: 1px solid #ccc;
  border-radius: 5px;
  padding: 5px;
  cursor: grab;
  background: #fff;
  text-align: center; /* выравнивание содержимого */
}
.error-cell {
  background-color: rgba(255, 0, 0, 0.2); /* красная подсветка */
}

.dragging { opacity: 0.5; } /* прозрачность перетаскиваемого элемента */
.drag-over { border: 2px dashed #000; } /* выделение зоны перетаскивания */
/* === Общий контейнер === */
.settings {
  background: #ececec; /* светло-серый фон */
  border: 1px solid #d0d0d0;
  padding: 20px;
  border-radius: 8px;
  /* max-width: 400px; */
  margin-top: 15px;
  font-family: Arial, sans-serif;
  color: #333;  display: none; /* скрываем блок по умолчанию */

}
.settings.active {
  display: block;
}
/* === Опции слайдера === */
.slider-options {
  display: grid;
  grid-template-columns: 1fr 1fr; /* две колонки */
  gap: 15px 10px;
  margin-bottom: 20px;
}

.option-group {
  display: flex;
  flex-direction: column;
}

.option-group label {
  font-size: 14px;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

.option-group input,
.option-group select {
    padding: 10px 12px;  border-radius: 5px;
  border: 1px solid #bbb;
  font-size: 14px;
  /* background-color: #f5f5f5; */
  color: #333;
}

/* === Кнопки === */
.slider-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* === Кнопки === */
.btn {
  padding: 10px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  color: #fff!important;
}

/* Сохранить настройки — тёмно-серый */
.btn.save {
  background-color: #5a5a5a;
}
.btn.save:hover {
  background-color: #444;
}

/* Изменить порядок — средний серый */
.btn.edit {
  background-color: #777;
}
.btn.edit:hover {
  background-color: #5f5f5f;
}

/* Сохранить порядок — светло-серый */
.btn.save-order {
  background-color: #999;
  color: #222;
}
.btn.save-order:hover {
  background-color: #7f7f7f;
}

/* Удалить — красная */
.btn.delete {
  background-color: #d9534f;
}
.btn.delete:hover {
  background-color: #c9302c;
}


/* === Адаптивность === */
@media(max-width: 500px) {
  .slider-options {
    grid-template-columns: 1fr; /* в одну колонку на маленьких экранах */
  }
  .slider-actions {
    flex-direction: column;
  }
}

/* =========================================
   МИНИАТЮРЫ ПИЛОНОВ
========================================= */
.pylon-thumbs {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.pylon-thumb-item {
  width: 120px;
  height: 210px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  position: relative;
  cursor: pointer;
}
.pylon-thumb-item img,
.pylon-thumb-item video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* заполнение без искажений */
}
.pylon-thumb-del {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}
.pylon-thumb-del:hover {
  background: rgba(255,0,0,0.8);
}

/* =========================================
   КОНТЕЙНЕРЫ И ВЫБОР КОНТЕНТА
========================================= */
.select-content {
  background: #f4f4f4;
  border: 1px solid #d7d7d7;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 25px;
  width: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.select-content label {
  display: block;
  font-size: 14px;
  color: #444;
  font-weight: 600;
  margin-bottom: 8px;
}
.select-content select {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: 0.2s;
}
.select-content select:hover { border-color: #999; }
.select-content button {
  margin-top: 12px;
  padding: 10px 16px;
  background: #e0e0e0;
  border: 1px solid #c8c8c8;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: 0.2s;
}
.select-content button:hover {
  background: #d5d5d5;
  border-color: #a5a5a5;
}
#saveScreenOrderBtn {
  background: #4a4a4a;
  color: #fff;
  border-color: #333;
}
#saveScreenOrderBtn:hover {
  background: #3c3c3c;
}

/* =========================================
   ЭКРАНЫ (SCREEN)
========================================= */
.screen-preview-container {
  position: relative;
  width: 100%;
  height: auto;
}
.screen-bg {
  width: 100%;
  height: auto;
}
.screen-thumbs {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.screen-thumb-item {
  width: 120px;
  height: 210px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  position: relative;
  cursor: pointer;
}
.screen-thumb-item img,
.screen-thumb-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.screen-thumb-del {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
}
.screen-thumb-del:hover {
  background: rgba(255,0,0,0.8);
}
    .popup.hidden { display: none; }
    .popup {
      position: fixed;
      z-index: 1000;
      left: 0; top: 0;
      width: 100%; height: 100%;
      background: rgba(0,0,0,0.5);
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .popup-content {
      background: #fff;
      padding: 20px;
      border-radius: 10px;
      width: 500px;
      max-width: 90%;
      position: relative;
    }
    .popup-close {
      position: absolute;
      top: 10px; right: 15px;
      font-size: 28px;
      cursor: pointer;
    }
    .upload-popup-trigger {
      /* font-size: 24px;
      width: 50px; height: 50px;
      border-radius: 50%;
      border: none;
      background-color: #4CAF50;
      color: #fff;
      cursor: pointer; */
    }
/* Слайдер фиксированного размера для экрана */
.screen-slider {
  position: absolute;
  top: 3%;
  left: 28.3%;
  width: 170px;
  height: 510px;
  overflow: hidden;
}
.screen-slide {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
  object-position: center;
}
.screen-slide.active { display: block; }
.screen-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0,0,0,0.55);
  color: #fff;
  padding: 8px 13px;
  cursor: pointer;
  font-size: 20px;
  border-radius: 50%;
  user-select: none;
  z-index: 20;
}
.screen-arrow.left { left: 6px; }
.screen-arrow.right { right: 6px; }
.screen-dots {
  position: absolute;
  bottom: 8px;
  width: 100%;
  text-align: center;
  z-index: 20;
}
.screen-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin: 0 4px;
  background-color: rgba(255,255,255,0.45);
  border-radius: 50%;
  cursor: pointer;
}
.screen-dot.active { background-color: #fff; }

/* =========================================
   ПИЛОНЫ (PILON)
========================================= */
.pilon-preview-container {
  position: relative;
  width: 100%;
  height: auto;
}
.pilon-slider {
  position: absolute;
  top: 3.9%;
  left: 24.9%;
  width: 272.6px;
  height: 467px;
  overflow: hidden;
}
.pilon-slide {
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
  object-position: center;
}
.pilon-slide.active { display: block;  border-radius: 0;
 }
.pilon-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0,0,0,0.55);
  color: #fff;
  padding: 8px 13px;
  cursor: pointer;
  font-size: 20px;
  border-radius: 50%;
  user-select: none;
  z-index: 20;
}
.pilon-arrow.left { left: 6px; }
.pilon-arrow.right { right: 6px; }
.pilon-dots {
  position: absolute;
  bottom: 8px;
  width: 100%;
  text-align: center;
  z-index: 20;
}
.pilon-dot {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin: 0 4px;
  background-color: rgba(255,255,255,0.45);
  border-radius: 50%;
  cursor: pointer;
}
.pilon-dot.active { background-color: #fff; }

/* =========================================
   ПОЛЯ ВВОДА С ИМЕНЕМ
========================================= */
.name-label {
  display: block;
  margin-bottom: 20px;
  font-family: sans-serif;
}
.name-label span {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}
.name-label input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #f7f7f7;
  font-size: 15px;
  color: #333;
  outline: none;
  transition: 0.25s ease;
}
.name-label input:hover { background: #f0f0f0; }
.name-label input:focus {
  border-color: #888;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(150, 150, 150, 0.2);
}

/* =========================================
   ШАПКА И НАВИГАЦИЯ
========================================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 45px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
.button { width: 100%; display: flex; justify-content: center; }
.upload-btn {
  width: fit-content;
  display: inline-block;
  padding: 8px 20px;
  font-size: 15px;
  font-weight: 600;
  background: #4a4a4a;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
}
.upload-btn:hover { background: #333; transform: translateY(-2px); }
.upload-btn:active { transform: translateY(0); }

/* Навигация */
header nav {
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}
header nav a {
  margin-left: 25px;
  text-decoration: none;
  color: #444;
  font-weight: 500;
  border-bottom: 1px dotted #777;
  transition: 0.3s;
  cursor: pointer;
}
header nav a:hover { color: #000; border-color: #000; }

/* =========================================
   БУРГЕР И МЕДИА ЗАПРОСЫ
========================================= */
.burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 18px;
  cursor: pointer;
}
.burger span {
  display: block;
  height: 3px;
  background: #333;
  border-radius: 2px;
  transition: 0.3s;
}
.burger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.burger.active span:nth-child(2) { opacity: 0; }
.burger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =========================================
   КОНТЕНТ И КАРТОЧКИ
========================================= */
main {
    margin-top: 65px;
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 10px;
}
.card {
  background: #f5f5f5;
  padding: 32px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  width: 100%;
  display: flex;
  text-align: center;
  align-items: center;
  justify-content: center;
}

/* Блоки */
.block { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.block.with-form { grid-template-columns: repeat(3, 1fr); }
.hidden-when-form { display: block; }
.block.with-form .hidden-when-form { display: none; }
.block img { width: 600px; max-width: 100%; height: auto; border-radius: 8px;}

/* =========================================
   СТРАНИЦЫ
========================================= */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.5s ease-in-out; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   ПОДВАЛ
========================================= */
footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  background: #1C1C1C;
  padding: 20px;
  font-size: 14px;
  color: #C4C4C4;
}
.footer_1 img { max-width: 150px; height: auto; margin-bottom: 10px; }
.footer__adress { max-width: 197px; margin-bottom: 12px; }
.footer-connect a,
.footer__politics-link {
  font-size: 14px;
  color: #C4C4C4;
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}
.footer-connect a:hover,
.footer__politics-link:hover { color: #fff; }

/* =========================================
   ТАБЛИЦЫ
========================================= */
.tab { display: grid; gap: 20px; }
table.iksweb {
  width: 100%;
  max-width: 700px;
  border-collapse: separate;
  border-spacing: 0;
  background: #f7f7f7;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}
table.iksweb tr:nth-child(even) { background-color: #efefef; }
table.iksweb td[colspan="2"] {
  background-color: #cfcfcf;
  color: #333;
  font-weight: 600;
  text-align: center;
  padding: 12px 15px;
  font-size: 16px;
}
table.iksweb td {
  padding: 12px 15px;
  font-size: 14px;
  color: #444;
  text-align: left;
}
table.iksweb tr td:first-child { 
  font-weight: 500; 
  width: 40%; 
}
table.iksweb tr:hover {
  background-color: #e0e0e0;
  transition: background-color 0.3s;
}
.tab p { text-align: left; }

/* =========================================
   МОБИЛЬНАЯ АДАПТАЦИЯ
========================================= */
@media (max-width: 900px) {
  .burger { display: flex; }
  header nav {
    position: fixed;
    top: 65px;
    right: -100%;
    flex-direction: column;
    background: white;
    width: 220px;
    padding: 20px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px 0 0 8px;
  }
  header nav.open { right: 10px; }
  header nav a { margin: 10px 0; font-size: 16px; }
}
@media (max-width: 600px) {
  .card { padding: 20px; }
  main { margin-top: 99px; }
  footer { flex-direction: column; align-items: center; text-align: center; }
}

/* =========================================
   ПРЕДПРОСМОТР (PREVIEW)
========================================= */
.preview-list {
  margin-top: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
    /* ВАЖНО — добавляем! */
  max-height: 260px;
  overflow-y: auto;
  padding-right: 5px;
}
.preview-item {
  position: relative;
  width: 120px;
  height: 160px;
  border-radius: 8px;
  overflow: hidden;
  background: #dcdcdc;
  border: 1px solid #bcbcbc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-item img,
.preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  text-align: center;
  line-height: 24px;
  user-select: none;
  transition: 0.2s;
}
.preview-remove:hover { background: rgba(255,0,0,0.7); }
/* Видео-иконка */
.preview-play {
  position: absolute;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.6);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  line-height: 32px;
  text-align: center;
}

/* =========================================
   ФОРМА ЗАГРУЗКИ
========================================= */
.block-form {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.upload-wrapper {
  /* width: 100%; */
  /* max-width: 540px; */
  padding: 20px;
  background: #f2f2f2;
  border: 1px solid #d2d2d2;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.upload-wrapper h2.upload-title {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 600;
  color: #444;
  text-align: center;
}
.upload-submit {
  width: 100%;
  padding: 12px 0;
  margin-top: 20px;
  font-size: 16px;
  background: #4e4e4e;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.3s;
}
.upload-submit:hover { background: #333; }
.file-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #e6e6e6;
  padding: 18px;
  border-radius: 8px;
  border: 1px dashed #b5b5b5;
  cursor: pointer;
  transition: 0.3s;
  text-align: center;
}
.file-label:hover { background: #dcdcdc; }
.file-label span {
  font-size: 15px;
  color: #555;
  margin-bottom: 8px;
}
.file-label input[type="file"] { display: none; }
 .popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  .popup.hidden {
    display: none;
  }
  .popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    position: relative;
    max-width: 500px;
    width: 100%;
  }
  .popup-close {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
  }
/* =========================================
   ПОПАП АВТОРИЗАЦИИ
========================================= */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
.popup.hidden { display: none; }
.popup-content {
  position: relative;
  /* width: 320px; */
  background: #fff;
  padding: 30px 25px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: popupFadeIn 0.3s ease-out;
}
.popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  color: #555;
  transition: color 0.3s;
  user-select: none;
}
.popup-close:hover { color: #e74c3c; }
.popup-content h2 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 22px;
  color: #333;
}
.popup-content input {
  width: 100%;
  padding: 12px 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.popup-content input:focus {
  border-color: #888;
  box-shadow: 0 0 5px rgba(136, 136, 136, 0.3);
  outline: none;
}
.popup-content button {
  width: 100%;
  padding: 12px;
  margin-top: 10px;
  background: #666;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}
.popup-content button:hover { background: #444; }
.popup-content button.cancel {
  background: #777;
}
.popup-content button.cancel:hover { background: #555; }
.popup-content p {
  color: red;
  margin-bottom: 15px;
  font-size: 14px;
}

/* =========================================
   ПОДСВЕТКА ОШИБОК
========================================= */
.error-cell { background: #ffb9b9 !important; }

/* =========================================
   ЛОГОТИП
========================================= */
.logo {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.logo a { text-decoration: none; color: #EC4D42; }
.logo img { width: 175px; height: auto; }

/* =========================================
   СЛАЙДЕРЫ ВСПОМОГАТЕЛЬНЫЕ
========================================= */
.screen-slide-wrapper {
  width: 170px;
  height: 510px;
  position: relative;
  overflow: hidden;
  display: none;
}
.screen-slide-wrapper.active { display: block; }
.screen-slide-wrapper .screen-slide {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}
.screen-slide-wrapper video.screen-slide {
  width: 100%;
  height: 100%;
}

/* =========================================
   АНИМАЦИИ
========================================= */
@keyframes popupFadeIn {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
  .preview-list {
    max-height: 300px; /* высота контейнера, можно изменить под нужды */
    overflow-y: auto; /* вертикальный скролл при переполнении */
    border: 1px solid #ccc; /* рамка для наглядности, по желанию */
    padding: 10px;
    background: #f9f9f9; /* фон, по желанию */
  }

  /* Минимальный отступ между миниатюрами */
  .preview-list img, video {
    width: 100%;
    height: 100%;
    object-fit: cover;

  }

