/* ============================================================
   NotFace — современные дополнения и адаптивность
   ============================================================ */

/* ---------- Локальные шрифты (вместо Google Fonts) ---------- */
@font-face {
  font-family: 'PT Sans';
  src: url('../fonts/Cuprum/Cuprum-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'PT Sans';
  src: url('../fonts/Cuprum/Cuprum-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/Open_Sans/OpenSans-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/Open_Sans/OpenSans-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: 'Open Sans';
  src: url('../fonts/Open_Sans/OpenSans-ExtraBold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
}

/* ---------- Базовые правки ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

/* ============================================================
   Модальные попапы (замена fancybox)
   ============================================================ */

/* Overlay-затемнение под попапом */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9990;
}
.popup-overlay.open {
  display: block;
}

/* Попап — модальное окно поверх overlay */
.popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9991;
  display: none;
  width: 340px;
  max-width: 92vw;
  max-height: 92vh;
  overflow-y: auto;
  margin: 0;
}
.popup.open {
  display: block;
}

/* Крестик закрытия */
.popup .close {
  position: absolute;
  top: 8px;
  right: 12px;
  cursor: pointer;
  z-index: 2;
  font-size: 22px;
  line-height: 1;
  color: #555;
  text-decoration: none;
}

/* Промо-фон на всю ширину */
.promo {
  width: 100%;
}
.promo-bg {
  background-size: 100% auto;
}
.pic_1 .promo-wrap,
.pic_2 .promo-wrap {
  background-size: cover;
}
.pic_1 .promo-bg,
.pic_2 .promo-bg {
  background-size: cover;
}

/* ============================================================
   Мессенджер (Мои сообщения)
   ============================================================ */
.messenger {
  display: flex;
  height: 600px;
  border: 1px solid #e6e1da;
  background: #fff;
}

.dialogs-list {
  width: 260px;
  flex: 0 0 260px;
  border-right: 1px solid #e6e1da;
  background: #fbfaf7;
  overflow-y: auto;
}
.dialogs-list-title {
  padding: 14px 16px;
  font-family: 'PT Sans', 'Cuprum', sans-serif;
  font-weight: bold;
  color: #565859;
  border-bottom: 1px solid #eee9e2;
}
.dialog-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f4f0ea;
}
.dialog-row:hover {
  background: #e7f3f5;
}
.dialog-row.active {
  background: #d6ecef;
}
.dialog-row .respondent-ava img {
  width: 34px;
  height: 34px;
}
.dl-info {
  flex: 1;
  min-width: 0;
}
.dl-name {
  font-weight: bold;
  color: #333;
  font-size: 14px;
}
.dl-preview {
  color: #888;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #eee9e2;
  background: #fbfaf7;
}
.chat-ava img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}
.chat-name {
  font-weight: bold;
  color: #333;
  font-size: 16px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fff;
}
.chat-messages .message {
  padding: 9px 14px;
  margin-bottom: 8px;
  border-radius: 6px;
  max-width: 70%;
  position: relative;
  clear: both;
}
.chat-messages .message.respondent {
  background: #e7f3f5;
  float: left;
}
.chat-messages .message.author {
  background: #eef0ff;
  float: right;
}
.chat-messages .message .message-text {
  padding-right: 0;
  word-wrap: break-word;
}
.chat-messages .message .time {
  position: static;
  display: block;
  font-size: 11px;
  margin-top: 4px;
  text-align: right;
}
.write-block {
  border-top: 1px solid #eee9e2;
  padding: 12px 16px;
  background: #fbfaf7;
}
.write-block textarea {
  width: 100%;
  height: 64px;
  padding: 10px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 4px;
  resize: vertical;
  box-sizing: border-box;
}
.write-block .button_red {
  height: auto;
  line-height: 1;
  padding: 10px 22px;
  margin-top: 10px;
}

