/* ============================================================
   🤖 ai.css - СТИЛИ СТРАНИЦЫ "AI-ТВОРЧЕСТВО"
   ============================================================ */

/* ============================================================ */
/*  📌 ЗАГОЛОВОК СТРАНИЦЫ                                       */
/* ============================================================ */

.ai-section-header {
  text-align: center;
  padding: 2.5rem 2rem;
  margin-bottom: 2.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: 2rem;
  box-shadow: var(--shadow);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

/* Градиентная линия сверху */
.ai-section-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-main), transparent);
  opacity: 0.5;
  z-index: 1;
  transition: opacity 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-section-header:hover::before { opacity: 1; }

/* Микро-блик */
.ai-section-header::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    ellipse at 20% 20%,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.02) 30%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  transition: opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-section-header:hover::after { opacity: 1; }

/* Иконка заголовка */
.ai-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  color: var(--accent-main);
  stroke: var(--accent-main);
  position: relative;
  z-index: 1;
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-header-icon svg {
  width: 64px;
  height: 64px;
  stroke: var(--accent-main);
  filter: drop-shadow(0 0 20px rgba(var(--accent-rgb), 0.15));
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-section-header:hover .ai-header-icon svg {
  transform: scale(1.08) rotate(-5deg);
  filter: drop-shadow(0 0 40px rgba(var(--accent-rgb), 0.35));
}

.ai-header-icon svg circle[fill="currentColor"] {
  fill: var(--accent-main);
  transition: fill 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.ai-section-header:hover .ai-header-icon svg circle[fill="currentColor"] {
  fill: var(--accent-light);
}

/* Заголовок H1 */
.ai-title {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-main));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* Подзаголовок */
.ai-subtitle {
  color: var(--text-secondary);
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  margin-top: 0.3rem;
  position: relative;
  z-index: 1;
}

/* Описание */
.ai-description {
  color: var(--text-secondary);
  font-size: clamp(0.85rem, 1.6vw, 1rem);
  margin-top: 0.8rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  opacity: 0.8;
  position: relative;
  z-index: 1;
}

/* ============================================================ */
/*  📌 ЗАГОЛОВКИ БЛОКОВ (H2)                                   */
/* ============================================================ */

.ai-block-title {
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.ai-block-title i { color: var(--accent-main); }

.ai-block-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.2rem;
}

/* ============================================================ */
/*  🎠 AI СЛАЙДЕР                                               */
/* ============================================================ */

.ai-slider-container {
  position: relative;
  margin: 1rem 0 2.5rem;
  border-radius: 2rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--card-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-slider-container:hover {
  border-color: var(--accent-border-hover);
  box-shadow: var(--shadow-hover);
}

.ai-slider {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.ai-item {
  display: none;
  position: relative;
  width: 100%;
  animation: fade 1.2s ease;
  background: var(--bg-body);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-item:first-child { display: flex; }

.ai-item img {
  width: 100%;
  height: auto;
  max-height: 600px;
  min-height: 250px;
  display: block;
  object-fit: contain;
  background: var(--bg-body);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 0.5rem;
}

/* Подпись под слайдом */
.ai-slide-caption {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0.4rem 1.2rem;
  border-radius: 40px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  z-index: 5;
  max-width: 90%;
}

.caption-badge {
  background: var(--accent-main);
  color: #fff;
  padding: 0.1rem 0.6rem;
  border-radius: 40px;
  font-size: 0.7rem;
  font-weight: 600;
}

.caption-text {
  color: #fff;
  font-size: 0.85rem;
}

/* Кнопки навигации */
.ai-slider .prev,
.ai-slider .next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 16px;
  color: #fff;
  font-weight: bold;
  font-size: 24px;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 10;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
}

.ai-slider-container:hover .prev,
.ai-slider-container:hover .next { opacity: 0.9; }

.ai-slider .next { right: 20px; }
.ai-slider .prev { left: 20px; }

.ai-slider .prev:hover,
.ai-slider .next:hover {
  background: rgba(var(--accent-rgb), 0.5);
  transform: translateY(-50%) scale(1.1);
  border-color: var(--accent-main);
  opacity: 1;
}

/* Точки навигации */
.ai-slider-dots {
  text-align: center;
  padding: 14px 0;
  background: var(--glass-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border-top: 1px solid var(--glass-border);
}

.ai-dot {
  cursor: pointer;
  height: 10px;
  width: 10px;
  margin: 0 6px;
  background-color: var(--text-secondary);
  border-radius: 50%;
  display: inline-block;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  opacity: 0.4;
}

.ai-dot.active,
.ai-dot:hover {
  background-color: var(--accent-main);
  transform: scale(1.3);
  box-shadow: 0 0 20px rgba(var(--accent-rgb), 0.3);
  opacity: 1;
}

/* Анимация появления слайда */
@keyframes fade {
  from { opacity: 0.5; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================================================ */
/*  🎬 AI ВИДЕО                                                */
/* ============================================================ */

.ai-video-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 1rem 0 2.5rem;
}

.ai-video-card {
  background: var(--card-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  padding: 1.2rem;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  max-width: 900px;
  width: 100%;
}

.ai-video-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-main), transparent);
  opacity: 0.5;
  z-index: 1;
}

.ai-video-card:hover {
  background: var(--glass-bg);
  border-color: var(--accent-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.ai-video-card video {
  width: 100%;
  border-radius: 1rem;
  display: block;
  background: #000;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.ai-video-card .video-caption {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}
.ai-video-card .video-caption strong { color: var(--text-primary); }

/* ============================================================ */
/*  🎵 AI АУДИО                                                */
/* ============================================================ */

.ai-audio-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin: 1rem 0 2.5rem;
}

.ai-audio-card {
  background: var(--card-bg);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  border: 1px solid var(--glass-border);
  border-radius: 1.5rem;
  padding: 1.5rem;
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  max-width: 900px;
  width: 100%;
}

.ai-audio-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-main), transparent);
  opacity: 0.5;
  z-index: 1;
}

.ai-audio-card:hover {
  background: var(--glass-bg);
  border-color: var(--accent-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

/* Шапка аудио */
.ai-audio-card .audio-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}

.ai-audio-card .audio-header .audio-icon {
  font-size: 2rem;
  color: var(--accent-main);
  flex-shrink: 0;
}

.ai-audio-card .audio-header .audio-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.ai-audio-card .audio-header .audio-title small {
  font-weight: 400;
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: block;
}

/* Визуализатор */
.ai-audio-card .visualizer-wrap {
  width: 100%;
  height: 80px;
  background: var(--glass-bg);
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--glass-border);
  margin-bottom: 0.8rem;
}

.ai-audio-card .visualizer-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Управление */
.ai-audio-card .audio-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.ai-audio-card .audio-controls .play-btn {
  background: var(--accent-btn);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px var(--accent-shadow);
  flex-shrink: 0;
}

.ai-audio-card .audio-controls .play-btn:hover {
  background: var(--accent-btn-hover);
  transform: scale(1.05);
  box-shadow: 0 8px 30px var(--accent-shadow-hover);
}

.ai-audio-card .audio-controls .progress-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 100px;
}

.ai-audio-card .audio-controls .progress-wrap .time {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}

.ai-audio-card .audio-controls .progress-wrap .progress-bar {
  flex: 1;
  height: 4px;
  background: var(--glass-border);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  transition: height 0.2s;
}

.ai-audio-card .audio-controls .progress-wrap .progress-bar:hover { height: 6px; }

.ai-audio-card .audio-controls .progress-wrap .progress-bar .progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-main);
  border-radius: 4px;
  transition: width 0.1s linear;
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.3);
}

