/* ===== OPTIMIZED MODERN THEME SYSTEM ===== */
/* static/css/modern-theme.css - Optimized for Performance with Fixed Spacing */

/* ===== CSS CUSTOM PROPERTIES ===== */
:root {
  /* === LAYOUT VARIABLES === */
  --header-height: 70px;
  --header-mobile-height: 60px;
  --header-z-index: 1000;
  
  /* === LIGHT THEME === */
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  
  --text-primary: #1e293b;
  --text-secondary: #36404b;
  --text-tertiary: #424b55;
  --text-inverse: #ffffff;
  
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  /* Brand Colors */
  --primary-color: #3ECDC1;
  --primary-dark: #32A39A;
  --secondary-color: #6C5CE7;
  --accent-color: #FDCB6E;
  --danger-color: #e74c3c;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --info-color: #3498db;
  
  /* Hero Gradients */
  --hero-bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --hero-text-gradient: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  
  /* Optimized Morphing Shapes (fewer and simpler) */
  --shape-1-gradient: linear-gradient(45deg, #ff6b6b, #ee5a24);
  --shape-2-gradient: linear-gradient(45deg, #4834d4, #686de0);
  --shape-3-gradient: linear-gradient(45deg, #00d2d3, #54a0ff);
  
  /* Glass Effects (reduced blur for performance) */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-hover: rgba(255, 255, 255, 0.15);
  --glass-blur: blur(10px); /* Reduced from 20px */
  
  /* Shadows (simplified) */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1);
  
  /* Reduced particle count */
  --particle-opacity: 0.4; /* Reduced from 0.6 */
  
  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  
  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-full: 9999px;
}

/* === DARK THEME === */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-tertiary: #94a3b8;
  --text-inverse: #f8fafc;
  
  --border-color: #334155;
  --border-hover: #475569;
  
  /* Hero Gradients for Dark */
  --hero-bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
  --hero-text-gradient: linear-gradient(135deg, #f8fafc 0%, #cbd5e1 100%);
  
  /* Enhanced Morphing Shapes for Dark */
  --shape-1-gradient: linear-gradient(45deg, #ff4757, #ff3838);
  --shape-2-gradient: linear-gradient(45deg, #5352ed, #3742fa);
  --shape-3-gradient: linear-gradient(45deg, #20bf6b, #26de81);
  
  /* Glass Effects for Dark */
  --glass-bg: rgba(30, 41, 59, 0.3);
  --glass-border: rgba(148, 163, 184, 0.2);
  --glass-hover: rgba(30, 41, 59, 0.5);
  
  /* Dark Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.6);
  
  /* Slightly more visible particles for dark */
  --particle-opacity: 0.5;
}

/* ===== BASE STYLES ===== */
html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  overflow-x: hidden;
  transition: background-color var(--transition-slow), color var(--transition-slow);
  padding-top: 0 !important;
}

/* ===== ИСПРАВЛЕНИЯ ОТСТУПОВ ===== */

/* Основной контент */
.main-content {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  padding-top: 0 !important; /* Убираем дополнительные отступы */
}

/* Специальная обработка для hero-секции */
.hero-section {
  position: relative;
  min-height: 100vh;
  width: 100%;
  background: var(--hero-bg-gradient);
  overflow: hidden;
  display: flex;
  align-items: center;
  margin-top: 0 !important;
  padding-top: var(--header-height) !important;
}

/* Убираем отступы у секций после hero */
.hero-section + section,
.hero-section ~ section {
  margin-top: 0 !important;
}

/* Обеспечиваем правильные отступы для всех секций */
section {
  position: relative;
  z-index: 1;
}

/* Исправления для карты обучения */
.learning-map-container .main-container {
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
}

/* ===== THEME TOGGLE (moved to user menu) ===== */
.theme-toggle-inline {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
}

.theme-toggle-inline:hover {
  background: var(--glass-bg);
  color: var(--primary-color);
}

.theme-icon {
  font-size: 1rem;
  transition: transform var(--transition-normal);
}

.theme-toggle-inline:hover .theme-icon {
  transform: rotate(180deg);
}

/* ===== OPTIMIZED HERO SECTION ===== */
.hero-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 20%, rgba(62, 205, 193, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(108, 92, 231, 0.15) 0%, transparent 50%);
  transition: all var(--transition-slow);
}

[data-theme="dark"] .hero-bg {
  background: 
    radial-gradient(circle at 20% 20%, rgba(62, 205, 193, 0.2) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(108, 92, 231, 0.2) 0%, transparent 50%);
}

/* ===== REDUCED PARTICLES (for performance) ===== */
.floating-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(255, 255, 255, var(--particle-opacity));
  border-radius: 50%;
  animation: float-particle 30s infinite linear;
}

.particle:nth-child(odd) {
  animation-duration: 35s;
  background: rgba(62, 205, 193, var(--particle-opacity));
  width: 3px;
  height: 3px;
}

.particle:nth-child(3n) {
  animation-duration: 40s;
  background: rgba(108, 92, 231, var(--particle-opacity));
}

@keyframes float-particle {
  0% {
    transform: translateY(100vh) translateX(-10px) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-10vh) translateX(10px) rotate(360deg);
    opacity: 0;
  }
}

/* ===== SIMPLIFIED MORPHING SHAPES (only 3 instead of 6) ===== */
.floating-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px); /* Reduced blur */
  opacity: 0.3; /* Reduced opacity */
  z-index: 1;
  pointer-events: none;
  transition: all var(--transition-slow);
}

