@charset "UTF-8";

/*
* © Система гостевых объявлений «НОЧЛЕГ.МОСКВА»
* Сделано виртуальным помощником Алисой (Яндекс) и Pi-Ti
* по просьбе Пароходик.рф для сайта ночлег.москва
*v2.2 алаптация для проездом.москва
*/

/* Общие стили страницы */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f4f6f9;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

h1 {
  text-align: center;
  color: #2c3e50;
  margin-bottom: 30px;
  font-size: 2.2rem;
  font-weight: 300;
}

/* Стили формы — растяжение и отступы */
form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: #f8fafc;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #e1e8ed;
  width: 100%;
  max-width: 100%;
}

form > * {
  margin-bottom: 20px;
}

form > *:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.95rem;
}

/* Стили для выпадающего списка типа жилья */
select {
  padding: 10px;
  border: 1px solid #e1e8ed;
  border-radius: 4px;
  background: #fff;
  font-size: 0.95rem;
  color: #2c3e50;
  width: 100%;
  appearance: none;
  -moz-appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%237f8da8'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
}

/* Контейнер для выпадающего списка */
.housing-type-container {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Основные стили для полей ввода */
input, textarea, select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #d1d9e6;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-color: white;
  box-sizing: border-box;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

textarea {
  min-height: 120px;
  resize: vertical;
  font-family: inherit;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

button:active {
  transform: translateY(0);
}

/* Разделитель между формой и сообщениями */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, #bdc3c7, transparent);
  margin: 40px 0;
}

/* Контейнер для сообщений */
.guestbook {
  margin-top: 30px;
}

/* Карточка сообщения */
.message {
  border: 1px solid #ecf0f1;
  padding: 20px;
  margin-bottom: 25px;
  border-radius: 8px;
  background: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.message:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.message h3 {
  margin: 0 0 12px 0;
  color: #2c3e50; /* Оставляем исходный цвет для .message h3 */
  font-size: 1.3rem;
  font-weight: 500;
}

.message p {
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Стили для дополнительных полей */
.message strong {
  color: #7f8c8d;
  font-weight: 600;
}

/* Ссылка в сообщении */
.message a {
  color: #3498db;
  text-decoration: none;
  transition: color 0.2s ease;
}

.message a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* Фото в сообщении */
.message img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 15px 0;
  display: block;
}


/* Дата добавления сообщения */
.message small {
  display: block;
  color: #95a5a6;
  font-style: italic;
  margin-top: 15px;
  border-top: 1px dashed #bdc3c7;
  padding-top: 10px;
}

/* Стили обязательных и необязательных полей */
.required {
  border-color: #e74c3c !important;
  background-color: #fffcec;
}

.optional {
  border-color: #2ecc71 !important;
}

.required:focus {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3);
}

.optional:focus {
  border-color: #27ae60;
  box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.3);
}

/* Валидация полей */
input:invalid {
  border-color: #e74c3c;
}

input:valid {
  border-color: #2ecc71;
}

/* Визуальные группы формы */
.form-section {
  padding-bottom: 20px;
  margin-bottom: 25px;
  border-bottom: 1px dashed #e1e8ed;
}

.form-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

/* Заголовок секции (опционально) */
.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d1d9e6;
}

/* Собственные стили для кнопок меню */
.menu-button {
  display: block;
  padding: 12px 20px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: #2c3e50;
  background: linear-gradient(135deg, #f8fafc, #eef2f7);
  border: 1px solid #d1d9e6;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  min-width: 100px;
}

.menu-button:hover {
  background: linear-gradient(135deg, #e1e8ed, #d1d9e6);
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(52, 152, 219, 0.2);
}

.menu-button:active {
  transform: translateY(0);
  background: linear-gradient(135deg, #d1d9e6, #c5ccd6);
}

/* --- Стили объявлений (ads-list) --- */
.ads-list {
  width: 100%;
  max-width: 800px;
  margin: 30px auto 0;
}

.ads-list .ad-item {
  border: 1px solid #ddd;      /* Серая рамка вокруг каждого объявления */
  padding: 15px;             /* Отступы внутри рамки (между текстом и рамкой) */
  margin-bottom: 20px;       /* Отступ снизу — создаёт пространство между объявлениями */
  background-color: #fff;    /* Белый фон для контраста */
  border-radius: 8px;        /* Скруглённые углы для современного вида */
}

.ads-list .ad-item:last-child {
  margin-bottom: 0;          /* Убираем отступ у последнего объявления */
}

.zip-download-link {
    display: inline-block;
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.zip-download-link:hover {
    background-color: #0056b3;
}


/* Гарантированно окрашиваем заголовки (<h3>) внутри объявлений в красный */
.ads-list .ad-item h3 {
  color: red;
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 10px 0;
}

/* Адаптивность */
@media (max-width: 600px) {
  .container {
    padding: 15px;
    margin: 10px;
    box-sizing: border-box;
  }
  
  h1 {
    font-size: 1.8rem;
    line-height: 2.2rem;
  }
  
  form {
    padding: 20px 15px;
  }
  
  form > * {
    margin-bottom: 15px; /* Меньший отступ на узких экранах */
  }
  
  input, textarea, select, button {
    width: 100%; /* Все элементы — на всю ширину */
    padding: 12px 10px; /* Компактные отступы */
  }
  
  .file-wrapper {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  img, video {
    max-width: 100%;
    height: auto;
  }
  
  p, ul, ol {
    margin: 8px 0;
    line-height: 1.6;
  }
}

/* Плавное появление элементов */
.message {
  animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
