/* ===============================================
   XMT-Argo Preloader - Cosmic Style
   =============================================== */

/* Показываем контент по умолчанию */
body {
  visibility: visible;
}

/* Скрываем только когда прелоадер активен */
body.preloader-active {
  visibility: hidden;
}

:root {
  /* Cosmic Colors */
  --bg-cosmic: #0a0f1c;
  --bg-cosmic-light: #1a2332;
  --glass-bg: rgba(56, 178, 255, 0.08);
  --glass-border: rgba(56, 178, 255, 0.15);
  --glow-blue: #38b2ff;
  --glow-cyan: #00d9ff;
  --glow-turquoise: #1dd1a1;
  --glow-orange: #ff6b35;
  --text-primary: #ffffff;
  --text-secondary: #b8e6ff;
  
  /* Shadows */
  --shadow-cosmic: 0 0 60px rgba(56, 178, 255, 0.4);
  --shadow-cyan: 0 0 40px rgba(0, 217, 255, 0.3);
  --shadow-glass: 0 12px 40px rgba(56, 178, 255, 0.15);
}

/* ===============================================
   Preloader Container
   =============================================== */

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: var(--bg-cosmic);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Cosmic Background Animation */
#preloader::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(56, 178, 255, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(0, 217, 255, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 60%, rgba(29, 209, 161, 0.06) 0%, transparent 50%);
  animation: cosmicPulse 4s ease-in-out infinite alternate;
}

@keyframes cosmicPulse {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

/* ===============================================
   Logo Container
   =============================================== */

.preloader-logo {
  width: 120px;
  height: 120px;
  margin-bottom: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: var(--shadow-cosmic);
  background: var(--glass-bg);
  backdrop-filter: blur(25px);
  border: 2px solid var(--glass-border);
  padding: 15px;
  animation: logoFloat 3s ease-in-out infinite;
}

.preloader-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 15px rgba(56, 178, 255, 0.6));
}

.preloader-logo::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--glow-blue), var(--glow-orange));
  filter: blur(25px);
  opacity: 0.7;
  z-index: -1;
  animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@keyframes logoGlow {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

/* ===============================================
   Loading Text
   =============================================== */

.preloader-text {
  font-family: 'Russo One', 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  background: linear-gradient(135deg, var(--glow-blue), var(--glow-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: textPulse 2s ease-in-out infinite alternate;
}

@keyframes textPulse {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

/* ===============================================
   Technical Manufacturing Plant Progress
   =============================================== */

.progress-container {
  width: 400px;
  max-width: 85vw;
  position: relative;
  margin: 1.5rem 0;
}

.manufacturing-plant {
  width: 100%;
  height: 160px;
  position: relative;
  overflow: hidden;
}

/* Мобильная адаптация прелоадера */
@media (max-width: 768px) {
  .progress-container {
    width: 320px;
    max-width: 90vw;
    margin: 1rem 0;
  }
  
  .manufacturing-plant {
    height: 120px;
  }
}

@media (max-width: 480px) {
  .progress-container {
    width: 280px;
    max-width: 95vw;
    margin: 0.5rem 0;
  }
  
  .manufacturing-plant {
    height: 100px;
  }
  
  .preloader-text {
    font-size: 1rem;
    margin: 1rem 0;
  }
  
  .status-message {
    font-size: 0.85rem;
  }
}

.manufacturing-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(56, 178, 255, 0.3));
  overflow: hidden;
}

/* Animated elements */
.tank-fill-1,
.tank-fill-2 {
  transition: height 0.8s ease;
  transform-origin: bottom;
}

.pipe-flow {
  stroke-dasharray: 10 5;
  animation: flowAnimation 2s linear infinite;
}

@keyframes flowAnimation {
  0% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 15; }
}

.gear {
  animation: gearRotate 3s linear infinite;
  transform-origin: center;
}

.gear-reverse {
  animation: gearRotateReverse 3s linear infinite;
  transform-origin: center;
}

@keyframes gearRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes gearRotateReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.pump-indicator {
  animation: pumpPulse 1.5s ease-in-out infinite;
}

@keyframes pumpPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===============================================
   Status Messages
   =============================================== */

.status-message {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  text-align: center;
  min-height: 20px;
  opacity: 0.8;
  animation: statusBlink 1.5s ease-in-out infinite;
}

@keyframes statusBlink {
  0%, 50% { opacity: 0.8; }
  51%, 100% { opacity: 0.4; }
}

/* ===============================================
   Responsive Design
   =============================================== */

@media (max-width: 768px) {
  .preloader-logo {
    width: 100px;
    height: 100px;
    margin-bottom: 1.5rem;
  }
  
  .preloader-text {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
  }
  
  .progress-container {
    width: 400px;
  }
  
  .manufacturing-plant {
    height: 160px;
  }
}

@media (max-width: 480px) {
  .preloader-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 1rem;
  }
  
  .preloader-text {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .progress-container {
    width: 300px;
  }
  
  .manufacturing-plant {
    height: 120px;
  }
} 