[data-theme="dark"] .floating-shape {
  opacity: 0.4;
  filter: blur(50px);
}

.shape-1 {
  width: 300px;
  height: 300px;
  background: var(--shape-1-gradient);
  top: -50px;
  left: -100px;
  animation: simple-float-1 20s infinite ease-in-out;
}

.shape-2 {
  width: 250px;
  height: 250px;
  background: var(--shape-2-gradient);
  bottom: -50px;
  right: -80px;
  animation: simple-float-2 25s infinite ease-in-out;
}

.shape-3 {
  width: 200px;
  height: 200px;
  background: var(--shape-3-gradient);
  top: 30%;
  right: 10%;
  animation: simple-float-3 15s infinite ease-in-out;
}

/* ===== SIMPLIFIED ANIMATIONS ===== */
@keyframes simple-float-1 {
  0%, 100% { 
    transform: translate(0, 0) scale(1);
  }
  50% { 
    transform: translate(30px, -20px) scale(1.1);
  }
}

@keyframes simple-float-2 {
  0%, 100% { 
    transform: translate(0, 0) scale(1);
  }
  50% { 
    transform: translate(-40px, -30px) scale(1.15);
  }
}

@keyframes simple-float-3 {
  0%, 100% { 
    transform: translate(0, 0) scale(1);
  }
  50% { 
    transform: translate(-25px, 25px) scale(0.9);
  }
}

/* ===== CONTAINER ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
  position: relative;
  z-index: 10;
}

/* ===== HERO CONTENT ===== */
.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  min-height: 80vh;
}

.hero-title {
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-lg);
  background: var(--hero-text-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: relative;
  transition: all var(--transition-slow);
}

.hero-title::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  bottom: -15px;
  left: 0;
  border-radius: 3px;
  animation: gentle-glow 4s ease-in-out infinite alternate;
  transition: all var(--transition-slow);
}

@keyframes gentle-glow {
  0% { 
    box-shadow: 0 0 5px rgba(62, 205, 193, 0.3);
  }
  100% { 
    box-shadow: 0 0 15px rgba(62, 205, 193, 0.6);
  }
}

.hero-subtitle {
  font-size: 1.3rem;
  color: var(--text-inverse);
  margin-bottom: var(--space-xl);
  line-height: 1.6;
  font-weight: 400;
  opacity: 0.95;
  transition: all var(--transition-slow);
}

