/* Стили для страницы отзывов */
.page-header {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 60px 40px;
  text-align: center;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
}

.page-subtitle {
  font-size: 18px;
  color: #0090ff;
  font-weight: 600;
  margin-bottom: 15px;
  display: block;
}

.page-title {
  font-size: 42px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #1a1a1a;
}

.page-description {
  font-size: 18px;
  line-height: 1.6;
  color: #4d4d4d;
  max-width: 800px;
  margin: 0 auto;
}

.reviews-main {
  background: #1b1d22;
  padding: 80px 40px;
}

.reviews-container {
  max-width: 1200px;
  margin: 0 auto;
}

.reviews-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
  margin-bottom: 50px;
  justify-items: center; /* Добавьте это свойство */
}
/* Стили для модального окна Яндекс Карт */
.modal-actions {
    text-align: center;
    margin-top: 25px;
}

.modal-actions .portfolio-button {
    margin: 0 auto;
}

/* Анимация появления модального окна */
.modal {
    animation: fadeIn 0.3s ease;
}

#yandex-modal .close-button {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

#yandex-modal .close-button:hover {
  color: black;
  background: #999;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.review-card {
  background: #252830;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 400px; /* Фиксированная высота */
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 400px;
}

.review-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-shrink: 0; /* Запрещаем сжатие */
}

.reviewer-info {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-shrink: 0;
}

.reviewer-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1b1d22 0%, #252830 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0090ff;
  font-size: 20px;
  flex-shrink: 0;
}

.reviewer-details h3 {
  margin: 0 0 5px 0;
  color: white;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.review-date {
  color: #999;
  font-size: 14px;
  flex-shrink: 0;
}

.review-rating {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.stars {
  color: #ffc107;
  font-size: 16px;
  white-space: nowrap;
}

.review-content {
  margin-bottom: 20px;
  flex-grow: 1; /* Занимает все доступное пространство */
  overflow: hidden; /* Скрываем переполнение */
  position: relative;
}

.review-content p {
  color: white;
  line-height: 1.6;
  margin: 0;
  font-size: 15px;
  display: -webkit-box;
  -webkit-line-clamp: 6; /* Ограничиваем количество строк */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 144px; /* 6 строк * 24px line-height */
}

/* Убираем эффект отображения полного текста при наведении */
.review-content::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, transparent 0%, #252830 100%);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.read-more-button {
  background: transparent;
  color: #0090ff;
  border: none;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  margin-top: 8px;
  margin-bottom: 15px;
  flex-shrink: 0;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  position: relative;
}

.read-more-button::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background-color: #0090ff;
  transition: width 0.3s ease;
}

.read-more-button:hover {
  color: #33aaff;
}

.read-more-button:hover::after {
  width: 100%;
}

.read-more-button:active {
  color: #0066cc;
}

.review-project {
  border-top: 1px solid #444; /* Изменено на #444 для единообразия */
  padding-top: 15px;
  flex-shrink: 0; /* Запрещаем сжатие */
  margin-top: auto; /* Прижимаем к низу */
}

.project-type {
  color: #0090ff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Модальное окно для полного отзыва */
.review-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 3000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.review-modal-content {
  background: #252830;
  border-radius: 16px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.review-modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.review-modal-close:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.review-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
  padding-right: 30px;
}

.review-modal-rating {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.review-modal-stars {
  color: #ffc107;
  font-size: 18px;
}

.review-modal-content p {
  color: white;
  line-height: 1.6;
  font-size: 16px;
  margin-bottom: 20px;
}

.review-modal-project {
  border-top: 1px solid #444;
  padding-top: 15px;
  margin-top: 20px;
}

.review-modal-project-type {
  color: #0090ff;
  font-size: 15px;
  font-weight: 500;
}

/* Стили для скроллбара в модальном окне */
.review-modal-content::-webkit-scrollbar {
  width: 6px;
}

.review-modal-content::-webkit-scrollbar-track {
  background: #1b1d22;
  border-radius: 3px;
}

.review-modal-content::-webkit-scrollbar-thumb {
  background: #0090ff;
  border-radius: 3px;
}

.review-modal-content::-webkit-scrollbar-thumb:hover {
  background: #33aaff;
}

/* Кнопка Яндекс Карт */
.yandex-reviews-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #ff0000 0%, #cc0000 100%);
  color: white;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
  justify-content: center;
  min-width: 280px;
  width: auto;
}

.maps-buttons-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* Кнопка 2ГИС */
.gis-reviews-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #00a86b 0%, #008a56 100%);
  color: white;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  margin-top: 20px;
  box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
  justify-content: center;
  min-width: 280px;
  width: auto;
}