/* ---------- Просмотр вопроса (модальное окно) ---------- */
.question-view-popup {
  width: 560px;
  max-width: 94vw;
}
.question-view-popup .popup-content {
  max-height: 75vh;
  overflow-y: auto;
}
/* Внутри модалки вопрос — в колонку (картинка сверху, текст ниже) */
.question-view-popup .question-area {
  padding-top: 4px;
}
.question-view-popup .question-pic {
  float: none;
  width: 100%;
  text-align: center;
  margin-bottom: 14px;
}
.question-view-popup .question-pic img {
  width: auto;
  max-width: 100%;
  max-height: 200px;
  margin: 0 auto;
}
.question-view-popup .question {
  float: none;
  width: 100%;
  margin-left: 0;
}
.question-view-popup .question-text {
  padding-right: 0;
  margin-bottom: 10px;
  font-size: 17px;
  line-height: 1.4;
}
.question-view-popup .question .rate {
  position: static;
  width: auto;
  text-align: left;
  margin-bottom: 12px;
}
.question-view-popup .question .rate .rating {
  font-size: 15px;
  color: #d32f52;
  font-weight: bold;
}
/* варианты — таблица */
.question-view-popup .variants .table {
  display: block;
}
.question-view-popup .cells-bl {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
}
.question-view-popup .radio-cell {
  flex: 0 0 auto;
}
.question-view-popup .radio-cell input {
  margin: 0;
}
.question-view-popup .text-cell {
  color: #333;
  font-size: 14px;
  line-height: 1.4;
}
.question-view-popup .hand {
  display: inline-block;
  width: 14px;
  height: 16px;
  margin-left: 4px;
  cursor: pointer;
}
.question-view-popup .close {
  font-size: 18px;
  color: #888;
  text-decoration: none;
}
.question-view-popup .close:hover {
  color: #333;
}


@media (max-width: 768px) {
  .messenger {
    flex-direction: column;
    height: auto;
  }
  .dialogs-list {
    width: 100%;
    flex: none;
    max-height: 260px;
  }
  .chat-panel {
    min-height: 420px;
  }
}


/* Показываем нативные radio/checkbox, убираем зависимость от спрайтов */
input[type="radio"],
input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: auto;
  display: inline-block;
  width: 16px;
  height: 16px;
  margin: 0 6px 0 0;
  vertical-align: middle;
  cursor: pointer;
  accent-color: #d32f52;
}

/* Выравнивание radio «Парень/Девушка» в попапе */
.popup .radios p {
  display: block;
  margin: 8px 0;
  padding-left: 0;
}
.popup .radios label {
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.radios {
  max-height: none;
}

/* Чекбокс «Только онлайн» */
.checkbox-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.checkbox-field label {
  cursor: pointer;
}

/* В топе чекбокс встаёт рядом с полем поиска (не float) */
.search-options .checkbox-field {
  display: inline-flex;
  float: none;
  vertical-align: middle;
  margin-left: 16px;
  padding-top: 0;
}
.search-options input[type="text"],
.search-options .dialogs-search {
  display: inline-block;
  vertical-align: middle;
}

/* Чекбокс «Только онлайн»: надпись и сам чекбокс вместе */
.search-options .only-online {
  float: left !important;
  margin-right: 0 !important;
  margin-left: 20px;
  margin-top: 3px;
}
.only-online label {
  display: inline-block;
  vertical-align: middle;
  margin-left: 6px;
}

/* Фильтры поиска по параметрам — селекты в ряд */
#search-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
}
#search-filters p {
  float: none;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#search-filters label {
  font-size: 13px;
  color: #565859;
}
#search-filters select.custom-select {
  width: auto;
  min-width: 130px;
  max-width: 180px;
}

/* Нативные select вместо select2 */
select.custom-select {
  appearance: auto;
  -webkit-appearance: auto;
  display: inline-block;
  width: 100%;
  max-width: 220px;
  padding: 6px 8px;
  font-size: 14px;
  border: 1px solid #ccc;
  border-radius: 3px;
  background: #fff;
}
.select-row p {
  display: inline-block;
  margin: 0 6px 0 0;
}


