/* ====== MODERN LOADING SCREEN ====== */

#boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1628 0%, #1a0f3a 25%, #0f2a4a 50%, #0a1f3a 75%, #051a2f 100%);
  overflow: hidden;
  min-height: 100vh;
  width: 100%;
}

/* Animated Background Gradients */
.boot-background {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.boot-gradient-1 {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 217, 255, 0.2) 0%, transparent 70%);
  top: -150px;
  left: -150px;
  animation: float 12s ease-in-out infinite;
  filter: blur(40px);
}

.boot-gradient-2 {
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
  bottom: -150px;
  right: -150px;
  animation: float 14s ease-in-out infinite reverse;
  filter: blur(40px);
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, 40px) scale(1.1); }
}

/* Main Content */
.boot-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 550px;
  width: 90%;
  animation: slideUp 1s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 39, 0.5);
  padding: 60px 40px;
  border-radius: 20px;
  border: 1px solid rgba(0, 217, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 217, 255, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

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

/* Logo Container */
.boot-logo-container {
  margin-bottom: 50px;
  animation: scaleIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.boot-logo {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boot-logo-text {
  font-size: 52px;
  font-weight: 800;
  background: linear-gradient(135deg, #00d9ff 0%, #00f5ff 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  z-index: 2;
  letter-spacing: 3px;
  text-shadow: 0 0 30px rgba(0, 217, 255, 0.3);
  filter: drop-shadow(0 0 20px rgba(124, 58, 237, 0.3));
}

.boot-logo-ring {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-top-color: #00d9ff;
  border-right-color: #7c3aed;
  border-bottom-color: rgba(0, 217, 255, 0.3);
  border-radius: 50%;
  animation: spin 4s linear infinite;
  box-shadow: 0 0 30px rgba(0, 217, 255, 0.4), inset 0 0 30px rgba(124, 58, 237, 0.2);
}

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

/* Title */
.boot-title {
  margin-bottom: 35px;
}

.boot-title h1 {
  font-size: 36px;
  font-weight: 800;
  color: #eaf2ff;
  margin: 0;
  letter-spacing: 1.5px;
  animation: fadeInDown 0.8s ease 0.2s both;
  text-shadow: 0 2px 10px rgba(0, 217, 255, 0.2);
}

.boot-subtitle {
  font-size: 18px;
  color: #00d9ff;
  margin: 15px 0 0;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 700;
  animation: fadeInDown 0.8s ease 0.3s both;
  line-height: 1.4;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading Messages */
.boot-messages {
  height: 70px;
  margin-bottom: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boot-text {
  font-size: 15px;
  color: #00d9ff;
  font-family: 'Courier New', monospace;
  letter-spacing: 0.8px;
  min-height: 28px;
  animation: fadeIn 0.6s ease;
  line-height: 1.6;
  font-weight: 500;
}

.boot-text div {
  margin: 5px 0;
  opacity: 0;
  animation: typeIn 0.5s ease forwards;
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Progress Bar */
.boot-progress-container {
  margin-bottom: 30px;
}

.boot-progress-bar {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(0, 217, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.boot-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00d9ff 0%, #7c3aed 50%, #00d9ff 100%);
  border-radius: 10px;
  width: 0%;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 15px rgba(0, 217, 255, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.boot-progress-glow {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.boot-percent {
  font-size: 13px;
  color: #00d9ff;
  font-weight: 700;
  letter-spacing: 1.5px;
  font-family: 'Courier New', monospace;
}

/* Status */
.boot-status {
  margin-top: 25px;
}

.boot-hint {
  font-size: 13px;
  color: rgba(234, 242, 255, 0.6);
  letter-spacing: 0.8px;
  animation: pulse 2.5s ease-in-out infinite;
  font-weight: 500;
}

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

/* Animated Particles */
.boot-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.boot-particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #00d9ff;
  border-radius: 50%;
  opacity: 0.4;
  animation: particleFloat 8s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(0, 217, 255, 0.6);
}

.boot-particle:nth-child(1) {
  left: 15%;
  top: 25%;
  animation-delay: 0s;
}

.boot-particle:nth-child(2) {
  left: 85%;
  top: 15%;
  animation-delay: 1.5s;
}

.boot-particle:nth-child(3) {
  left: 50%;
  top: 75%;
  animation-delay: 3s;
}

.boot-particle:nth-child(4) {
  left: 5%;
  top: 85%;
  animation-delay: 4.5s;
}

.boot-particle:nth-child(5) {
  left: 95%;
  top: 65%;
  animation-delay: 6s;
}

@keyframes particleFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
    opacity: 0.4;
  }
  50% {
    transform: translate(30px, -30px) scale(1.3);
    opacity: 0.8;
  }
}

/* Exit Animation */
#boot-overlay.boot-exit {
  animation: fadeOutUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: none !important;
}

@keyframes fadeOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-40px);
  }
}

/* Responsive */
@media (max-width: 600px) {
  /* Boot overlay sizing on mobile — JS controls display */
  #boot-overlay {
    position: fixed !important;
    z-index: 999999 !important;
    min-height: 100vh !important;
    min-height: -webkit-fill-available !important;
  }

  .boot-content {
    max-width: 90%;
    padding: 50px 30px;
  }

  .boot-title h1 {
    font-size: 28px;
    letter-spacing: 1px;
  }

  .boot-subtitle {
    font-size: 15px;
    letter-spacing: 2px;
  }

  .boot-text {
    font-size: 13px;
  }

  .boot-logo {
    width: 100px;
    height: 100px;
  }

  .boot-logo-text {
    font-size: 44px;
  }

  .boot-gradient-1,
  .boot-gradient-2 {
    width: 350px;
    height: 350px;
  }

  .boot-logo-container {
    margin-bottom: 40px;
  }

  .boot-progress-bar {
    height: 5px;
  }

  /* Simplify animations on mobile for better performance */
  .boot-gradient-1,
  .boot-gradient-2 {
    animation-duration: 20s;
  }

  .boot-particle {
    animation-duration: 12s;
  }
}

/* ── LANDSCAPE MOBILE / SHORT SCREENS ──────────────────── */
@media (max-height: 500px) {
  .boot-content {
    padding: 20px 30px;
    max-height: 95vh;
    overflow-y: auto;
  }
  .boot-logo-container {
    margin-bottom: 20px;
  }
  .boot-logo {
    width: 60px;
    height: 60px;
  }
  .boot-logo-text {
    font-size: 32px;
  }
  .boot-title h1 {
    font-size: 24px;
  }
  .boot-messages {
    height: 40px;
    margin-bottom: 20px;
  }
}

/* Light Mode */
body.light-mode #boot-overlay {
  background: linear-gradient(135deg, #f5f7ff 0%, #e8ecff 50%, #f0f4ff 100%);
}

body.light-mode .boot-gradient-1 {
  background: radial-gradient(circle, rgba(37, 99, 235, 0.2) 0%, transparent 70%);
}

body.light-mode .boot-gradient-2 {
  background: radial-gradient(circle, rgba(124, 58, 237, 0.2) 0%, transparent 70%);
}

body.light-mode .boot-content {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(37, 99, 235, 0.15);
  box-shadow: 0 8px 32px rgba(37, 99, 235, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

body.light-mode .boot-title h1 {
  color: #1a1f3a;
  text-shadow: 0 2px 10px rgba(37, 99, 235, 0.15);
}

body.light-mode .boot-subtitle {
  color: #2563eb;
}

body.light-mode .boot-text {
  color: #2563eb;
}

body.light-mode .boot-progress-bar {
  background: rgba(37, 99, 235, 0.1);
}

body.light-mode .boot-progress-fill {
  background: linear-gradient(90deg, #2563eb 0%, #7c3aed 50%, #2563eb 100%);
  box-shadow: 0 0 15px rgba(37, 99, 235, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

body.light-mode .boot-percent {
  color: #2563eb;
}

body.light-mode .boot-hint {
  color: rgba(26, 31, 58, 0.6);
}

body.light-mode .boot-particle {
  background: #2563eb;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.6);
}

/* Neon Mode */
body.neon-mode #boot-overlay {
  background: linear-gradient(135deg, #0d001a 0%, #1a0033 25%, #0d0d2b 50%, #1a0033 75%, #0d001a 100%);
}

body.neon-mode .boot-gradient-1 {
  background: radial-gradient(circle, rgba(224, 64, 251, 0.3) 0%, transparent 70%);
}

body.neon-mode .boot-gradient-2 {
  background: radial-gradient(circle, rgba(0, 255, 200, 0.2) 0%, transparent 70%);
}

body.neon-mode .boot-content {
  background: rgba(13, 0, 26, 0.6);
  border: 1px solid rgba(224, 64, 251, 0.3);
  box-shadow: 0 8px 32px rgba(224, 64, 251, 0.15), inset 0 1px 1px rgba(0, 255, 200, 0.1);
}

body.neon-mode .boot-title h1 {
  color: #e040fb;
  text-shadow: 0 2px 10px rgba(224, 64, 251, 0.4), 0 0 20px rgba(224, 64, 251, 0.2);
}

body.neon-mode .boot-subtitle {
  color: #00ffc8;
  text-shadow: 0 0 10px rgba(0, 255, 200, 0.5);
}

body.neon-mode .boot-text {
  color: #00ffc8;
  text-shadow: 0 0 8px rgba(0, 255, 200, 0.4);
}

body.neon-mode .boot-progress-bar {
  background: rgba(224, 64, 251, 0.15);
}

body.neon-mode .boot-progress-fill {
  background: linear-gradient(90deg, #e040fb 0%, #00ffc8 50%, #e040fb 100%);
  box-shadow: 0 0 20px rgba(224, 64, 251, 0.8), 0 0 10px rgba(0, 255, 200, 0.6), inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

body.neon-mode .boot-percent {
  color: #00ffc8;
  text-shadow: 0 0 8px rgba(0, 255, 200, 0.5);
}

body.neon-mode .boot-hint {
  color: rgba(0, 255, 200, 0.7);
  text-shadow: 0 0 8px rgba(0, 255, 200, 0.3);
}

body.neon-mode .boot-particle {
  background: #e040fb;
  box-shadow: 0 0 15px rgba(224, 64, 251, 0.8), 0 0 8px rgba(0, 255, 200, 0.4);
}

body.neon-mode .boot-logo-text {
  background: linear-gradient(135deg, #e040fb 0%, #00ffc8 50%, #e040fb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(224, 64, 251, 0.4);
  filter: drop-shadow(0 0 20px rgba(0, 255, 200, 0.3));
}

body.neon-mode .boot-logo-ring {
  border-top-color: #e040fb;
  border-right-color: #00ffc8;
  border-bottom-color: rgba(224, 64, 251, 0.3);
  box-shadow: 0 0 30px rgba(224, 64, 251, 0.5), inset 0 0 30px rgba(0, 255, 200, 0.2);
}
