/* Стили для анимации ноутбука и мобильного устройства */

.about-image {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 500px;
  perspective: 1000px;
}

/* Ноутбук стили - расположен сзади */
.about-laptop {
  position: absolute;
  width: 600px;
  max-width: 600px;
  z-index: 1;
  animation: fadeInBack 1.2s ease-out;
  transform: translateZ(-50px) scale(0.9);
}

.about-laptop svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.3));
  transition: transform 0.4s ease;
}

.about-laptop:hover svg {
  transform: scale(1.05) translateY(-8px) rotateX(2deg);
}

/* Мобильное устройство стили - расположен спереди и сбоку */
.about-mobile {
  position: absolute;
  right: -50px;
  top: 50px;
  width: 200px;
  z-index: 2;
  animation: fadeInFront 1s ease-out 0.4s both;
  transform: translateZ(50px) rotateY(-15deg) rotateX(5deg);
}

.about-mobile svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.25));
  transition: transform 0.4s ease;
}

.about-mobile:hover svg {
  transform: scale(1.08) translateY(-5px) rotateY(-10deg);
}

/* Анимация появления сзади (для ноутбука) */
@keyframes fadeInBack {
  0% {
    opacity: 0;
    transform: translateZ(-100px) scale(0.7) rotateX(-10deg);
  }
  100% {
    opacity: 1;
    transform: translateZ(-50px) scale(0.9) rotateX(0deg);
  }
}

/* Анимация появления спереди (для мобильного) */
@keyframes fadeInFront {
  0% {
    opacity: 0;
    transform: translateZ(100px) translateX(50px) rotateY(-25deg) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translateZ(50px) translateX(0px) rotateY(-15deg) scale(1);
  }
}

/* Анимация мерцания экрана ноутбука */
@keyframes screenGlow {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.1);
  }
}

.about-laptop svg rect[fill="#f7f7f7"]:first-of-type {
  animation: screenGlow 3s ease-in-out infinite;
}

/* Анимация пульсации для активных элементов */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.8;
  }
}

/* Анимация для выделенной даты в календаре */
.about-mobile svg circle[fill="#1ebeb4"] {
  animation: pulse 2s ease-in-out infinite;
}

/* Анимация для зубов с проблемами */
.about-laptop svg circle[fill="#ffcdd2"] {
  animation: pulse 2s ease-in-out infinite 0.5s;
}

/* Анимация появления контента */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Применяем анимацию к тексту и элементам */
.about-laptop svg text,
.about-mobile svg text {
  animation: fadeInUp 0.8s ease-out 1s both;
}

/* Анимация для кружков зубной формулы */
@keyframes toothAppear {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.about-laptop svg circle[stroke="#1ebeb4"] {
  animation: toothAppear 0.5s ease-out;
}

.about-laptop svg circle[stroke="#1ebeb4"]:nth-of-type(1) { animation-delay: 1.2s; }
.about-laptop svg circle[stroke="#1ebeb4"]:nth-of-type(2) { animation-delay: 1.3s; }
.about-laptop svg circle[stroke="#1ebeb4"]:nth-of-type(3) { animation-delay: 1.4s; }
.about-laptop svg circle[stroke="#1ebeb4"]:nth-of-type(4) { animation-delay: 1.5s; }
.about-laptop svg circle[stroke="#1ebeb4"]:nth-of-type(5) { animation-delay: 1.6s; }
.about-laptop svg circle[stroke="#1ebeb4"]:nth-of-type(6) { animation-delay: 1.7s; }
.about-laptop svg circle[stroke="#1ebeb4"]:nth-of-type(7) { animation-delay: 1.8s; }
.about-laptop svg circle[stroke="#1ebeb4"]:nth-of-type(8) { animation-delay: 1.9s; }

/* Анимация типирования для заголовков */
@keyframes typing {
  0% {
    width: 0;
  }
  100% {
    width: 100%;
  }
}

/* Эффект floating для ноутбука (сзади) */
@keyframes floatingBack {
  0%, 100% {
    transform: translateZ(-50px) scale(0.9) translateY(0px) rotateX(0deg);
  }
  50% {
    transform: translateZ(-50px) scale(0.9) translateY(-8px) rotateX(1deg);
  }
}

/* Эффект floating для мобильного (спереди) */
@keyframes floatingFront {
  0%, 100% {
    transform: translateZ(50px) rotateY(-15deg) rotateX(5deg) translateY(0px);
  }
  50% {
    transform: translateZ(50px) rotateY(-15deg) rotateX(5deg) translateY(-12px);
  }
}

.about-laptop {
  animation: fadeInBack 1.2s ease-out, floatingBack 8s ease-in-out infinite 2s;
}

.about-mobile {
  animation: fadeInFront 1s ease-out 0.4s both, floatingFront 6s ease-in-out infinite 2.8s;
}

/* Hover эффекты для интерактивности */
.about-laptop:hover svg circle[fill="white"] {
  fill: var(--primary-light);
  transition: fill 0.3s ease;
}

.about-mobile:hover svg circle[fill="#e9e9e9"] {
  fill: var(--primary-light);
  transition: fill 0.3s ease;
}

/* Анимация загрузки данных */
@keyframes loadingBar {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

.about-laptop svg line {
  animation: loadingBar 1.5s ease-out 2s both;
}

/* Адаптивность */
@media (max-width: 768px) {
  .about-image {
    min-height: 400px;
    perspective: 800px;
  }
  
  .about-laptop {
    width: 450px;
    max-width: 450px;
    transform: translateZ(-30px) scale(0.85);
  }
  
  .about-mobile {
    width: 160px;
    right: -30px;
    top: 40px;
    transform: translateZ(30px) rotateY(-12deg) rotateX(3deg);
  }
  
  /* Упрощаем анимации на планшетах */
  .about-laptop,
  .about-mobile {
    animation-duration: 1s;
  }
  
  .about-laptop svg,
  .about-mobile svg {
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.2));
  }
}

@media (max-width: 480px) {
  .about-image {
    min-height: 350px;
    perspective: 600px;
  }
  
  .about-laptop {
    width: 320px;
    max-width: 320px;
    transform: translateZ(-20px) scale(0.8);
  }
  
  .about-mobile {
    width: 130px;
    right: -20px;
    top: 30px;
    transform: translateZ(20px) rotateY(-10deg) rotateX(2deg);
  }
  
  /* Упрощаем 3D эффекты на мобильных */
  .about-laptop:hover svg {
    transform: scale(1.03) translateY(-5px);
  }
  
  .about-mobile:hover svg {
    transform: scale(1.05) translateY(-3px);
  }
  
  .about-laptop svg,
  .about-mobile svg {
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.15));
  }
}

/* Дополнительные эффекты при появлении секции в viewport */
@media (prefers-reduced-motion: no-preference) {
  .about-image {
    opacity: 0;
    animation: fadeInUp 1s ease-out forwards;
  }
  
  /* Trigger анимация при скролле - требует JavaScript */
  .about-image.in-view {
    opacity: 1;
  }
  
  .about-image.in-view .about-laptop {
    animation-play-state: running;
  }
  
  .about-image.in-view .about-mobile {
    animation-play-state: running;
  }
}

/* Для пользователей с отключенной анимацией */
@media (prefers-reduced-motion: reduce) {
  .about-laptop,
  .about-mobile,
  .about-laptop svg,
  .about-mobile svg,
  .about-laptop svg *,
  .about-mobile svg * {
    animation: none !important;
    transition: none !important;
  }
  
  .about-image {
    opacity: 1;
  }
}