/* ==========================================================================
   Account Management - Loading Screen
   Design: "Node Network" - Connected constellation of nodes
   Representing the account as the nexus connecting all ScholarRx features
   ========================================================================== */

/* Core Container */
.application-loading {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(
    145deg,
    #011730 0%,
    #042d5a 30%,
    #0675D8 70%,
    #0968b8 100%
  );
  font-family: 'Roboto Flex', sans-serif;
  z-index: 10000;
  overflow: hidden;
  box-sizing: border-box;
}

/* ==========================================================================
   Atmospheric Background
   ========================================================================== */

.loading-atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Subtle grid pattern for depth */
.loading-grid-pattern {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 56px 56px;
}

/* Ambient gradient orbs */
.loading-atmosphere::before {
  content: '';
  position: absolute;
  width: 600px;
  height: 600px;
  top: -200px;
  right: -150px;
  background: radial-gradient(circle, rgba(242, 106, 36, 0.1) 0%, transparent 60%);
  border-radius: 50%;
}

.loading-atmosphere::after {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  bottom: -150px;
  left: -100px;
  background: radial-gradient(circle, rgba(5, 90, 166, 0.18) 0%, transparent 60%);
  border-radius: 50%;
}

/* ==========================================================================
   Content Container
   ========================================================================== */

.loading-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Logo
   ========================================================================== */

.loading-logo {
  height: 56px;
  margin-bottom: 36px;
  animation: logo-breathe 3.5s ease-in-out infinite;
}

@keyframes logo-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ==========================================================================
   Node Network - Account Connectivity
   6 solid nodes in a constellation pattern with connecting lines,
   representing the interconnected features of the account hub
   ========================================================================== */

.node-network {
  position: relative;
  width: 160px;
  height: 120px;
  margin-bottom: 40px;
}

/* Connecting lines SVG - sits behind the nodes */
.network-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Shared node base styles */
.node {
  position: absolute;
  border-radius: 50%;
  will-change: transform, opacity;
}

/* ==========================================================================
   Individual Nodes - Positioned for a natural network pattern
   Coordinates match SVG line endpoints for alignment
   ========================================================================== */

/* Node 1 - Large orange (hero, top-center) */
.node-1 {
  width: 28px;
  height: 28px;
  left: 80px;
  top: 18px;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #f26a24 0%, #e85a14 100%);
  box-shadow: 0 4px 20px rgba(242, 106, 36, 0.5);
  animation: node-pulse 3s ease-in-out infinite;
}

/* Node 2 - Medium blue (right) */
.node-2 {
  width: 22px;
  height: 22px;
  left: 138px;
  top: 46px;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #0c7fd4 0%, #0968b8 100%);
  box-shadow: 0 4px 16px rgba(5, 90, 166, 0.45);
  animation: node-pulse 3s ease-in-out infinite 0.3s;
}

/* Node 3 - Small orange (top-left) */
.node-3 {
  width: 14px;
  height: 14px;
  left: 22px;
  top: 14px;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #f57c3d 0%, #f26a24 100%);
  box-shadow: 0 3px 12px rgba(242, 106, 36, 0.4);
  animation: node-pulse 3s ease-in-out infinite 0.6s;
}

/* Node 4 - Large blue (center-left) */
.node-4 {
  width: 24px;
  height: 24px;
  left: 26px;
  top: 68px;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #0968b8 0%, #055aa6 100%);
  box-shadow: 0 4px 18px rgba(5, 90, 166, 0.5);
  animation: node-pulse 3s ease-in-out infinite 0.15s;
}

/* Node 5 - Medium orange (bottom-center) */
.node-5 {
  width: 18px;
  height: 18px;
  left: 88px;
  top: 104px;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #ff8243 0%, #f26a24 100%);
  box-shadow: 0 4px 14px rgba(242, 106, 36, 0.45);
  animation: node-pulse 3s ease-in-out infinite 0.75s;
}

/* Node 6 - Small blue (bottom-right) */
.node-6 {
  width: 12px;
  height: 12px;
  left: 140px;
  top: 96px;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #055aa6 0%, #042d5a 100%);
  box-shadow: 0 3px 10px rgba(5, 90, 166, 0.4);
  animation: node-pulse 3s ease-in-out infinite 0.45s;
}

/* Node pulse animation - matches hex-pulse pattern */
@keyframes node-pulse {
  0%, 100% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

/* ==========================================================================
   Glow Effect - Central Ambient
   ========================================================================== */

.node-glow {
  position: absolute;
  width: 110px;
  height: 90px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(242, 106, 36, 0.2) 0%,
    rgba(6, 117, 216, 0.12) 45%,
    transparent 70%
  );
  filter: blur(14px);
  animation: glow-breathe 3.5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes glow-breathe {
  0%, 100% {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.15);
  }
}

/* ==========================================================================
   Progress Indicator
   ========================================================================== */

.loading-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.progress-track {
  width: 190px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 1px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(242, 106, 36, 0.35) 20%,
    #f26a24 50%,
    rgba(242, 106, 36, 0.35) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  border-radius: 1px;
  animation: progress-slide 1.6s ease-in-out infinite;
}

@keyframes progress-slide {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.loading-text {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media screen and (max-width: 480px) {
  .loading-logo {
    height: 44px;
    margin-bottom: 28px;
  }

  .node-network {
    transform: scale(0.82);
    margin-bottom: 28px;
  }

  .progress-track {
    width: 155px;
  }

  .loading-text {
    font-size: 12px;
  }
}

/* ==========================================================================
   Accessibility: Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .loading-logo,
  .node,
  .node-glow,
  .progress-fill {
    animation: none !important;
  }

  .node {
    opacity: 0.85;
  }

  .node-glow {
    opacity: 0.6;
  }

  .progress-fill {
    background: linear-gradient(90deg, transparent 20%, #f26a24 50%, transparent 80%);
    background-size: 100% 100%;
  }
}
