/* ============================================================
   clinic-enhancements.css — улучшения стилизации (раунд 2)
   Добавляет: тени, hover-эффекты, плавные переходы, micro-interactions
   ============================================================ */

/* --- 1. Улучшенные тени для карточек --- */
.card, .service, .background-panel, .map-card {
  box-shadow: 0 1px 2px rgba(36, 62, 66, 0.04), 0 2px 8px rgba(36, 62, 66, 0.04);
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover, .service:hover {
  box-shadow: 0 4px 12px rgba(36, 62, 66, 0.08), 0 8px 24px rgba(36, 62, 66, 0.08);
  transform: translateY(-2px);
}

/* --- 2. Кнопки: более детальный hover --- */
.button {
  position: relative;
  overflow: hidden;
  transition: background 0.25s, box-shadow 0.25s, transform 0.15s;
  box-shadow: 0 2px 8px rgba(23, 97, 107, 0.18);
}
.button:hover {
  box-shadow: 0 4px 14px rgba(23, 97, 107, 0.28);
  transform: translateY(-1px);
}
.button:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(23, 97, 107, 0.18);
}
.button.secondary {
  box-shadow: 0 2px 6px rgba(36, 62, 66, 0.08);
}
/* Эффект "блика" при наведении */
.button::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
  transition: left 0.6s;
}
.button:hover::after {
  left: 100%;
}

/* --- 3. Карточки услуг: плавное приближение изображения --- */
.service {
  overflow: hidden;
}
.service img {
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.service:hover img {
  transform: scale(1.04);
}
.service-copy {
  position: relative;
}
.service-copy::before {
  content: '';
  position: absolute;
  left: 0; top: 0;
  width: 3px; height: 0;
  background: var(--teal);
  transition: height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.service:hover .service-copy::before {
  height: 100%;
}

/* --- 4. Навигация: подчёркивание при наведении --- */
.navigation a {
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s;
}
.navigation a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--teal);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.navigation a:hover::after,
.navigation a:focus-visible::after {
  width: 100%;
}

/* --- 5. Шапка: плавное сужение при скролле --- */
.header {
  transition: padding 0.3s, box-shadow 0.3s;
}
.header.is-compact {
  box-shadow: 0 2px 12px rgba(36, 62, 66, 0.06);
}

/* --- 6. Hero: появление текста --- */
.hero-panel {
  animation: heroFadeIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.entrance {
  animation: heroFadeIn 0.9s 0.15s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 7. Появление секций при скролле (IntersectionObserver в JS) --- */
.section {
  opacity: 1;
}
body.motion-ready .section[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
body.motion-ready .section[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* --- 8. Чат-кнопка: пульсация для привлечения внимания --- */
.chat-launcher {
  transition: box-shadow 0.3s, transform 0.2s;
}
.chat-launcher:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(23, 97, 107, 0.32);
}
.chat-launcher:not(.is-opened) {
  animation: chatPulse 2.5s ease-in-out infinite;
}
@keyframes chatPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(23, 97, 107, 0.2); }
  50% { box-shadow: 0 4px 20px rgba(23, 97, 107, 0.2), 0 0 0 8px rgba(23, 97, 107, 0.08); }
}

/* --- 9. Чат-панель: плавное открытие --- */
.chat-panel {
  animation: chatSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.chat-message {
  animation: messageIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes messageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 10. Прогресс-бар скролла сверху --- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--teal), #2da7b3);
  width: 0%;
  z-index: 60;
  transition: width 0.1s;
  box-shadow: 0 0 8px rgba(23, 97, 107, 0.4);
}

/* --- 11. Плавающая кнопка "Позвонить" для мобильных --- */
.floating-call {
  display: none;
}
@media (max-width: 650px) {
  .floating-call {
    display: inline-flex;
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 40;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: var(--teal);
    color: white;
    text-decoration: none;
    border-radius: 28px;
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(23, 97, 107, 0.3);
    transition: transform 0.2s, box-shadow 0.3s;
  }
  .floating-call:hover, .floating-call:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(23, 97, 107, 0.4);
  }
  .floating-call svg {
    width: 18px;
    height: 18px;
  }
}

/* --- 12. Cookie-баннер --- */
.cookie-banner {
  position: fixed;
  left: 12px; right: 12px;
  bottom: 12px;
  z-index: 50;
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 22px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(36, 62, 66, 0.12);
  font-size: 14px;
  display: flex;
  gap: 14px;
  align-items: center;
  animation: cookieSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cookieSlideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}
.cookie-banner.is-hidden {
  display: none;
}
.cookie-banner p {
  margin: 0;
  flex: 1;
  color: var(--ink);
}
.cookie-banner a {
  color: var(--teal);
  text-decoration: underline;
}
.cookie-banner button {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--teal);
  color: white;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.cookie-banner button:hover {
  background: #103f46;
}

/* --- 13. Формы: улучшенный focus state --- */
input:focus, select:focus, textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 97, 107, 0.12);
  outline: 0;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* --- 14. Schedule rows: подсветка при наведении --- */
.schedule-row, .department {
  transition: background 0.2s;
  border-radius: 8px;
  padding-left: 12px;
  padding-right: 12px;
  margin-left: -12px;
  margin-right: -12px;
}
.schedule-row:hover, .department:hover {
  background: var(--paper);
}

/* --- 15. Footer: более выраженный --- */
.footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, var(--paper) 0%, #e8efed 100%);
}
.footer a {
  color: var(--teal);
  text-decoration: none;
  transition: color 0.2s;
}
.footer a:hover {
  color: #103f46;
  text-decoration: underline;
}

/* --- 16. Toast уведомления (после отправки формы) --- */
.toast {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 70;
  padding: 14px 20px;
  background: white;
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(36, 62, 66, 0.15);
  font-size: 14px;
  max-width: 340px;
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}
.toast.is-hiding {
  animation: toastOut 0.3s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); }
}

/* --- 17. Skip-link: плавное появление --- */
.skip {
  transition: top 0.2s;
}

/* --- 18. Внешние ссылки: иконка ↗ --- */
a[target="_blank"]::after {
  content: ' ↗';
  font-size: 0.85em;
  color: var(--muted);
  opacity: 0.7;
  text-decoration: none;
  display: inline-block;
  margin-left: 2px;
}

/* --- 19. respect prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .chat-launcher:not(.is-opened) {
    animation: none;
  }
}