/* ===== MODERN BUTTONS ===== */
.cta-buttons {
  display: flex;
  gap: var(--space-lg);
  margin-bottom: var(--space-2xl);
  flex-wrap: wrap;
}

.btn-modern {
  padding: 1rem 2.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1.1rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-transform: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(62, 205, 193, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 25px rgba(62, 205, 193, 0.4);
  color: white;
  text-decoration: none;
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-inverse);
  border: 2px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  background: var(--glass-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  color: var(--text-inverse);
  text-decoration: none;
}

.cta-icon {
  transition: transform var(--transition-normal);
}

.btn-modern:hover .cta-icon {
  transform: translateX(4px);
}

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card:hover {
  transform: translateY(-5px);
  background: var(--glass-hover);
  box-shadow: var(--shadow-lg);
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-inverse);
  margin-bottom: 0.5rem;
  line-height: 1;
}

.stat-label {
  color: var(--text-inverse);
  font-weight: 500;
  opacity: 0.9;
  font-size: 0.85rem;
  line-height: 1.3;
  word-wrap: break-word;
  hyphens: auto;
}

/* ===== DEVICE MOCKUP (OPTIMIZED - NO PULSING) ===== */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-showcase {
  position: relative;
  max-width: 420px;
  width: 100%;
}

.device-mockup {
  width: 100%;
  height: auto;
  background: linear-gradient(145deg, #1e293b, #334155);
  border-radius: 40px;
  padding: 25px;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  transition: all var(--transition-slow);
  /* REMOVED: Pulsing animation that was causing performance issues */
}

[data-theme="dark"] .device-mockup {
  background: linear-gradient(145deg, #334155, #475569);
}

.device-mockup::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 8px;
  background: var(--bg-primary);
  border-radius: 4px;
  transition: background var(--transition-slow);
}

.device-screen {
  width: 100%;
  height: 650px;
  background: var(--hero-bg-gradient);
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  transition: all var(--transition-slow);
  /* REMOVED: Pulsing animation */
  box-shadow: 0 0 20px rgba(62, 205, 193, 0.2);
}

.screen-content {
  padding: 2.5rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: var(--text-inverse);
}

.app-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.app-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
  color: var(--text-primary);
}

