
:root {
  --loader-primary: #1e40af;      /* Medical Blue */
  --loader-secondary: #10b981;    /* Medical Green */
  --loader-accent: #f59e0b;       /* Warning Amber */
  --loader-light: #f5f7fa;        /* Hospital White */
  --loader-dark: #1f2937;         /* Dark Gray */
}

/* Loading Container */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--loader-light) 0%, #e8f4f8 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 0.5s ease-out;
  pointer-events: auto;
}

/* Hide loader when app is ready */
#app:not(:empty) ~ .loader-wrapper,
.loader-wrapper.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Main Loader Container */
.loader-container {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
}


/* Modern Clean Spinner */
.modern-spinner {
  position: relative;
  width: 70px;
  height: 70px;
  z-index: 10;
}

/* Outer rotating ring */
.spinner-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(30, 64, 175, 0.1);
  border-top-color: var(--loader-primary);
  border-right-color: var(--loader-secondary);
  border-radius: 50%;
  animation: spin-rotate 1.8s linear infinite;
}

.spinner-circle:nth-child(2) {
  width: 85%;
  height: 85%;
  top: 7.5%;
  left: 7.5%;
  border-top-color: var(--loader-secondary);
  border-right-color: transparent;
  animation: spin-rotate-reverse 1.4s linear infinite;
}

.spinner-circle:nth-child(3) {
  display: none;
}

/* Rotation animations */
@keyframes spin-rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin-rotate-reverse {
  0% {
    transform: rotate(360deg);
  }
  100% {
    transform: rotate(0deg);
  }
}

/* Center medical cross badge */
.stethoscope-icon {
  position: absolute;
  width: 32px;
  height: 32px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  color: var(--loader-primary);
  filter: drop-shadow(0 1px 3px rgba(30, 64, 175, 0.2));
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Loading Text */
.loader-text-wrapper {
  text-align: center;
  margin-top: 8px;
}

.loader-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--loader-dark);
  margin-bottom: 4px;
  letter-spacing: -0.5px;
}

.loader-subtitle {
  font-size: 11px;
  color: var(--loader-primary);
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  opacity: 0.8;
  animation: text-fade 1.5s ease-in-out infinite;
}

@keyframes text-fade {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Status indicator dots */
.status-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--loader-secondary);
  animation: status-bounce 1.4s infinite;
}

.dot:nth-child(1) {
  animation-delay: 0s;
}

.dot:nth-child(2) {
  animation-delay: 0.2s;
}

.dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes status-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .loader-container {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
  }

  .modern-spinner {
    width: 60px;
    height: 60px;
  }

  .stethoscope-icon {
    width: 28px;
    height: 28px;
  }

  .loader-title {
    font-size: 16px;
  }

  .loader-subtitle {
    font-size: 10px;
    letter-spacing: 1px;
  }
}

@media (max-width: 480px) {
  .loader-container {
    width: 90px;
    height: 90px;
    margin-bottom: 8px;
  }

  .modern-spinner {
    width: 55px;
    height: 55px;
  }

  .stethoscope-icon {
    width: 24px;
    height: 24px;
  }

  .loader-title {
    font-size: 14px;
  }

  .loader-subtitle {
    font-size: 9px;
    letter-spacing: 0.8px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .loader-wrapper,
  .loader-pulse,
  .heart-icon,
  .center-dot,
  .bar,
  .loader-subtitle,
  .dot {
    animation: none !important;
    transition: none !important;
  }
}

/* Ensure smooth transition when app loads */
#app {
  transition: opacity 0.3s ease-in;
}
