/* Modern CSS Variables and Animations for Cultural Center */

:root {
  /* Primary Colors - обновленная палитра */
  --primary-color: #8b5cf6;
  --primary-dark: #7c3aed;
  --primary-light: #a78bfa;
  --primary-gradient: linear-gradient(135deg, #8b5cf6, #7c3aed);
  
  /* Secondary Colors */
  --secondary-color: #2d1b69;
  --secondary-light: rgba(45, 27, 105, 0.1);
  --accent-color: #8b5cf6;
  --accent-dark: #7c3aed;
  
  /* Success & Status Colors */
  --success-color: #4caf50;
  --success-light: #e8f5e8;
  --warning-color: #ff9800;
  --info-color: #2196f3;
  
  /* Text Colors */
  --text-primary: #2c3e50;
  --text-secondary: #6c757d;
  --text-light: rgba(255, 255, 255, 0.9);
  --text-muted: rgba(255, 255, 255, 0.7);
  
  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-dark: linear-gradient(135deg, rgba(45, 27, 105, 0.95), rgba(0, 0, 0, 0.85));
  --bg-light-gradient: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  
  /* Shadows */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 12px 24px rgba(0, 0, 0, 0.18);
  --shadow-primary: 0 4px 15px rgba(139, 92, 246, 0.3);
  --shadow-primary-hover: 0 6px 20px rgba(139, 92, 246, 0.4);
  
  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50px;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;
  --spacing-2xl: 4rem;
  
  /* Typography */
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.5rem;
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Modern Button Components */
.btn-modern {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-lg);
  border-radius: var(--radius-full);
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-base);
  cursor: pointer;
  border: none;
  font-size: var(--font-size-base);
  position: relative;
  overflow: hidden;
}

.btn-modern::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 var(--transition-slow);
}

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

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary-hover);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(45deg, var(--success-color), #45a049);
  color: white;
}

.btn-warning {
  background: linear-gradient(45deg, var(--accent-color), var(--accent-dark));
  color: white;
}

/* Modern Card Components */
.card-modern {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-lg);
  transition: all var(--transition-base);
  border: 1px solid rgba(139, 92, 246, 0.1);
  position: relative;
  overflow: hidden;
}

.card-modern:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-xl);
}

.card-elevated {
  transform: scale(1.05);
  border: 2px solid var(--primary-color);
  box-shadow: 0 15px 40px rgba(139, 92, 246, 0.2);
}

.card-elevated:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 25px 50px rgba(139, 92, 246, 0.25);
}

/* Icon Containers */
.icon-container {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--spacing-md);
  position: relative;
  overflow: hidden;
}

.icon-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: inherit;
  border-radius: inherit;
  opacity: 0;
  transform: scale(0);
  transition: all var(--transition-bounce);
}

.icon-container:hover::before {
  opacity: 0.2;
  transform: scale(1.2);
}

.icon-primary {
  background: linear-gradient(45deg, var(--primary-light), #e1bee7);
}

.icon-success {
  background: linear-gradient(45deg, var(--success-light), #c8e6c9);
}

.icon-warning {
  background: linear-gradient(45deg, #f3e5f5, #e1bee7);
}

/* Floating Animations */
@keyframes float {
  0%, 100% { 
    transform: translateY(0px) rotate(0deg); 
  }
  50% { 
    transform: translateY(-20px) rotate(180deg); 
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* Animation Classes */
.animate-fade-in {
  animation: fadeInUp 0.8s ease-out;
}

.animate-slide-left {
  animation: slideInLeft 0.8s ease-out;
}

.animate-slide-right {
  animation: slideInRight 0.8s ease-out;
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

/* Scroll Animations */
.scroll-reveal {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s ease-out;
}

html.js-animations .scroll-reveal {
  opacity: 0;
  transform: translateY(50px);
}

.scroll-reveal.revealed {
  opacity: 1 !important;
  transform: translateY(0);
}

/* Анимации появления должны оставаться видимыми */
.animate-slide-left,
.animate-slide-right,
.animate-fade-in {
  animation-fill-mode: forwards !important;
}

/* Modern Typography */
.text-gradient {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Keep the advantages block readable even when the browser is in dark mode. */
#services .features-modern .feature-item,
.rts-about-area-seven .features-modern .feature-item {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%) !important;
}

#services .features-modern .feature-item span,
.rts-about-area-seven .features-modern .feature-item span,
.rts-about-area-seven .about-content-modern span {
  color: #30373e !important;
  opacity: 1 !important;
}

#services .about-image-modern .image-container,
.rts-about-area-seven .about-image-modern .image-container {
  background: linear-gradient(135deg, #1f2937 0%, #4c1d95 100%) !important;
  padding: 36px;
}

#services .about-image-modern .image-container img,
.rts-about-area-seven .about-image-modern .image-container img {
  display: block;
  object-fit: contain;
  filter: none;
}

/* Loading States */
.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Responsive Utilities */
@media (max-width: 768px) {
  :root {
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --font-size-4xl: 2rem;
    --font-size-3xl: 1.75rem;
  }
  
  .card-modern {
    padding: var(--spacing-lg);
  }
  
  .btn-modern {
    width: 100%;
    justify-content: center;
  }
  
  /* Исправление цвета текста в секции services для мобильных */
  #services .features-modern .feature-item span,
  #services .features-modern .feature-item,
  .rts-about-area-seven .features-modern .feature-item span,
  .rts-about-area-seven .about-content-modern span {
    color: #30373e !important;
  }
  
  #services .section-header .title,
  .rts-about-area-seven .section-header .title {
    color: #30373e !important;
  }
}

/* Focus States for Accessibility */
.btn-modern:focus,
.card-modern:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
  }
}

/* Print Styles */
@media print {
  .btn-modern,
  .animate-float,
  .scroll-reveal {
    animation: none !important;
    transform: none !important;
  }
}