/* ============================================================
   Адаптивность
   ============================================================ */

/* Планшеты */
@media (max-width: 1024px) {
  .wrapper,
  .container {
    padding: 0 16px;
  }
}

/* Мобильные */
@media (max-width: 768px) {
  .concept {
    width: 100% !important;
    float: none !important;
  }
  .concept .preview,
  .concept .concept-text {
    width: 100% !important;
    float: none !important;
  }
  .concept .preview img {
    margin: 0 auto;
  }

  .search-options,
  .search-result {
    width: 100% !important;
    float: none !important;
  }

  .profile-photo,
  .profile-info {
    width: 100% !important;
    float: none !important;
  }

  .about-block {
    min-width: 0;
  }

  .promo .wrapper {
    padding-left: 16px;
  }
  .promo .slogan-text span {
    font-size: 24px;
    line-height: 30px;
  }
  .bg-people {
    display: none;
  }

  footer .menu ul li {
    width: 100%;
    float: none;
  }
}

/* Карточки профилей (float → grid) */
@media (max-width: 900px) {
  .result-profiles {
    margin-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
  }
  .result-profile {
    float: none;
    width: calc(50% - 8px);
    margin-left: 0;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .result-profile {
    width: calc(33.333% - 17px);
  }
}

/* Телефоны */
@media (max-width: 480px) {
  .result-profile {
    width: 100%;
  }

  .btn {
    width: 100%;
    text-align: center;
    padding: 14px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .topline {
    flex-wrap: wrap;
  }

  .mobile-nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
  }
  .main-nav.open {
    display: block;
  }
}

/* ============================================================
   Картинки вопроса — единый размер
   ============================================================ */
.question-pic img {
  width: 280px;
  height: 200px;
  object-fit: cover;
  object-position: center;
}

/* Блюр фото в пробном топе */
.profile-pic.blurred img {
  filter: blur(10px);
}

/* Таймер-баннер на пробном топе */
.timer-banner {
  background: #fff;
  border: 1px solid #eee9e2;
  margin-bottom: 16px;
}

/* Полублюр фото в пробном топе (силуэт угадывается, лицо нет) */
.profile-pic.half-blur img {
  filter: blur(5px);
  opacity: 0.85;
}

/* ---------- Градуированный блюр по проценту совпадений ---------- */
/* Чем больше % совпадений, тем чётче фото */
.profile-pic.blur-0 img { filter: blur(12px); opacity: 0.30; }  /* 0-9%   — почти не видно */
.profile-pic.blur-1 img { filter: blur(9px);  opacity: 0.45; }  /* 10-24% — едва угадывается */
.profile-pic.blur-2 img { filter: blur(7px);  opacity: 0.60; }  /* 25-39% — силуэт, лицо нет */
.profile-pic.blur-3 img { filter: blur(5px);  opacity: 0.75; }  /* 40-59% — наполовину */
.profile-pic.blur-4 img { filter: blur(3px);  opacity: 0.88; }  /* 60-79% — почти чётко */
.profile-pic.blur-5 img { filter: blur(0px);  opacity: 1;    }  /* 80%+   — полностью чётко */

/* Выравнивание radio «Парень/Девушка» по левому краю */
.radios p,
.popup .radios p,
.popup .field.radios p {
  padding-left: 0 !important;
  margin: 8px 0 !important;
  display: block !important;
  float: none !important;
}
.radios label,
.popup .radios label {
  top: 0;
  position: static;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.radios input[type="radio"],
.popup .radios input[type="radio"] {
  margin: 0 !important;
  flex: 0 0 auto;
  width: auto !important;
  text-align: left !important;
}

/* Социальные кнопки регистрации (ВК / Яндекс кружки) */
.ya {
  background: #fc3f1d;
  border-radius: 50%;
  position: relative;
  height: 43px;
  width: 43px;
  display: inline-block;
}
.ya:after {
  content: 'Я';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-family: 'PT Sans', 'Cuprum', sans-serif;
  font-size: 20px;
  font-weight: bold;
}
.social-auth {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.social-btn {
  display: block;
  width: 100%;
  padding: 13px 16px;
  text-align: center;
  font-family: 'PT Sans', 'Cuprum', sans-serif;
  font-size: 16px;
  font-weight: bold;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  transition: opacity .15s;
}
.social-btn:hover {
  opacity: .88;
  text-decoration: none;
  color: #fff;
}
.vk-btn {
  background: #4a76a8;
}
.ya-btn {
  background: #fc3f1d;
}

/* Центрирование соцкружков (ВК / Яндекс) */
.social-links {
  display: table;
  margin: 0 auto;
  padding-left: 0 !important;
  float: none;
}
.social-links a {
  float: none;
  display: inline-block;
  vertical-align: middle;
}

/* Крестик закрытия — красиво, в правом верхнем углу, без наложения на текст */
.popup .close {
  right: 8px;
  top: 8px;
  z-index: 2;
}
.popup .popup-title {
  padding-right: 46px;
}

/* ---------- Адаптивное меню навигации ТОЛЬКО на мобильных ---------- */
@media (max-width: 768px) {
  .wrapper.tabs {
    display: flex;
    flex-direction: column;
  }
  .wrapper.tabs > aside {
    width: 100%;
    order: 0;
  }
  .wrapper.tabs > .content {
    width: 100%;
    order: 1;
  }
  .tabs-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 10px 0;
    margin: 0;
  }
  .tabs-menu li {
    display: inline-block;
  }
  .tabs-menu li a {
    display: inline-block;
    padding: 7px 10px;
    color: #2e2e2e;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    background: #f5f1eb;
  }
  .tabs-menu li.current a,
  .tabs-menu li a:hover {
    background: #d32f52;
    color: #fff;
  }
}

/* ---------- Цвета полосок заголовков блоков (по ТЗ) ---------- */
/* Мои увлечения — зелёная полоска (как в анкете) */
.editing.second .profile-top {
  background: #75d863;
}
/* Общая информация — бирюзовая (уже есть в style.css #3f879a) */

/* ---------- Выравнивание кнопок навигации вопроса по центру ---------- */
.answer-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  padding-left: 0;
  margin-top: 20px;
}
.answer-buttons .end {
  margin-left: 0;
  margin-top: 0;
}
.answer-buttons .button_red {
  height: 40px;
  line-height: 40px;
  padding: 0 24px;
  font-size: 16px;
}

/* Кнопка «Показать еще» — тёмный текст (иначе белый не виден на сером) */
.more-button {
  color: #2e2e2e !important;
  text-align: center;
  line-height: 40px;
}

/* ---------- Сетка совпадений: 4 в ряд, без выхода за границы ---------- */
.result-profiles {
  margin-left: 0 !important;
  overflow: hidden;
}
.result-profile {
  float: left;
  width: 23.5%;
  margin: 0 2% 20px 0;
}
.result-profile:nth-child(4n) {
  margin-right: 0;
}
/* Кнопка «Показать еще» по центру */
#more-wrap {
  clear: both;
  text-align: center;
  padding: 16px 0 8px;
}

/* ---------- Страницы редактирования разделов (без float-съезда) ---------- */
.editing .fill-form {
  float: none;
  width: auto;
}
.editing .fill-form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
}
.editing .fill-form label {
  display: block;
  margin-bottom: 8px;
  color: #565859;
  font-size: 15px;
}
/* Единые отступы: подпись снизу как в "Мои увлечения" */
.editing .profile-information {
  padding: 16px 15px 0;
}
.editing .note {
  margin-top: 14px;
}
/* Стрелка назад (вместо "Отменить") */
.back-link {
  display: inline-block;
  color: #d32f52;
  text-decoration: none;
  font-size: 14px;
  margin-top: 14px;
}
.back-link:hover {
  text-decoration: underline;
}
