/**
 * @file: styles.css
 * @description: Дополнительные стили для лендинга medIA
 * @created: 2026-02-17
 */

/* ========================================
   Custom Properties
   ======================================== */
:root {
  --color-primary: #2563eb;
  --color-primary-dark: #1d4ed8;
  --color-secondary: #10b981;
  --color-telegram: #229ED9;
}

/* ========================================
   Base Styles
   ======================================== */
html {
  scroll-behavior: smooth;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Selection */
::selection {
  background-color: rgba(37, 99, 235, 0.2);
  color: inherit;
}

.dark ::selection {
  background-color: rgba(96, 165, 250, 0.3);
}

/* ========================================
   Animations
   ======================================== */

/* Fade In Animation */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Animation Delays */
.fade-in:nth-child(1) { transition-delay: 0.1s; }
.fade-in:nth-child(2) { transition-delay: 0.2s; }
.fade-in:nth-child(3) { transition-delay: 0.3s; }
.fade-in:nth-child(4) { transition-delay: 0.4s; }

/* Gradient Text Animation */
@keyframes gradient-shift {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

.animate-gradient {
  background-size: 200% auto;
  animation: gradient-shift 3s ease infinite;
}

/* Pulse Glow */
@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  50% {
    box-shadow: 0 0 20px 10px rgba(37, 99, 235, 0);
  }
}

.pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* ========================================
   Custom Components
   ======================================== */

/* Glass Effect */
.glass {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.dark .glass {
  background: rgba(15, 23, 42, 0.8);
}

/* Gradient Border */
.gradient-border {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  padding: 2px;
  border-radius: 1rem;
}

.gradient-border > * {
  background: white;
  border-radius: calc(1rem - 2px);
}

.dark .gradient-border > * {
  background: rgb(30, 41, 59);
}

/* ========================================
   Buttons
   ======================================== */

/* Primary CTA Button Hover Effect */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.btn-primary:hover::before {
  left: 100%;
}

/* ========================================
   Cards
   ======================================== */

/* Feature Card Hover */
.feature-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-4px);
}

/* ========================================
   Scroll Indicators
   ======================================== */

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(107, 114, 128, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(107, 114, 128, 0.6);
}

.dark ::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.5);
}

/* ========================================
   Mobile Specific
   ======================================== */

/* Touch-friendly tap targets */
@media (max-width: 640px) {
  a, button {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Disable hover effects on touch devices */
@media (hover: none) {
  .feature-card:hover {
    transform: none;
  }

  .btn-primary:hover::before {
    left: -100%;
  }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
  header,
  footer,
  .no-print {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  a {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }
}

/* ========================================
   Accessibility
   ======================================== */

/* Focus styles */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  .fade-in {
    opacity: 1;
    transform: none;
  }
}

/* ========================================
   Loading States
   ======================================== */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(229, 231, 235, 0.5) 25%,
    rgba(229, 231, 235, 0.8) 50%,
    rgba(229, 231, 235, 0.5) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.dark .skeleton {
  background: linear-gradient(
    90deg,
    rgba(51, 65, 85, 0.5) 25%,
    rgba(51, 65, 85, 0.8) 50%,
    rgba(51, 65, 85, 0.5) 75%
  );
  background-size: 200% 100%;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* ========================================
   Hero Section Specific
   ======================================== */

/* Phone mockup shadow */
.phone-shadow {
  filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.25));
}

/* Floating elements random delay */
.float-1 { animation-delay: 0s; }
.float-2 { animation-delay: 0.5s; }
.float-3 { animation-delay: 1s; }
.float-4 { animation-delay: 1.5s; }

/* ========================================
   Section Dividers
   ======================================== */

.section-divider {
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  border-radius: 2px;
}

/* ========================================
   Telegram Brand Color
   ======================================== */

.bg-telegram {
  background-color: var(--color-telegram);
}

.text-telegram {
  color: var(--color-telegram);
}

.hover\:bg-telegram-dark:hover {
  background-color: #1E8BC3;
}
