/* === ОСНОВНАЯ ОБЕРТКА МОДАЛЬНОГО ОКНА === */
.modal-overlay-info {
  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;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay-info.active {
  opacity: 1;
  background: white;
  visibility: visible;
}

/* === БЛОКИРОВКА ПРОКРУТКИ (CSS часть) === */
body.modal-open {
  /*overflow: hidden;  Блокируем прокрутку страницы */
  margin-right: 0; /* Исправление скроллбара при скрытии */
}

/* === СТИЛИ МОДАЛЬНОГО ОКНА С ОТСТУПАМИ === */
.modal-overlay-info.active .modal-info-card {
  width: 100%;
  background-color: #d7dee6;
  height: auto; /* Убираем 100vh */
  max-height: 90%; /* Не больше 90% высоты экрана */
  overflow-y: auto;
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0,0,0,0.3);
  padding: 20px;
  margin: 40px auto; /* ОТСТУП ОТ ВЕРХА И НИЗА — 40px */
}

/* === 1. ЛЕВАЯ КОЛОНКА (СТАТУС / КНОПКИ) === */
.modal-card-row > :first-child { /* Левый блок (кнопки) */
  display: flex;
  flex-direction: column; /* Кнопки встают вертикально */
  align-items: flex-start;
  gap: 8px; /* Отступы между кнопками */
  padding-left: 20px;
  border-right: 1px solid #eee; /* Линия-разделитель справа */
}

/* Стили заголовка в левой колонке */
.modal-card-row > :first-child > div:first-child {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}

/* === 2. ЦЕНТРАЛЬНАЯ КОЛОНКА (ИНФОРМАЦИЯ) === */
.modal-card-row > :nth-child(2) { /* Центральный блок */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 0 20px;
  border-right: 1px solid #eee; /* Линия-разделитель справа */
}

/* Шапка карточки (в центре) */
.modal-header-info {
  text-align: center;
  margin-bottom: 16px;
}

.modal-header-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #333;
}

.modal-header-sub {
  font-size: 14px;
  color: #666;
  margin: 0;
}

/* Список собственников */
.modal-owner-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-owner-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

/* === 3. ПРАВАЯ КОЛОНКА (ИСТОРИЯ / СТАТИСТИКА) === */
.modal-card-row > :last-child { /* Правый блок (история) */
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding-left: 20px;
}

.modal-stats-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.modal-stat-label {
  font-weight: 500;
  color: #555;
  font-size: 13px;
}

.modal-stat-value {
  font-size: 14px;
  color: #333;
}

.modal-stat-sub {
  font-size: 12px;
  color: #777;
}
.modal-card-container {
  margin-bottom: 16px; /* Отступ между карточками */
  border-radius: 8px;
  overflow: hidden; /* Скрывает переполнение, если контент выйдет за рамку */
}



/* === РАЗДЕЛИТЕЛИ МЕЖДУ КАРТОЧКАМИ (СТРОКАМИ) === */
.modal-cards-grid {
  display: flex;
  flex-direction: column; /* Строки друг под другом */
  gap: 16px; /* Отступы между карточками */
  padding: 20px;
}

.modal-card-row {
    display: grid;
    grid-template-columns: 350px 1fr auto;
    gap: 16px;
    align-items: start;
    border: 2px solid #ccc;
    background-color: white;
}

/* === КНОПКИ СТАТУСОВ === */
.modal-status-btn {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-sizing: border-box;
}



.modal-card-row > :first-child {
  width: 280px;
  flex-shrink: 0; /* Запрещаем сужаться */
  border-right: 1px solid #eee; /* Линия-разделитель между левой и центральной колонкой */
}


.modal-card-row > :nth-child(2) {
  flex: 1; /* Занимает оставшееся пространство */
  padding-left: 20px; /* Отступ от разделительной линии */
  border-right: 1px solid #eee; /* Линия-разделитель между центром и правой колонкой */
}

/* 6. Правая колонка (История/Таймлайн) */
.modal-card-row > :last-child {
  width: 300px;
  flex-shrink: 0;
  padding-left: 20px; /* Отступ от разделительной линии */
}

.modal-status-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modal-status-btn:disabled {
  background-color: #eee;
  color: #999;
  cursor: not-allowed;
}

