/* === public_html/css/styles.css === */

/* 1. Объявляем переменные цветов и анимации */
:root {
  --color-success:       #28a745;
  --color-success-dark:  #218838;
  --color-error:         #dc3545;
  --transition-fast:     0.2s;
}

/* 2. Глобальные контейнеры */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* 3. Header */
header {
  background-color: #f8f9fa;
  padding: 24px 0;
}
header .container {
  text-align: center;
}
header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: #333;
}
header p {
  font-size: 1.125rem;
  color: #555;
}

/* 4. Навигация */
nav {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
nav .container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 12px 0;
}
nav ul {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
nav ul li a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  font-weight: 500;
  color: #333;
  border-radius: 4px;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}
/* hover и активная ссылка */
nav ul li a:hover,
nav ul li a.active {
  background-color: var(--color-success);
  color: #fff;
}

/* 5. Основной контент */
main {
  padding: 48px 0;
}
main h2 {
  font-size: 1.75rem;
  margin-bottom: 16px;
  text-align: center;
  color: #333;
}
main p {
  font-size: 1rem;
  color: #444;
  text-align: center;
  margin-bottom: 32px;
}

/* 6. Блок преимуществ (timesheet) */
#benefits .benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px,1fr));
  gap: 24px;
  margin-top: 24px;
}
.benefit-item {
  background-color: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: box-shadow var(--transition-fast);
}
.benefit-item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.08);
}
.benefit-item .placeholder {
  width: 48px;
  height: 48px;
  background-color: #e9ecef;
  border-radius: 50%;
  margin: 0 auto 12px;
}

/* 7. Таблица версий и цен */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}
thead th {
  background-color: #f1f1f1;
  padding: 12px;
  font-weight: 600;
  text-align: center;
  color: #333;
}
tbody td {
  padding: 12px;
  text-align: center;
  border-top: 1px solid #e2e2e2;
  color: #444;
}
tbody tr:hover {
  background-color: #fbfbfb;
}

/* 8. Кнопки */
button, .btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background-color: var(--color-success);
  color: #fff;
  transition: background-color var(--transition-fast);
}
button:hover, .btn:hover {
  background-color: var(--color-success-dark);
}

/* 9. Footer */
footer {
  background-color: #f8f9fa;
  padding: 24px 0;
  margin-top: 48px;
}
footer .container {
  text-align: center;
}
footer .footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
}
footer .footer-links li a {
  text-decoration: none;
  color: var(--color-success);
  font-weight: 500;
}
footer p {
  font-size: 0.875rem;
  color: #777;
}

/* ========================================================= */
/* === ДОБАВЛЕННЫЕ СТИЛИ ДЛЯ ИНТЕГРАЦИИ С HTML-РАЗМЕТКОЙ  === */
/* ========================================================= */

/* Общие секции */
section {
  padding: 48px 0;
}
.section-title {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 24px;
  color: #333;
}

/* HERO */
#hero {
  background-color: #fafafa;
}
#hero .hero-content {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 32px;
  padding: 24px 0;
}
#hero .hero-text {
  flex: 1 1 400px;
}
#hero .hero-text h1 {
  font-size: 3rem;
  margin-bottom: 16px;
  color: #1c1c1c;
}
#hero .hero-text p {
  font-size: 1.25rem;
  margin-bottom: 24px;
  color: #555;
}
#hero .hero-text .btn-primary {
  margin-right: 16px;
}
#hero .hero-text .btn-secondary {
  background-color: transparent;
  color: #333;
  border: 2px solid #333;
}
#hero .hero-text .btn-secondary:hover {
  background-color: #333;
  color: #fff;
}
#hero .hero-image {
  flex: 1 1 400px;
  text-align: center;
}
#hero .hero-image img {
  max-width: 100%;
  height: auto;
}

/* ПРЕИМУЩЕСТВА */
#advantages {
  background-color: #fff;
}
#advantages .advantages-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
}
.advantage-card {
  background-color: #f7f7f7;
  border-radius: 8px;
  padding: 24px;
  flex: 1 1 260px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  transition: box-shadow var(--transition-fast);
}
.advantage-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.advantage-card svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
}
.advantage-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
  color: #1c1c1c;
}
.advantage-card p {
  font-size: 1rem;
  color: #555;
}

/* ОТЗЫВЫ */
#reviews {
  background-color: #fafafa;
}
#reviews .reviews-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.review-card {
  display: flex;
  gap: 16px;
  background-color: #fff;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.review-card .avatar {
  flex-shrink: 0;
}
.review-card .avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}
.review-card .content {
  flex: 1;
}
.review-card .content h4 {
  margin-bottom: 8px;
  font-size: 1.125rem;
  color: #1c1c1c;
}
.review-card .content p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 8px;
}
.review-card .content .date {
  font-size: 0.875rem;
  color: #777;
}

/* КАТАЛОГ */
#catalog {
  background-color: #fff;
}
#catalog .catalog-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
}
#catalog .filters {
  flex: 0 1 240px;
  background-color: #f7f7f7;
  padding: 24px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
#catalog .filters h3 {
  margin-bottom: 16px;
  font-size: 1.25rem;
  color: #1c1c1c;
}
.filter-item {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1rem;
  color: #333;
}
.filter-item input[type="checkbox"] {
  margin-right: 8px;
}
#catalog .filters .btn-secondary {
  margin-top: 16px;
  width: 100%;
}

/* Сетка карточек */
#catalog .cards {
  flex: 1 1 calc(100% - 280px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px,1fr));
  gap: 24px;
}
.card {
  background-color: #fafafa;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition-fast);
}
.card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.card-image img {
  width: 100%;
  height: auto;
  display: block;
}
.card-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-content h3 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: #1c1c1c;
}
.card-content p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 12px;
}
.card-content .price {
  font-size: 1rem;
  font-weight: 600;
  color: #28a745;
  margin-bottom: 16px;
}
.card-actions {
  margin-top: auto;
  display: flex;
  gap: 8px;
}
.card-actions .btn-primary {
  flex: 1;
}
.card-actions .btn-secondary {
  flex: 1;
  background-color: transparent;
  color: #333;
  border: 2px solid #333;
}
.card-actions .btn-secondary:hover {
  background-color: #333;
  color: #fff;
}

/* Сообщение «Шаблонов не найдено» */
.no-templates {
  font-size: 1rem;
  color: #777;
  text-align: center;
  grid-column: 1 / -1;
}

/* Адаптив */
@media (max-width: 992px) {
  #hero .hero-content {
    flex-direction: column;
    text-align: center;
  }
  #hero .hero-text, #hero .hero-image {
    flex: 1 1 100%;
  }
  #catalog .catalog-wrapper {
    flex-direction: column;
  }
  #catalog .cards {
    flex: 1 1 100%;
    grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  }
  #catalog .filters {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .advantage-card {
    flex: 1 1 100%;
  }
  #catalog .cards {
    grid-template-columns: 1fr;
  }
}

.chat-form textarea {
  width: 100%;
  resize: vertical;
  margin-bottom: 12px;
}

.btn-accent {
  background-color: #1ab27f;
  color: white;
}

.chat-history {
  margin-top: 24px;
}

.message {
  max-width: 80%;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.message-self {
  background: #f0f0f0;
  align-self: flex-end;
}

.message-admin {
  background: #ffffff;
  border: 1px solid #e0e0e0;
}

.message-label {
  font-weight: bold;
  margin-right: 8px;
}

.message-time {
  display: block;
  font-size: 0.75rem;
  color: #888;
  margin-top: 4px;
}