body, html {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* --- LIGHT MODE (DEFAULT) --- */
body {
  /* Surface color 0xFFF1F5F9 as the primary background */
  background: linear-gradient(180deg, #F1F5F9 0%, #E2E8F0 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

.loading-text {
  margin-top: 25px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.1em;
  color: #1E293B; /* Slate dark text for high legibility on light gray */
  font-weight: 500;
}

#progress-bar-container {
  width: 200px;
  height: 4px;
  background-color: rgba(30, 41, 59, 0.1); /* Subtle track */
  border-radius: 10px;
  margin-top: 20px;
  overflow: hidden;
  position: relative;
}

#progress-bar {
  width: 50%;
  height: 100%;
  background-color: #020617; /* Dark accent for the bar */
  border-radius: 10px;
  position: absolute;
  top: 0;
  animation: indeterminate-progress 2s linear infinite;
}

/* --- DARK MODE (ONLY IF CLASS IS APPLIED) --- */
body.dark-mode {
  background: linear-gradient(181.23deg, #020617 20.64%, #005284 98.95%);
}

body.dark-mode .loading-text {
  color: #F1F5F9;
}

body.dark-mode #progress-bar-container {
  background-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode #progress-bar {
  background-color: #00B2FF;
}

/* --- ANIMATIONS --- */
#app-loader {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
}

#app-loader img {
  width: 110px;
  height: 110px;
  animation: pulse 2.5s infinite ease-in-out;
}

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

@keyframes indeterminate-progress {
  0% { left: -50%; }
  100% { left: 100%; }
}