/* Основные стили и анимации */

* {
  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 на agustudio.site) */
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;
  }
}

/* Юридические страницы и футер */
.policy-page-body {
  background: linear-gradient(to bottom right, #faf5ff, #ffffff, #eff6ff);
  min-height: 100vh;
}

.policy-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 40;
}

.policy-content {
  background: #fff;
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  line-height: 1.7;
  color: #374151;
}

.policy-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.policy-edition {
  color: #6b7280;
  margin-bottom: 1.5rem;
}

.policy-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #4c1d95;
  margin: 1.5rem 0 0.75rem;
}

.policy-content p {
  margin-bottom: 0.75rem;
}

.policy-content ul {
  margin: 0.5rem 0 1rem 1.25rem;
  list-style: disc;
}

.policy-content li {
  margin-bottom: 0.35rem;
}

.policy-content a {
  color: #7c3aed;
  text-decoration: underline;
}

.footer-legal a {
  text-decoration: none;
}

.company-info a {
  text-decoration: none;
}

.cookie-banner {
  position: fixed;
  inset: auto 1rem 1rem 1rem;
  z-index: 9999;
  max-width: 56rem;
  margin: 0 auto;
  left: 0;
  right: 0;
}

.cookie-banner.hidden {
  display: none !important;
}

.cookie-banner-inner {
  background: rgba(17, 24, 39, 0.95);
  color: #fff;
  border-radius: 1rem;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .cookie-banner-inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.cookie-banner-text {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}

.cookie-banner-text a {
  color: #c4b5fd;
  text-decoration: underline;
}

.cookie-banner-buttons {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.cookie-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}

.cookie-btn:hover {
  opacity: 0.9;
}

.cookie-btn-accept {
  background: linear-gradient(to right, #9333ea, #2563eb);
  color: #fff;
}

.cookie-btn-reject {
  background: transparent;
  color: #d1d5db;
  border: 1px solid #6b7280;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: #4b5563;
  line-height: 1.5;
  margin: 1rem 0;
  cursor: pointer;
}

.consent-label input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  accent-color: #7c3aed;
}

.consent-label a {
  color: #7c3aed;
  text-decoration: underline;
}

.consent-error {
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: -0.5rem;
  margin-bottom: 0.5rem;
  display: none;
}

.consent-error.visible {
  display: block;
}

/* Карточки услуг 4–6: orange / teal / violet (нет в локальной сборке Tailwind на хосте) */
.border-orange-100 { border-color: #ffedd5; }
.border-teal-100 { border-color: #ccfbf1; }
.border-violet-100 { border-color: #ede9fe; }
.text-orange-600 { color: #ea580c; }
.text-teal-600 { color: #0d9488; }
.text-violet-600 { color: #7c3aed; }
.bg-gradient-to-br.from-orange-50.to-white { background-image: linear-gradient(to bottom right, #fff7ed, #ffffff); }
.bg-gradient-to-br.from-teal-50.to-white { background-image: linear-gradient(to bottom right, #f0fdfa, #ffffff); }
.bg-gradient-to-br.from-violet-50.to-white { background-image: linear-gradient(to bottom right, #f5f3ff, #ffffff); }
.bg-gradient-to-br.from-orange-600.to-orange-400 { background-image: linear-gradient(to bottom right, #ea580c, #fb923c); }
.bg-gradient-to-br.from-teal-600.to-teal-400 { background-image: linear-gradient(to bottom right, #0d9488, #2dd4bf); }
.bg-gradient-to-br.from-violet-600.to-violet-400 { background-image: linear-gradient(to bottom right, #7c3aed, #a78bfa); }
