/* ============================================================
   ENHANCEMENTS.CSS
   Visual overhaul for dark-themed science models website
   Palette: bg #000, text #eae9f1, accent #7c3aed, secondary #a78bfa
   Font: Outfit
   ============================================================ */

/* ------------------------------------------------------------
   1. LOADING SCREEN
   ------------------------------------------------------------ */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.loader-logo {
  width: 60px;
  animation: fadeIn 0.5s ease forwards;
}

.loader-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.loader-bar-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  border-radius: 3px;
  animation: loaderFill 1.2s ease forwards;
}

.page-loader.loaded {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

@keyframes loaderFill {
  to {
    width: 100%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------------------------------
   2. SCROLL PROGRESS BAR
   ------------------------------------------------------------ */

.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #7c3aed, #a855f7, #7c3aed);
  z-index: 1001;
  transition: width 0.1s linear;
}

/* ------------------------------------------------------------
   3. CUSTOM CURSOR (desktop only)
   ------------------------------------------------------------ */

.custom-cursor {
  position: fixed;
  width: 8px;
  height: 8px;
  background: #a78bfa;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: difference;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 0.2s ease, height 0.2s ease, background 0.2s ease;
}

.cursor-follower {
  position: fixed;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(167, 139, 250, 0.5);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: width 0.3s ease, height 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.cursor-follower.hover {
  width: 56px;
  height: 56px;
  border-color: rgba(124, 58, 237, 0.8);
  background: rgba(124, 58, 237, 0.05);
}

body.cursor-active .custom-cursor,
body.cursor-active .cursor-follower {
  opacity: 1;
}

body.cursor-active * {
  cursor: none;
}

body.cursor-active input,
body.cursor-active textarea,
body.cursor-active select,
body.cursor-active input *,
body.cursor-active textarea *,
body.cursor-active select * {
  cursor: auto;
}

/* Section 4 removed (page transitions disabled) */

/* ------------------------------------------------------------
   5. NAVBAR GLASS EFFECT
   ------------------------------------------------------------ */

.topbar.glass {
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.topbar.scrolled {
  background: rgba(0, 0, 0, 0.85);
  border-bottom-color: rgba(124, 58, 237, 0.2);
}

/* ------------------------------------------------------------
   6. HERO 3D CANVAS
   ------------------------------------------------------------ */

.hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-top {
  position: relative;
  min-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 5vw;
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-top .hero-content h1 {
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.8);
}

.hero-top .hero-content p {
  text-shadow: 0 1px 15px rgba(0, 0, 0, 0.7);
}

/* ------------------------------------------------------------
   7. SCROLL REVEAL UTILITIES
   ------------------------------------------------------------ */

.reveal-up {
  opacity: 0;
  transform: translateY(60px);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
}

.stagger-child {
  opacity: 0;
  transform: translateY(40px);
}

/* ------------------------------------------------------------
   8. CARD GLASSMORPHISM
   ------------------------------------------------------------ */

.model-card.glass-card {
  background: rgba(20, 20, 30, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.model-card.glass-card:hover {
  border-color: rgba(124, 58, 237, 0.4);
}

/* Category glow on hover */
.model-card[data-category="physics"]:hover {
  box-shadow: 0 8px 30px rgba(30, 58, 95, 0.4);
}

.model-card[data-category="chemistry"]:hover {
  box-shadow: 0 8px 30px rgba(26, 77, 46, 0.4);
}

.model-card[data-category="biology"]:hover {
  box-shadow: 0 8px 30px rgba(74, 30, 46, 0.4);
}

.model-card[data-category="math"]:hover {
  box-shadow: 0 8px 30px rgba(74, 58, 30, 0.4);
}

/* ------------------------------------------------------------
   9. SHIMMER BUTTON EFFECT
   ------------------------------------------------------------ */

.shimmer-btn {
  position: relative;
  overflow: hidden;
}

.shimmer-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(to right,
      transparent,
      rgba(255, 255, 255, 0.1),
      transparent);
  transform: rotate(30deg) translateX(-100%);
  transition: none;
}

.shimmer-btn:hover::after {
  transform: rotate(30deg) translateX(100%);
  transition: transform 0.6s ease;
}

/* ------------------------------------------------------------
   10. CATEGORY 3D CANVAS HEADERS
   ------------------------------------------------------------ */

.category-header-enhanced {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.category-canvas {
  width: 180px;
  height: 140px;
  border-radius: 12px;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   11. ANIMATED COUNTER
   ------------------------------------------------------------ */

.stat-counter {
  display: inline-block;
  min-width: 60px;
}

/* ------------------------------------------------------------
   12. FLOATING ANIMATION (about page logo)
   ------------------------------------------------------------ */

.float-animation {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* ------------------------------------------------------------
   13. GLITCH EFFECT (404 page)
   ------------------------------------------------------------ */

.glitch {
  position: relative;
  animation: glitch 2s infinite;
}

@keyframes glitch {

  0%,
  90%,
  100% {
    transform: translate(0);
  }

  92% {
    transform: translate(-2px, 2px);
  }

  94% {
    transform: translate(2px, -2px);
  }

  96% {
    transform: translate(-1px, -1px);
  }

  98% {
    transform: translate(1px, 1px);
  }
}

/* ------------------------------------------------------------
   14. CONFETTI (thank you page)
   ------------------------------------------------------------ */

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  z-index: 100;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  to {
    top: 100vh;
    transform: rotate(720deg);
    opacity: 0;
  }
}

/* ------------------------------------------------------------
   15. FORM ENHANCEMENTS
   ------------------------------------------------------------ */

.form-group-enhanced {
  position: relative;
}

.form-group-enhanced input:focus,
.form-group-enhanced textarea:focus,
.form-group-enhanced select:focus {
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
  border-color: #7c3aed;
  outline: none;
}

.submit-btn.loading {
  pointer-events: none;
  position: relative;
}

.submit-btn.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid transparent;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------
   16. RESPONSIVE - DISABLE ENHANCEMENTS ON MOBILE
   ------------------------------------------------------------ */

/* Reduce about page header gap (original style.css has 140px top) */
.page-header {
  padding-top: 80px;
  padding-bottom: 24px;
}

.about-logo {
  margin-top: 20px;
  margin-bottom: 16px;
  display: block !important;
  width: 140px;
  height: auto;
}

@keyframes floatAnim {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.float-animation {
  animation: floatAnim 3s ease-in-out infinite;
}

/* Tablet */
@media (max-width: 1024px) {
  .hero-top {
    min-height: 70vh;
  }

  .hero-content {
    padding: 0 8vw;
  }

  .hero-canvas {
    opacity: 0.25;
  }
}

/* Mobile */
@media (max-width: 768px) {

  .custom-cursor,
  .cursor-follower {
    display: none !important;
  }

  .hero-top {
    min-height: auto !important;
    padding-top: 90px !important;
    padding-bottom: 40px !important;
  }

  .hero-canvas {
    opacity: 0.15;
  }

  .hero-content {
    padding: 0 6vw;
  }

  .category-canvas {
    display: none;
  }

  .category-header-enhanced {
    padding: 0;
  }

  .page-header {
    padding: 70px 5vw 16px !important;
  }

  .page-header .about-logo {
    margin-bottom: 8px !important;
  }

  .about-logo {
    width: 120px !important;
    margin-bottom: 16px !important;
  }

  .about-container {
    padding: 24px 5vw 40px !important;
  }

  .contact-container {
    padding: 24px 4vw 60px !important;
  }

  .policy-container {
    padding: 24px 4vw 60px !important;
  }

  .catalogue {
    padding: 24px 4vw 20px !important;
  }

  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .stagger-child {
    opacity: 1 !important;
    transform: none !important;
  }

}

/* Small phones */
@media (max-width: 480px) {
  .hero-top {
    padding-top: 70px !important;
    padding-bottom: 30px !important;
  }

  .page-header {
    padding: 70px 5vw 20px !important;
  }

  .hero-btn {
    padding: 12px 40px;
    font-size: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  .reveal-up,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .stagger-child {
    opacity: 1 !important;
    transform: none !important;
  }

  .page-loader {
    display: none;
  }

  .confetti-piece {
    display: none;
  }

  .float-animation {
    animation: none;
  }

  .glitch {
    animation: none;
  }
}