/* Cross-Platform iOS Style для AnalystAI с космической темой */
:root {
  /* Professional Color Palette */
  --primary-blue: #007aff;
  --primary-indigo: #5856d6;
  --primary-teal: #5ac8fa;
  --primary-purple: #af52de;
  --accent-emerald: #30d158;
  --accent-cyan: #32d7e0;

  /* Cosmic Background Colors */
  --cosmic-dark: #030314;
  --cosmic-darker: #05051a;
  --cosmic-blue: #040415;
  --cosmic-accent: #06062a;

  /* Text Colors */
  --label-primary: #ffffff;
  --label-secondary: #b8b8d6;
  --label-tertiary: #8e8eb8;
  --label-quaternary: #6e6e9e;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(
    135deg,
    var(--cosmic-darker) 0%,
    var(--cosmic-dark) 50%,
    var(--cosmic-blue) 100%
  );
  color: var(--label-primary);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow: hidden;
}

/* Звездное небо */
#stars {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

.splash-container {
  text-align: center;
  padding: 2rem;
  max-width: 420px;
  width: 100%;
  animation: containerAppear 0.6s ease-out;
  position: relative;
  z-index: 1;
}

.logo-section {
  margin-bottom: 3rem;
}

/* Логотип такой же как в login.html */
.logo-container {
  margin-bottom: 2rem;
}

.logo {
  width: 140px;
  height: 140px;
  margin: 0 auto 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  border-radius: 24px;
  animation: subtleGlow 4s ease-in-out infinite;
}

.logo-content {
  text-align: center;
  position: relative;
  z-index: 2;
}

.logo-main-text {
  font-size: 2.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #000000 0%, #222222 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
  line-height: 1;
  position: relative;
  text-shadow: 1px 0 0 rgba(120, 120, 120, 0.8),
    2px 0 0 rgba(150, 150, 150, 0.5);
}

.logo-sub-text {
  font-size: 1rem;
  font-weight: 600;
  color: #333333;
  margin-top: 6px;
  letter-spacing: 0.3px;
  text-shadow: 0.5px 0 0 rgba(120, 120, 120, 0.7),
    1px 0 0 rgba(150, 150, 150, 0.4);
}

/* Для темной темы в splash screen */
.logo {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-main-text {
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 1px 0 0 rgba(0, 0, 0, 0.4), 2px 0 0 rgba(0, 0, 0, 0.2);
}

.logo-sub-text {
  color: #cccccc;
  text-shadow: 0.5px 0 0 rgba(0, 0, 0, 0.4), 1px 0 0 rgba(0, 0, 0, 0.2);
}

.app-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--label-primary);
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 0%, #b8b8d6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.app-subtitle-main {
  font-size: 1.1rem;
  color: var(--label-secondary);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.splash-text {
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 3rem;
  color: var(--label-secondary);
  font-weight: 400;
  animation: textAppear 0.8s ease-out 0.3s both;
}

/* Прогресс бар */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.progress-container {
  width: 100%;
  max-width: 300px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.8rem;
  font-size: 0.9rem;
  color: var(--label-tertiary);
  font-weight: 500;
}

.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-teal), var(--primary-blue));
  border-radius: 3px;
  animation: progressFill 3s ease-in-out;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 60px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.6),
    transparent
  );
  animation: progressShine 2.5s ease-in-out infinite;
}

/* Loading dots */
.loading-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.loading-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary-blue);
  animation: dotBounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) {
  animation-delay: -0.32s;
}
.loading-dot:nth-child(2) {
  animation-delay: -0.16s;
}
.loading-dot:nth-child(3) {
  animation-delay: 0s;
}

.loading-status {
  font-size: 0.95rem;
  color: var(--label-tertiary);
  font-weight: 500;
  min-height: 1.2em;
  transition: all 0.3s ease;
}

/* Анимации */
@keyframes containerAppear {
  0% {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes textAppear {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes progressFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

@keyframes progressShine {
  0% {
    left: -60px;
  }
  100% {
    left: 100%;
  }
}

@keyframes subtleGlow {
  0%,
  100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25),
      inset 0 1px 0 rgba(255, 255, 255, 0.15),
      0 0 20px rgba(255, 255, 255, 0.05);
  }
}

@keyframes dotBounce {
  0%,
  80%,
  100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Адаптивность */
@media (max-width: 480px) {
  .splash-container {
    padding: 1.5rem;
    max-width: 340px;
  }

  .logo {
    width: 120px;
    height: 120px;
  }

  .logo-main-text {
    font-size: 2.4rem;
  }

  .logo-sub-text {
    font-size: 0.9rem;
  }

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

  .splash-text {
    font-size: 1rem;
  }
}

@media (min-width: 768px) {
  .splash-container {
    max-width: 480px;
  }

  .logo {
    width: 140px;
    height: 140px;
  }

  .logo-main-text {
    font-size: 2.8rem;
  }

  .logo-sub-text {
    font-size: 1rem;
  }

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

/* Поддержка accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Mobile browser support */
@supports (-webkit-touch-callout: none) {
  .splash-container {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
  }
}
