/* ==========================================================================
   Faculty Portal - Loading Screen
   Design: "Academic Elegance" - Sophisticated hexagonal lattice
   Representing interconnected knowledge and curriculum networks
   ========================================================================== */

/* 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%,
    #055aa6 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.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* 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.08) 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.15) 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: 40px;
  animation: logo-breathe 4s ease-in-out infinite;
}

@keyframes logo-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}

/* ==========================================================================
   Hexagonal Lattice - Knowledge Network
   ========================================================================== */

.hex-lattice {
  position: relative;
  width: 140px;
  height: 120px;
  margin-bottom: 40px;
}

/* Single hexagon shape using clip-path */
.hex {
  position: absolute;
  width: 40px;
  height: 46px;
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  will-change: transform, opacity;
}

/* Hexagon positioning - honeycomb pattern */
/* Top row */
.hex-1 {
  left: 30px;
  top: 0;
  background: linear-gradient(135deg, #f26a24 0%, #e85a14 100%);
  box-shadow: 0 4px 20px rgba(242, 106, 36, 0.4);
  animation: hex-pulse 3s ease-in-out infinite;
}

.hex-2 {
  left: 70px;
  top: 0;
  background: linear-gradient(135deg, #0c7fd4 0%, #0968b8 100%);
  box-shadow: 0 4px 16px rgba(5, 90, 166, 0.4);
  animation: hex-pulse 3s ease-in-out infinite 0.3s;
}

/* Middle row */
.hex-3 {
  left: 10px;
  top: 35px;
  background: linear-gradient(135deg, #0968b8 0%, #055aa6 100%);
  box-shadow: 0 4px 16px rgba(5, 90, 166, 0.4);
  animation: hex-pulse 3s ease-in-out infinite 0.6s;
}

.hex-4 {
  left: 50px;
  top: 35px;
  background: linear-gradient(135deg, #f57c3d 0%, #f26a24 100%);
  box-shadow: 0 4px 20px rgba(242, 106, 36, 0.5);
  animation: hex-pulse 3s ease-in-out infinite 0.15s;
}

.hex-5 {
  left: 90px;
  top: 35px;
  background: linear-gradient(135deg, #055aa6 0%, #042d5a 100%);
  box-shadow: 0 4px 16px rgba(5, 90, 166, 0.35);
  animation: hex-pulse 3s ease-in-out infinite 0.75s;
}

/* Bottom row */
.hex-6 {
  left: 30px;
  top: 70px;
  background: linear-gradient(135deg, #0c7fd4 0%, #0968b8 100%);
  box-shadow: 0 4px 16px rgba(5, 90, 166, 0.4);
  animation: hex-pulse 3s ease-in-out infinite 0.45s;
}

.hex-7 {
  left: 70px;
  top: 70px;
  background: linear-gradient(135deg, #ff8243 0%, #f26a24 100%);
  box-shadow: 0 4px 18px rgba(242, 106, 36, 0.45);
  animation: hex-pulse 3s ease-in-out infinite 0.9s;
}

/* Hexagon pulse animation */
@keyframes hex-pulse {
  0%, 100% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

/* ==========================================================================
   Glow Effect - Central Ambient
   ========================================================================== */

.hex-glow {
  position: absolute;
  width: 100px;
  height: 80px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(
    ellipse at center,
    rgba(242, 106, 36, 0.25) 0%,
    rgba(5, 90, 166, 0.15) 40%,
    transparent 70%
  );
  filter: blur(15px);
  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: 180px;
  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.3) 20%,
    #f26a24 50%,
    rgba(242, 106, 36, 0.3) 80%,
    transparent 100%
  );
  background-size: 200% 100%;
  border-radius: 1px;
  animation: progress-slide 1.8s 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: 14px;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media screen and (max-width: 480px) {
  .loading-logo {
    height: 44px;
    margin-bottom: 32px;
  }

  .hex-lattice {
    transform: scale(0.85);
    margin-bottom: 32px;
  }

  .progress-track {
    width: 150px;
  }

  .loading-text {
    font-size: 13px;
  }
}

/* ==========================================================================
   Accessibility: Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  .loading-logo,
  .hex,
  .hex-glow,
  .progress-fill {
    animation: none !important;
  }

  .hex {
    opacity: 0.85;
  }

  .hex-glow {
    opacity: 0.6;
  }

  .progress-fill {
    background: linear-gradient(90deg, transparent 20%, #f26a24 50%, transparent 80%);
    background-size: 100% 100%;
  }
}