.app-subtitle {
  opacity: 0.9;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.re-cards {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.feature-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border-radius: 18px;
  padding: 1.2rem;
  border: 1px solid var(--glass-border);
  /* REMOVED: Floating animation */
  transition: all var(--transition-normal);
}

.feature-card:hover {
  background: var(--glass-hover);
  transform: translateX(5px);
}

.feature-icon {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.8rem;
  font-size: 1.2rem;
  transition: all var(--transition-normal);
  color: white;
}

/* Градиентные иконки с белым текстом */
.feature-icon.knowledge-gradient,
.feature-icon.communication-gradient,
.feature-icon.workstation-gradient,
.feature-icon.community-gradient,
.feature-icon.virtual-patient-gradient,
.feature-icon.big-gradient {
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.feature-card:hover .feature-icon {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.3);
}

.feature-card h4 {
  font-size: 1.1rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.feature-card p {
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.4;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 992px) {
  :root {
    --header-height: var(--header-mobile-height);
  }
}

@media (max-width: 768px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: var(--space-2xl);
    text-align: center;
    padding-top: var(--space-xl);
  }

  .hero-title {
    font-size: 2.8rem !important;
  }

  .hero-title::after {
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .cta-buttons {
    justify-content: center;
    gap: var(--space-md);
  }

  .btn-modern {
    padding: 0.9rem 2rem;
    font-size: 1rem;
  }

  .device-mockup {
    max-width: 320px;
  }

  .device-screen {
    height: 480px;
  }

  .screen-content {
    padding: 1.8rem;
  }

  .app-title {
    font-size: 1.3rem;
  }

  .floating-shape {
    opacity: 0.1; /* Much more subtle on mobile */
  }

  [data-theme="dark"] .floating-shape {
    opacity: 0.15;
  }

  /* Reduce particles on mobile */
  .particle:nth-child(n+4) {
    display: none;
  }
  
  /* ИСПРАВЛЕНО: мобильные отступы */
  .hero-section {
    margin-top: calc(-1 * var(--header-mobile-height, 60px)) !important;
    padding-top: var(--header-mobile-height, 60px) !important;
  }
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */

/* Disable animations on low-end devices */
@media (max-device-width: 768px) and (max-device-height: 1024px) {
  .floating-shape {
    animation: none;
    opacity: 0.1;
  }
  
  .particle {
    animation-duration: 60s; /* Much slower */
  }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .floating-shape,
  .particle,
  .feature-card {
    animation: none;
  }
  
  .btn-modern,
  .stat-card,
  .theme-toggle-inline {
    transition: none;
  }
  
  .hero-title::after {
    animation: none;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --text-primary: #000000;
    --text-secondary: #333333;
    --border-color: #000000;
  }

  [data-theme="dark"] {
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --border-color: #ffffff;
  }
}
/* ===== ДОПОЛНИТЕЛЬНЫЕ СТИЛИ ДЛЯ АНИМИРОВАННОГО ТЕЛЕФОНА ===== */
/* Добавьте эти стили в ваш файл static/css/modern-theme.css */

/* ===== КОМПАКТНЫЙ ТЕЛЕФОН ===== */
.app-showcase {
    position: relative;
    max-width: 320px; /* Уменьшено с 420px */
    width: 100%;
    margin: 0 auto;
}

.device-mockup {
    width: 100%;
    height: auto;
    background: linear-gradient(145deg, #1e293b, #334155);
    border-radius: 35px; /* Уменьшено с 40px */
    padding: 20px; /* Уменьшено с 25px */
    box-shadow: 0 15px 30px rgba(0,0,0,0.3); /* Уменьшена тень */
    position: relative;
    overflow: hidden;
    transform: scale(0.85); /* Общее уменьшение */
}

.device-screen {
    width: 100%;
    height: 520px; /* Уменьшено с 650px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 25px; /* Уменьшено с 30px */
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 15px rgba(62, 205, 193, 0.2);
}

/* ===== FLOATING PARTICLES ANIMATION ===== */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw; /* Вся ширина экрана */
    height: 100vh; /* Вся высота экрана */
    overflow: hidden;
    pointer-events: none;
    z-index: 1; /* Понижен z-index */
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.8); /* Увеличена прозрачность */
    border-radius: 50%;
    animation: floatUp 12s infinite linear; /* Замедлена анимация */
    opacity: 0;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.5); /* Добавлено свечение */
}

.particle:nth-child(odd) {
    background: rgba(62, 205, 193, 0.9); /* Увеличена видимость */
    box-shadow: 0 0 8px rgba(62, 205, 193, 0.6);
}

.particle:nth-child(3n) {
    background: rgba(108, 92, 231, 0.8);
    box-shadow: 0 0 6px rgba(108, 92, 231, 0.5);
}

.particle:nth-child(4n) {
    background: rgba(253, 203, 110, 0.8);
    box-shadow: 0 0 6px rgba(253, 203, 110, 0.5);
}

.particle:nth-child(5n) {
    background: rgba(46, 204, 113, 0.7);
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.4);
}

