/* --- 1. LOADER WRAPPER (To cover the entire screen) --- */
#loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000; /* Ensure it is on top of everything */
  background: #111; /* Dark background */
  display: flex;
  justify-content: center;
  align-items: center;
  /* Make the wrapper stack the logo and spinner */
  flex-direction: column; /* Stacks items vertically */
}

/* --- 2. THE SPINNER CONTAINER (Updated to hold the logo) --- */
#loader {
  display: inline-block;
  width: 360px;
  height: 360px;
  position: relative; /* CRITICAL: Allows absolute positioning of the logo */
  transform: rotate(45deg); /* Existing rotation for diamond look */
}

/* --- 3. LOGO STYLING: Centered and De-Rotated --- */
#loader-logo {
  position: absolute;
  /* Center it perfectly */
  top: 50%;
  left: 50%;

  /* CRITICAL: De-rotate the logo so it stays upright */
  /* It cancels out the 45deg rotation of the parent (#loader) */
  transform: translate(-50%, -50%) rotate(-45deg);

  /* Size adjustments */
  width: 240px; /* Make sure it fits comfortably inside the spinner */
}

/* --- 4. SPINNER PSEUDO-ELEMENTS --- */
#loader:before,
#loader:after {
  content: '';
  display: block;
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 5px solid transparent;
  border-top-color: #b56b5a; /* secondary color */
  border-right-color: #b56b5a;
  animation: pulse-spin 2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* Offset the second circle */
#loader:after {
  border-color: transparent;
  border-left-color: #b5985a; /* primary color */
  border-bottom-color: #b5985a;
  animation-delay: -1s; /* Start this one halfway through the cycle */
}

/* --- 3. THE ANIMATION KEYFRAMES --- */
@keyframes pulse-spin {
  0% {
    transform: scale(0.6) rotate(0deg);
    opacity: 0.1;
  }
  50% {
    transform: scale(1) rotate(180deg);
    opacity: 1;
  }
  100% {
    transform: scale(0.6) rotate(360deg);
    opacity: 0.1;
  }
}

.error-loading {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  top: 10em;
  font-size: 20px;
}