.ai-audio-card .audio-caption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
}

/* ============================================================ */
/*  📌 ПРИЗЫВ К ДЕЙСТВИЮ (CTA)                                  */
/* ============================================================ */

.ai-cta {
  text-align: center;
  margin: 2rem 0 1rem;
  padding: 1.5rem;
  border-radius: 1.5rem;
  background: var(--accent-glass);
  border: 1px solid var(--accent-border);
  transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.ai-cta:hover {
  border-color: var(--accent-border-hover);
  background: var(--accent-glass-hover);
  transform: translateY(-3px);
}

.ai-cta .cta-text {
  font-size: clamp(1rem, 2vw, 1.3rem);
  font-weight: 500;
  color: var(--text-primary);
}

/* Кнопки внутри CTA */
.ai-cta .cta-phone {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 1.5rem;
  border-radius: 40px;
  background: var(--accent-btn);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 4px 20px var(--accent-shadow);
}

.ai-cta .cta-phone:hover {
  background: var(--accent-btn-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 35px var(--accent-shadow-hover);
}

.ai-cta .cta-telegram {
  background: linear-gradient(135deg, #2aabee, #1c8bcb) !important;
  box-shadow: 0 4px 20px rgba(42, 171, 238, 0.3) !important;
}

.ai-cta .cta-telegram:hover {
  background: linear-gradient(135deg, #3bb8f5, #2299d9) !important;
  box-shadow: 0 8px 35px rgba(42, 171, 238, 0.4) !important;
}

/* ============================================================ */
/*  📱 АДАПТИВ                                                  */
/* ============================================================ */

/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) {
  .ai-video-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  .ai-audio-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

@media (max-width: 768px) {
  .ai-section-header {
    padding: 2rem 1.5rem;
    border-radius: 1.75rem;
    margin-bottom: 2rem;
  }
  .ai-header-icon svg { width: 54px; height: 54px; }
  .ai-title { font-size: clamp(1.4rem, 3.5vw, 2rem); }
  .ai-subtitle { font-size: clamp(0.9rem, 1.8vw, 1.05rem); }
  .ai-description { font-size: clamp(0.8rem, 1.4vw, 0.95rem); max-width: 90%; }
  
  .ai-video-card,
  .ai-audio-card { max-width: 100%; padding: 0.8rem; }
  .ai-video-card video { aspect-ratio: 16 / 9; }
  .ai-audio-card .audio-header .audio-title { font-size: 1rem; }
  .ai-audio-card .audio-header .audio-title small { font-size: 0.75rem; }
  .ai-audio-card .visualizer-wrap { height: 60px; }
  .ai-audio-card .audio-controls .play-btn { width: 38px; height: 38px; font-size: 0.9rem; }
  .ai-audio-card .audio-controls .progress-wrap { min-width: 60px; }
}

/* Мобильные устройства (до 640px) */
@media (max-width: 640px) {
  .ai-section-header {
    padding: 1.5rem 1rem;
    border-radius: 1.5rem;
    margin-bottom: 1.5rem;
  }
  .ai-header-icon { margin-bottom: 0.6rem; }
  .ai-header-icon svg { width: 44px; height: 44px; }
  .ai-title { font-size: clamp(1.2rem, 3.2vw, 1.6rem); }
  .ai-subtitle { font-size: clamp(0.8rem, 2vw, 0.95rem); margin-top: 0.2rem; }
  .ai-description {
    font-size: clamp(0.75rem, 1.6vw, 0.85rem);
    margin-top: 0.6rem;
    max-width: 100%;
    line-height: 1.5;
  }

  .ai-slider-container .ai-slider .ai-item img { height: 250px; }
  .ai-slider-container .ai-slider .prev,
  .ai-slider-container .ai-slider .next {
    width: 36px;
    height: 36px;
    font-size: 16px;
    padding: 8px;
  }
  .ai-slide-caption {
    padding: 0.4rem 1rem;
    bottom: 16px;
    flex-wrap: wrap;
    white-space: normal;
    justify-content: center;
  }
  .caption-text {
    font-size: 0.7rem;
    display: block;
    text-align: center;
  }

  .ai-video-card,
  .ai-audio-card { padding: 0.8rem; }
  .ai-video-card video { aspect-ratio: 16 / 9; }
  .ai-audio-card .audio-header .audio-title { font-size: 1rem; }
  .ai-audio-card .audio-header .audio-title small { font-size: 0.75rem; }
  .ai-audio-card .visualizer-wrap { height: 60px; }
  .ai-audio-card .audio-controls .play-btn { width: 38px; height: 38px; font-size: 0.9rem; }
  .ai-audio-card .audio-controls .progress-wrap { min-width: 60px; }
}

/* Маленькие смартфоны (до 480px) */
@media (max-width: 480px) {
  .ai-section-header {
    padding: 1.2rem 0.8rem;
    border-radius: 1.25rem;
    margin-bottom: 1.2rem;
  }
  .ai-header-icon svg { width: 38px; height: 38px; }
  .ai-title { font-size: clamp(1rem, 2.8vw, 1.3rem); }
  .ai-subtitle { font-size: clamp(0.7rem, 1.8vw, 0.85rem); }
  .ai-description {
    font-size: clamp(0.7rem, 1.4vw, 0.8rem);
    margin-top: 0.4rem;
    line-height: 1.4;
  }

  .ai-slider-container .ai-slider .ai-item img { height: 200px; }
  .ai-video-grid,
  .ai-audio-grid { grid-template-columns: 1fr; }
  .ai-audio-card .visualizer-wrap { height: 50px; }
  .ai-video-card .video-caption { font-size: 0.8rem; }
  .ai-audio-card .audio-caption { font-size: 0.75rem; }
  .ai-slide-caption {
    background: rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    padding: 0.2rem 0.8rem;
    bottom: 10px;
  }
}

/* Очень маленькие экраны (до 360px) */
@media (max-width: 360px) {
  .ai-section-header {
    padding: 1rem 0.6rem;
    border-radius: 1rem;
  }
  .ai-header-icon svg { width: 32px; height: 32px; }
  .ai-title { font-size: 0.95rem; }
  .ai-subtitle { font-size: 0.7rem; }
  .ai-description { font-size: 0.65rem; }
  .ai-item img { height: 160px; }
}