@keyframes floatUp {
    0% {
        transform: translateY(100vh) translateX(-30px) scale(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 1;
        transform: translateY(95vh) translateX(-25px) scale(0.5) rotate(30deg);
    }
    50% {
        opacity: 1;
        transform: translateY(50vh) translateX(0px) scale(1) rotate(180deg);
    }
    95% {
        opacity: 1;
        transform: translateY(5vh) translateX(25px) scale(0.8) rotate(330deg);
    }
    100% {
        transform: translateY(-5vh) translateX(30px) scale(0) rotate(360deg);
        opacity: 0;
    }
}

/* ===== SCREEN SLIDES CONTAINER ===== */
.screen-slides {
    display: flex;
    width: 400%; /* 4 screens */
    height: 100%;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen-content {
    width: 25%; /* Each screen takes 1/4 of total width */
    padding: 1.8rem; /* Уменьшено с 2.5rem */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* ===== SCREEN SPECIFIC BACKGROUNDS ===== */
.screen-content.screen-2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.screen-content.screen-3 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.screen-content.screen-4 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* ===== DASHBOARD COMPONENTS ===== */
.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: white;
}

.stat-label {
    font-size: 0.8rem;
    opacity: 0.8;
    color: white;
}

.progress-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4caf50, #66bb6a);
    border-radius: 3px;
    transition: width 2s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

/* ===== TEST INTERFACE COMPONENTS ===== */
.question-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 18px;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.question-text {
    font-size: 1rem;
    margin-bottom: 1rem;
    line-height: 1.4;
    font-weight: 500;
}

.answer-options {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.answer-option {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
}

.answer-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.answer-option.correct {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4caf50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.2);
}

/* ===== VIRTUAL PATIENT COMPONENTS ===== */
.patient-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 18px;
    margin-bottom: 1.5rem;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.patient-avatar {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.patient-info h4 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.patient-info p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.patient-symptoms {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.symptom-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.8rem;
    border-radius: 10px;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== SCREEN INDICATORS ===== */
.screen-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.indicator.active {
    background: white;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* ===== ENHANCED FEATURE CARDS ===== */
.feature-card {
    animation: slideInFromBottom 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }

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

/* ===== SCREEN CONTENT - КОМПАКТНЫЕ РАЗМЕРЫ ===== */
.screen-content {
    width: 25%;
    padding: 1.8rem; /* Уменьшено с 2.5rem */
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: var(--text-primary);
    flex-shrink: 0;
}

.app-header {
    text-align: center;
    margin-bottom: 1.5rem; /* Уменьшено */
}

.app-title {
    font-size: 1.3rem; /* Уменьшено с 1.6rem */
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.app-subtitle {
    opacity: 0.9;
    font-size: 0.85rem; /* Уменьшено */
    color: var(--text-secondary);
}

.feature-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem; /* Уменьшено */
    flex: 1;
}

.feature-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 14px; /* Уменьшено */
    padding: 1rem; /* Уменьшено */
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    animation: slideInFromBottom 0.6s ease forwards;
}

.feature-icon {
    width: 35px; /* Уменьшено с 45px */
    height: 35px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    font-size: 1rem; /* Уменьшено */
}

.feature-card h4 {
    font-size: 0.95rem; /* Уменьшено */
    margin-bottom: 0.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.8rem; /* Уменьшено */
    opacity: 0.9;
    line-height: 1.3;
    color: var(--text-secondary);
}

/* ===== RESPONSIVE - МОБИЛЬНАЯ АДАПТАЦИЯ ===== */
@media (max-width: 768px) {
    .device-mockup {
        transform: scale(0.75); /* Еще меньше на мобильных */
        margin: -20px auto; /* Компенсируем отступы */
    }
    
    .device-screen {
        height: 450px; /* Еще меньше для мобильных */
    }

    .screen-content {
        padding: 1.2rem;
    }

    .app-title {
        font-size: 1.1rem;
    }

    .app-subtitle {
        font-size: 0.75rem;
    }

    .feature-card {
        padding: 0.8rem;
    }

    .feature-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .feature-card h4 {
        font-size: 0.85rem;
    }

    .feature-card p {
        font-size: 0.75rem;
    }

    /* Еще меньше частиц на мобильных */
    .particle:nth-child(n+4) {
        display: none;
    }
}

/* ===== DARK THEME ADJUSTMENTS ===== */
[data-theme="dark"] .stat-card,
[data-theme="dark"] .progress-item,
[data-theme="dark"] .question-card,
[data-theme="dark"] .patient-card,
[data-theme="dark"] .symptom-item,
[data-theme="dark"] .answer-option {
    background: rgba(30, 41, 59, 0.3);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .indicator {
    background: rgba(148, 163, 184, 0.4);
    border-color: rgba(148, 163, 184, 0.2);
}

[data-theme="dark"] .indicator.active {
    background: #cbd5e1;
}

/* ===== PERFORMANCE OPTIMIZATIONS ===== */
@media (prefers-reduced-motion: reduce) {
    .screen-slides {
        transition: none;
    }
    
    .particle {
        animation: none;
        display: none;
    }
    
    .feature-card {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .indicator {
        transition: none;
    }
}

/* ===== HIGH CONTRAST MODE ===== */
@media (prefers-contrast: high) {
    .stat-card,
    .progress-item,
    .question-card,
    .patient-card,
    .symptom-item,
    .answer-option {
        border-width: 2px;
        border-color: rgba(255, 255, 255, 0.5);
    }
    
    .indicator {
        border-width: 2px;
    }
    
    .indicator.active {
        border-color: white;
    }
}

/* ===== THEME ADJUSTMENTS FOR PHONE SCREEN ===== */
/* Светлая тема: темный текст на светлом экране */
[data-theme="light"] .screen-content {
    color: #0f172a;
}

[data-theme="light"] .app-title {
    color: #0f172a;
}

[data-theme="light"] .app-subtitle {
    color: #334155;
}

[data-theme="light"] .feature-card h4 {
    color: #0f172a;
}

[data-theme="light"] .feature-card p {
    color: #475569;
}

/* Темная тема: светлый текст на темном экране */
[data-theme="dark"] .screen-content {
    color: #ffffff;
}

[data-theme="dark"] .app-title {
    color: #ffffff;
}

[data-theme="dark"] .app-subtitle {
    color: #e2e8f0;
}

[data-theme="dark"] .feature-card h4 {
    color: #ffffff;
}

[data-theme="dark"] .feature-card p {
    color: #cbd5e1;
}

/* Градиентная тема: адаптивный контрастный текст */
[data-theme="gradient"] .screen-content {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="gradient"] .app-title {
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

[data-theme="gradient"] .app-subtitle {
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

[data-theme="gradient"] .feature-card h4 {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

[data-theme="gradient"] .feature-card p {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Feature Icon Gradients */
.knowledge-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.communication-gradient {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.workstation-gradient {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.community-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.virtual-patient-gradient {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Platform and Benefit Icons */
.platform-icon,
.benefit-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    font-size: 1.5rem;
    color: white;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.platform-icon:hover,
.benefit-icon:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Feature link styles */
.feature-link {
    display: inline-block;
    margin-top: 1rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.feature-link:hover {
    color: var(--accent-secondary);
    text-decoration: none;
    transform: translateX(4px);
}

/* BIG Registration Card Styles */
.big-gradient {
    background: linear-gradient(135deg, 
        #6366f1 0%, 
        #a855f7 50%, 
        #3b82f6 100%
    );
}

.feature-card.highlight {
    border: 2px solid rgba(99, 102, 241, 0.3);
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.05) 0%,
        rgba(168, 85, 247, 0.05) 100%
    );
    position: relative;
    overflow: hidden;
}

.feature-card.highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        #6366f1 0%, 
        #a855f7 50%, 
        #3b82f6 100%
    );
    z-index: 1;
}

.feature-card.highlight:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.1) 0%,
        rgba(168, 85, 247, 0.1) 100%
    );
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.15);
}

/* Enhanced feature link for BIG card */
.feature-card.highlight .feature-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: all 0.3s ease;
}

.feature-card.highlight .feature-link:hover {
    color: var(--secondary);
    transform: translateX(4px);
}

.feature-card.highlight .feature-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
}

.feature-card.highlight .feature-link:hover::after {
    width: 100%;
}