/* Общие стили для страниц */

.page-hero {
  background: var(--gradient-hero);
  color: var(--text-light);
  padding: var(--spacing-3xl) 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><path d="M0,300 Q300,200 600,300 T1200,300 L1200,600 L0,600 Z" fill="rgba(255,255,255,0.1)"/></svg>');
  opacity: 0.3;
  z-index: 0;
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-hero h1 {
  color: var(--text-light);
  margin-bottom: var(--spacing-md);
}

.page-hero p {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--font-size-lg);
  max-width: 700px;
  margin: 0 auto;
}

/* Таймлайн */
.timeline {
  position: relative;
  padding: var(--spacing-xl) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-primary);
}

.timeline-item {
  position: relative;
  padding-left: 80px;
  margin-bottom: var(--spacing-2xl);
}

.timeline-dot {
  position: absolute;
  left: 20px;
  top: 0;
  width: 20px;
  height: 20px;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  border: 4px solid var(--bg-primary);
  box-shadow: var(--shadow-md);
}

.timeline-content {
  background: var(--bg-primary);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.timeline-content h3 {
  margin-bottom: var(--spacing-sm);
}

/* Прогресс-бары */
.progress-bar-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  margin-bottom: var(--spacing-md);
}

.progress-bar {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* Аккордеон */
.accordion-item {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.accordion-header {
  padding: var(--spacing-lg);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition-fast);
}

.accordion-header:hover {
  background: var(--bg-secondary);
}

.accordion-header h3 {
  margin: 0;
  font-size: var(--font-size-lg);
}

.accordion-icon {
  transition: transform var(--transition-base);
}

.accordion-item.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.accordion-item.active .accordion-content {
  max-height: 1000px;
}

.accordion-body {
  padding: 0 var(--spacing-lg) var(--spacing-lg);
  color: var(--text-secondary);
}

/* Модальные окна */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-lg);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

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

.modal {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-2xl);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  position: relative;
  transform: scale(0.9);
  transition: transform var(--transition-base);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: none;
  border: none;
  font-size: var(--font-size-2xl);
  cursor: pointer;
  color: var(--text-secondary);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.modal-header {
  margin-bottom: var(--spacing-lg);
  padding-right: var(--spacing-3xl);
}

.modal-header h2 {
  margin-bottom: var(--spacing-sm);
}

.modal-body {
  color: var(--text-secondary);
}

.modal-body img {
  width: 100%;
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
}

/* Галерея изображений */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: pointer;
  aspect-ratio: 4/3;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  display: flex;
  align-items: flex-end;
  padding: var(--spacing-md);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

.gallery-title {
  color: var(--text-light);
  font-weight: var(--font-weight-semibold);
}

/* Сравнение изображений */
.comparison-slider {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.comparison-container {
  position: relative;
  width: 100%;
  padding-bottom: 75%;
  overflow: hidden;
}

.comparison-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.comparison-after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comparison-before-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  overflow: hidden;
  z-index: 2;
}

.comparison-before-container img {
  height: 100%;
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  /* Width is set by JavaScript to match comparison-container width (800px) */
  /* Cannot use CSS width: 100% because that would be 100% of before-container, not comparison-container */
  /* The beforeContainer's overflow: hidden will crop it based on slider position */
}

.comparison-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--text-light);
  z-index: 3;
  left: 50%;
  transform: translateX(-50%);
  cursor: grab;
}

.comparison-handle::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: var(--text-light);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
}

.comparison-handle:active {
  cursor: grabbing;
}

.comparison-label {
  position: absolute;
  top: var(--spacing-md);
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(0, 0, 0, 0.7);
  color: var(--text-light);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

.comparison-label-before {
  left: var(--spacing-md);
}

.comparison-label-after {
  right: var(--spacing-md);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

@media (max-width: 768px) {
  .timeline::before {
    left: 15px;
  }
  
  .timeline-item {
    padding-left: 50px;
  }
  
  .timeline-dot {
    left: 5px;
    width: 20px;
    height: 20px;
  }
  
  .image-gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}
