/* Основные стили и анимации */

* {
  scroll-behavior: smooth;
}

/* Loading indicator */
.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.loaded {
  opacity: 0;
  visibility: hidden;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Анимация появления */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 1s ease-out;
}

/* Плавная анимация для пульсации */
@keyframes pulse {
  0%, 100% {
    opacity: 0.2;
  }
  50% {
    opacity: 0.3;
  }
}

.animate-pulse {
  animation: pulse 3s ease-in-out infinite;
}

/* Градиентный текст */
.bg-clip-text {
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Плавные переходы для ссылок */
a {
  transition: all 0.3s ease;
}

/* Эффект подъёма для карточек */
.hover\:scale-105:hover {
  transform: scale(1.05);
}

/* Backdrop blur для навигации */
.backdrop-blur-md {
  backdrop-filter: blur(12px);
}

/* Отступы между пунктами меню (fallback для space-x-6) */
nav .space-x-6 > *:not(:first-child) {
  margin-left: 1.5rem;
}

/* Кастомные стили для секций */
section {
  position: relative;
}

/* Адаптивность */
@media (max-width: 768px) {
  .text-5xl {
    font-size: 2.5rem;
  }
  
  .text-6xl {
    font-size: 3rem;
  }
}

/* Плавная прокрутка */
html {
  scroll-padding-top: 80px;
}

/* Анимация для мобильного меню */
#mobile-menu {
  transition: all 0.3s ease;
}

#mobile-menu.show {
  display: block;
  animation: fadeIn 0.3s ease-out;
}

/* Стили для скролла */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #9333ea, #3b82f6);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #7c3aed, #2563eb);
}

/* Эффект свечения для кнопок */
button:hover,
a[href="#contacts"]:hover {
  box-shadow: 0 10px 30px rgba(147, 51, 234, 0.3);
}

/* Анимация для иконок при наведении */
.group:hover i {
  animation: bounce 0.5s ease;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Эффект градиента для героической секции */
.hero-gradient {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Отзывчивые изображения */
img {
  max-width: 100%;
  height: auto;
}

/* Стили для форм (если будут добавлены) */
input,
textarea {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #9333ea;
  box-shadow: 0 0 0 3px rgba(147, 51, 234, 0.1);
}

/* Улучшенная читаемость */
html {
  height: 100%;
  background: linear-gradient(to bottom right, #faf5ff, #ffffff, #eff6ff);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: linear-gradient(to bottom right, #faf5ff, #ffffff, #eff6ff);
}

/* Анимация для карточек услуг */
.service-card {
  transition: all 0.3s ease;
}

.service-card:hover {
  transform: translateY(-10px);
}

/* Эффект для навигации при скролле */
nav {
  transition: all 0.3s ease;
}

/* Стили для loading состояния (на будущее) */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Анимация загрузки */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Эффект параллакса для фоновых элементов */
.parallax {
  transition: transform 0.3s ease-out;
}

/* Стили для модального окна портфолио */
#portfolio-modal {
  backdrop-filter: blur(8px);
  animation: fadeIn 0.3s ease-out;
}

#portfolio-modal img,
#portfolio-modal video {
  animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Улучшенные стили для карточек портфолио */
.portfolio-item {
  transition: all 0.3s ease;
}

.portfolio-item:hover {
  transform: translateY(-8px);
}

.portfolio-item img {
  transition: transform 0.5s ease;
}

/* Стили для кнопки закрытия модального окна */
#modal-close {
  transition: all 0.2s ease;
}

#modal-close:hover {
  background-color: rgba(255, 255, 255, 0.2) !important;
  transform: rotate(90deg);
}

/* Адаптивность модального окна */
@media (max-width: 768px) {
  #portfolio-modal {
    padding: 1rem;
  }
  
  #modal-close {
    top: 1rem;
    right: 1rem;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.5rem;
  }
  
  #modal-link {
    bottom: 1rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  /* Исправление белого фона после футера на мобильных */
  body {
    background: linear-gradient(to bottom right, #faf5ff, #ffffff, #eff6ff) !important;
    background-attachment: fixed;
  }
  
  html {
    background: linear-gradient(to bottom right, #faf5ff, #ffffff, #eff6ff) !important;
    background-attachment: fixed;
  }
  
  /* КРИТИЧЕСКОЕ ИСПРАВЛЕНИЕ: Убираем все пустые блоки после футера на мобильных */
  
  /* Основной контейнер - обрезаем все после футера */
  body > div.min-h-screen {
    position: relative;
    overflow: hidden;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  
  /* Футер - последний видимый элемент */
  footer {
    margin-bottom: 0 !important;
    padding-bottom: 2rem !important;
    position: relative;
    z-index: 10;
  }
  
  /* Скрываем ВСЕ что идет после футера */
  body > div.min-h-screen > footer ~ * {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
    font-size: 0 !important;
    opacity: 0 !important;
  }
  
  /* Скрываем скрипты после футера */
  footer ~ script {
    display: none !important;
  }
  
  /* Убираем min-height чтобы контейнер не растягивался */
  body > div.min-h-screen {
    min-height: auto !important;
    height: auto !important;
  }
  
  /* Обрезаем контент после футера через overflow */
  body > div.min-h-screen::after {
    content: '';
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: transparent;
    overflow: hidden;
  }
  
  /* Сокращаем пространство в героической секции на мобильных */
  section:first-of-type {
    padding-top: 6rem !important;
    padding-bottom: 2.5rem !important;
  }
  
  /* Скрываем правый блок с баннером на мобильных */
  section:first-of-type > div > div > div.relative {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Убираем большой gap между колонками */
  section:first-of-type .grid {
    gap: 0 !important;
  }
  
  /* Уменьшаем отступы в левом блоке */
  section:first-of-type .space-y-6 {
    gap: 0.75rem !important;
  }
  
  /* Уменьшаем размер заголовка, но оставляем больше чем "Наши услуги" (2.25rem) */
  section:first-of-type h1 {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 0.75rem !important;
  }
  
  /* Уменьшаем размер текста */
  section:first-of-type p {
    font-size: 0.95rem !important;
    margin-bottom: 0.75rem !important;
    line-height: 1.4 !important;
  }
  
  /* Уменьшаем кнопки */
  section:first-of-type .flex.flex-col {
    gap: 0.5rem !important;
    margin-top: 1rem !important;
  }
  
  section:first-of-type a {
    padding: 0.625rem 1.25rem !important;
    font-size: 0.875rem !important;
  }
  
  /* Убираем лишние отступы у контейнера */
  section:first-of-type .container {
    padding: 0 !important;
  }
  
  section:first-of-type > div > div {
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* Уменьшаем отступы у секции услуг, но оставляем небольшой отступ */
  section#services {
    padding-top: 2rem !important;
    margin-top: 0 !important;
  }
}