.yandex-reviews-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.4);
  color: white;
}

.gis-reviews-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 168, 107, 0.4);
  color: white;
}

.yandex-reviews-button:active {
  transform: translateY(0);
}

.gis-reviews-button:active {
  transform: translateY(0);
}

.yandex-icon {
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #ff0000;
  font-size: 14px;
}

.gis-icon {
  width: 40px;
  height: 20px;
  background: white;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: #00a86b;
  font-size: 14px;
}

.reviews-navigation {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 40px;
}

.nav-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #0090ff;
  background: transparent;
  color: #0090ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-button:hover {
  background: #0090ff;
  color: white;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #666;
  font-size: 16px;
}

.current-page {
  font-weight: 600;
  color: #0090ff;
}

.add-review-section {
  background: white;
  padding: 80px 40px;
}

.add-review-container {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.add-review-container h2 {
  font-size: 32px;
  margin-bottom: 15px;
  color: #1a1a1a;
}

.add-review-container p {
  color: #666;
  margin-bottom: 40px;
  font-size: 18px;
}

.review-form {
  text-align: left;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #0090ff;
  box-shadow: 0 0 0 2px rgba(0, 144, 255, 0.1);
}

.rating-stars {
  display: flex;
  gap: 5px;
}

.rating-stars i {
  font-size: 24px;
  color: #ddd;
  cursor: pointer;
  transition: color 0.2s ease;
}

.messages-container {
    text-align: center;
    margin-bottom: 30px;
}

.alert {
    display: inline-block;
    margin: 0 auto;
    text-align: left;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
}

.rating-stars i:hover,
.rating-stars i.active {
  color: #ffc107;
}

.form-submit {
  text-align: center;
  margin-top: 30px;
}

.submit-review-button {
  background: linear-gradient(135deg, #0090ff 0%, #0066cc 100%);
  color: white;
  border: none;
  padding: 15px 40px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-review-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 144, 255, 0.4);
}

.reviews-stats {
  background: #252830;
  color: white;
  padding: 80px 40px;
  text-align: center;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
}

.stats-container h2 {
  font-size: 32px;
  margin-bottom: 50px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}

.stat-item {
  padding: 30px 20px;
}

.stat-number {
  font-size: 48px;
  font-weight: 700;
  color: #0090ff;
  margin-bottom: 10px;
}

.stat-label {
  font-size: 16px;
  color: #ccc;
}

/* Стили для скроллбара в отзывах */
.review-content::-webkit-scrollbar {
  width: 4px;
}

.review-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 2px;
}

.review-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 2px;
}

