/**
 * Mobile Advanced CSS - Продвинутые стили для мобильных устройств
 * Skeleton loaders, pull-to-refresh, и другие улучшения
 */

/* ===== SKELETON LOADERS ===== */

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 12px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Hero skeleton */
.skeleton-hero {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 30px;
}

.skeleton-video {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.05) 25%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.05) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.skeleton-title {
  width: 80%;
  height: 40px;
  border-radius: 8px;
}

.skeleton-text {
  width: 100%;
  height: 20px;
  border-radius: 8px;
}

.skeleton-text.short {
  width: 60%;
}

.skeleton-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
}

.skeleton-button {
  width: 150px;
  height: 48px;
  border-radius: 16px;
}

/* Service card skeleton */
.skeleton-service-card {
  width: 100%;
  height: var(--service-card-height-mobile, 380px);
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
}

.skeleton-service-card .skeleton-image {
  width: 100%;
  flex: 1;
  border-radius: 20px 20px 0 0;
}

.skeleton-service-card .skeleton-footer {
  height: 60px;
  border-radius: 0 0 20px 20px;
}

/* Portfolio skeleton */
.skeleton-portfolio-card {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
}

.skeleton-portfolio-card .skeleton-image {
  width: 100%;
  flex: 1;
  border-radius: 16px 16px 0 0;
}

.skeleton-portfolio-card .skeleton-text {
  height: 40px;
  margin: 12px;
  border-radius: 8px;
}

.skeleton-row {
  display: grid;
  gap: 16px;
  width: 100%;
}

.skeleton-row.skeleton-portfolio {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 768px) {
  .skeleton-row.skeleton-portfolio {
    grid-template-columns: 1fr;
  }
}

/* ===== PULL TO REFRESH ===== */

.pull-to-refresh-indicator {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 0 0 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: none;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.pull-to-refresh-indicator.active {
  pointer-events: auto;
}

.pull-to-refresh-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  font-size: 18px;
  transition: transform 0.3s ease;
}

.pull-to-refresh-indicator.refreshing .pull-to-refresh-icon {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.pull-to-refresh-text {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

/* ===== VIDEO LOADING INDICATOR ===== */

.video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 30px;
  z-index: 10;
}

.video-loading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */

@media (max-width: 768px) {
  .skeleton-hero {
    border-radius: 20px;
  }
  
  .skeleton-video {
    border-radius: 20px;
  }
  
  .skeleton-content {
    bottom: 24px;
    width: 95%;
  }
  
  .skeleton-title {
    height: 32px;
  }
  
  .skeleton-text {
    height: 16px;
  }
  
  .skeleton-button {
    width: 100%;
    max-width: 200px;
  }
  
  .pull-to-refresh-indicator {
    padding: 10px 20px;
  }
  
  .pull-to-refresh-icon {
    width: 28px;
    height: 28px;
    font-size: 16px;
  }
  
  .pull-to-refresh-text {
    font-size: 12px;
  }
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
  .skeleton {
    animation: none;
    background: rgba(255, 255, 255, 0.05);
  }
  
  .pull-to-refresh-indicator {
    transition: none;
  }
  
  .pull-to-refresh-icon {
    transition: none;
  }
  
  .video-loading-spinner {
    animation: none;
    border-top-color: var(--accent-primary);
  }
}