/* Цвета кнопок */
.btn-registered { background-color: #0f6bff; color: white; }
.btn-inspection { background-color: #be9fff; color: black; }
.btn-inspection-in-progress { background-color: #be9fff; color: black; }
.btn-documents { background-color: #daff96; color: black; }
.btn-rejection { background-color: red; color: white; }
.btn-warranty  { background-color: #a4fd00; color: black; }
.btn-KeyIssuance { background-color: #a4fd00; color: black; }
.btn-watch { background-color: #a4fd00; color: black; }
/* === КНОПКА ЗАКРЫТИЯ === */
.modal-close-btn {
  /* position: absolute; */
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #e60909;
  z-index: 10;
  font-weight: 600;
}

.modal-close-btn:hover {
  color: #333;
}
/* БЛОК СОБСТВЕННИКОВ (modal-owner-list) */
.modal-owner-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.modal-owner-item {
  display: flex;
  flex-direction: column; 
  align-items: center; 
  margin-bottom: 12px; 
  text-align: center; 
}

.modal-owner-name {
  font-weight: 600;
  margin-bottom: 4px;
}

.modal-owner-email,
.modal-owner-phone {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 4px;
}

/* БЛОК ДАННЫХ ПОМЕЩЕНИЯ (modal-room-details) */
.modal-room-details {
  text-align: center; /* Центрируем общий блок */
}

.modal-detail-row {
  display: flex;
  flex-direction: column; 
  align-items: center;
  gap: 8px; 
}

.modal-detail-label {
  font-weight: 500;
  color: #555;
}

.modal-detail-value {
  font-size: 1.1em;
  font-weight: 600;
}
.point-image-btn {
  display: inline-block; /* Сохраняем строчное поведение, но можем задавать размеры */
  width: 20px;
  height: 20px;
  line-height: 20px; /* Центрирует текст по вертикали */
  text-align: center;
  border-radius: 50%; /* Делаем круглую форму */
  background-color: #ccc; /* Серый фон */
  color: #333; /* Цвет текста */
  font-size: 12px;
  font-weight: bold;
  border: 1px solid #ddd; /* Тонкая рамка */
  cursor: pointer; /* Показываем, что элемент кликабелен */
  margin-left: 5px; /* Отступ от предыдущего текста */
  transition: all 0.3s ease; /* Плавные переходы */
}
.point-image-btn:hover {
  background-color: #e0e0e0; /* Чуть темнее при наведении */
  transform: scale(1.1); /* Легкий эффект увеличения */
  box-shadow: 0 0 3px rgba(0,0,0,0.3); /* Тень для объема */
}
.point-image-btn:active {
  transform: scale(0.95);
  background-color: #d0d0d0;
}



/* Адаптация под мобильные устройства (ширина экрана до 768px) */
@media (max-width: 768px) {

  /* 1. Убираем сетку и делаем вертикальный список */
      .modal-card-row {
        display: flex;
        flex-direction: column;
        gap: 16px;
        border: none;
        align-items: stretch;
    }

  /* 2. Убираем фиксированные ширины и разделители для каждой колонки */
  .modal-card-row > :first-child,
  .modal-card-row > :nth-child(2),
  .modal-card-row > :last-child {
    width: auto; /* ширина по содержимому */
    flex-shrink: 0; /* не сжимать колонки */
    border-right: none; /* убираем вертикальные разделители */
    border-bottom: 1px solid #eee; /* опционально: разделитель между блоками */
    padding: 0 16px; /* отступы внутри блоков */
  }

  /* 3. Центрируем контент внутри блоков (если нужно выравнивание) */
  .modal-card-row > :nth-child(2) {
    text-align: center; /* для центральной карточки */
  }

  /* 4. Стили для кнопок (чтобы они занимали всю ширину) */
  .modal-status-btn {
    width: 100%; /* кнопки растягиваются на всю ширину экрана */
  }

  /* 5. Опционально: уменьшаем отступы и шрифты для удобства на телефоне */
  .modal-info-card {
    padding: 16px; /* уменьшенные отступы внутри модалки */
  }
  .modal-header-title {
    font-size: 16px;
  }
}
.point-image-btn {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: #e0e0e0;
  color: #333;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s, transform 0.2s;
}
.point-image-btn:hover {
  background-color: #d0d0d0;
  transform: scale(1.05);
}
.point-image-btn::after {
  content: 'показать план с точкой';
  position: absolute;
  left: 50%;
  top: 24px;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}
.point-image-btn:hover::after {
  opacity: 1;
}