.review-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Стили для сообщений */
.messages-container {
  margin-bottom: 30px;
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Стили для пустого состояния */
.no-reviews {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.no-reviews p {
  font-size: 18px;
  color: #666;
  margin: 0;
}

/* Стили для неактивных кнопок навигации */
.nav-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #ccc;
  color: #ccc;
}

.nav-button.disabled:hover {
  background: transparent;
  color: #ccc;
  transform: none;
  box-shadow: none;
}

/* Улучшаем внешний вид активных кнопок */
.nav-button {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 2px solid #0090ff;
  background: transparent;
  color: #0090ff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.nav-button:hover:not(.disabled) {
  background: #0090ff;
  color: white;
  transform: scale(1.1);
}

/* Адаптивность */
@media (max-width: 768px) {
  .maps-buttons-container {
      gap: 15px;
  }

  .page-header {
    padding: 60px 20px;
  }
  
  .page-title {
    font-size: 32px;
  }
  
  .reviews-main {
    padding: 60px 20px;
  }
  
  .reviews-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .review-card {
    padding: 30px;
    height: 400px;
    max-width: 100%;
  }
  
  .review-content p {
    -webkit-line-clamp: 6;
    max-height: 144px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .add-review-section {
    padding: 60px 20px;
  }
  
  .reviews-stats {
    padding: 60px 20px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .stat-number {
    font-size: 36px;
  }
  
  .review-modal-content {
    padding: 30px 20px;
    margin: 10px;
  }
}

@media (max-width: 480px) {
  .maps-buttons-container {
      flex-direction: column;
      gap: 12px;
      width: 100%;
      max-width: 280px;
      margin-left: auto;
      margin-right: auto;
  }

  .page-header {
    padding: 40px 15px;
  }
  
  .page-title {
    font-size: 28px;
  }
  
  .reviews-main {
    padding: 40px 15px;
  }
  
  .review-card {
    padding: 30px;
    height: 400px;
    max-width: 100%; /* На мобильных занимает всю ширину */
  }
  
  .review-content p {
    -webkit-line-clamp: 6;
    max-height: 144px;
  }
  
  .add-review-section {
    padding: 40px 15px;
  }
  
  .reviews-stats {
    padding: 40px 15px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .stat-item {
    padding: 30px 20px;
  }
  
  .review-modal-content {
    padding: 30px;
  }
  
  /* Принудительно сохраняем десктопный вид на мобильных */
  .review-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  
  .review-rating {
    margin-left: 65px; /* Выравнивание с текстом (50px аватар + 15px gap) */
    margin-top: -10px; /* Поднимаем немного ближе к верхнему блоку */
  }

  .reviewer-info {
    flex-direction: row;
    text-align: left;
    gap: 15px;
  }
  
  .reviewer-details h3 {
    max-width: 150px;
  }
  
  .review-modal-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .review-modal-rating {
    margin-left: 65px;
    margin-top: -10px;
  }
    
}

/* Адаптивность для кнопки Яндекс Карт */
@media (max-width: 768px) {
  .yandex-reviews-button,
  .gis-reviews-button {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .yandex-icon {
    width: 18px;
    height: 18px;
    font-size: 12px;
  }

  .gis-icon {
    height: 18px;
    font-size: 12px;
  }  
}

@media (max-width: 480px) {
  .yandex-reviews-button,
  .gis-reviews-button {
    width: 100%;
    justify-content: center;
    margin-top: 15px;
  }
}

/* Адаптивность для пагинации */
@media (max-width: 480px) {
  .reviews-navigation {
    gap: 15px;
  }
  
  .nav-button {
    width: 45px;
    height: 45px;
  }
  
  .pagination {
    font-size: 14px;
  }
}

/* Адаптивность для кнопки "Читать полностью" */
@media (max-width: 768px) {
  .read-more-button {
    font-size: 13px;
    margin-top: 6px;
    margin-bottom: 12px;
  }
}

@media (max-width: 480px) {
  .read-more-button {
    font-size: 12px;
    margin-top: 5px;
    margin-bottom: 10px;
    width: auto;
  }
}
/* Пагинация в стиле галереи работ */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    gap: 10px;
}

.pagination-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border: 2px solid #0090ff;
    border-radius: 8px;
    color: #0090ff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pagination-item:hover,
.pagination-item.active {
    background: #0090ff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 144, 255, 0.3);
}

.pagination-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #666;
    color: #666;
}

.pagination-item.disabled:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

/* Удаляем старые стили пагинации */
.reviews-navigation,
.nav-button,
.pagination .current-page {
    display: none;
}

/* Адаптивность пагинации */
@media (max-width: 768px) {
    .pagination {
        margin-top: 30px;
        padding: 0 15px;
        flex-wrap: wrap;
    }
    
    .pagination-item {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 8px;
    }
    
    .pagination-item {
        min-width: 30px;
        height: 30px;
        font-size: 12px;
        padding: 0 8px;
    }
}
