* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-main: #020317;
  --bg-elevated: rgba(12, 16, 48, 0.85);
  --bg-glass: rgba(14, 20, 54, 0.7);
  --border-glass: rgba(255, 255, 255, 0.12);
  --accent: #7f5cff;
  --accent-soft: #26ffe6;
  --accent-danger: #ff3366;
  --text-main: #f7f7ff;
  --text-muted: #a6b0d8;
  --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.55);
  --radius-lg: 22px;
  --radius-md: 14px;
  --radius-pill: 999px;
  --nav-height: 72px;
}

html,
body {
  height: 100%;
}

body {
  font-family: "Poppins", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at top, #1b1640 0, #020317 55%, #000 100%);
  overflow-x: hidden;
}

.starfield {
  position: relative;
}

.starfield::before,
.starfield::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    radial-gradient(2px 2px at 20% 20%, rgba(255, 255, 255, 0.7) 0, transparent 60%),
    radial-gradient(1.5px 1.5px at 80% 60%, rgba(255, 255, 255, 0.5) 0, transparent 55%),
    radial-gradient(1.8px 1.8px at 40% 80%, rgba(255, 255, 255, 0.75) 0, transparent 60%);
  opacity: 0.75;
}

.starfield::after {
  background-image:
    radial-gradient(1.2px 1.2px at 10% 70%, rgba(255, 255, 255, 0.6) 0, transparent 55%),
    radial-gradient(1.4px 1.4px at 60% 30%, rgba(255, 255, 255, 0.6) 0, transparent 60%),
    radial-gradient(2px 2px at 90% 10%, rgba(255, 255, 255, 0.85) 0, transparent 55%);
  filter: blur(0.2px);
  opacity: 0.6;
}

main {
  padding-top: var(--nav-height);
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  z-index: 50;
  backdrop-filter: blur(20px);
  background: linear-gradient(90deg, rgba(2, 3, 23, 0.92), rgba(18, 13, 58, 0.88));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar__logo {
  font-family: "Orbitron", monospace;
  font-weight: 700;
  letter-spacing: 0.15em;
  font-size: 0.95rem;
  text-transform: uppercase;
}

.navbar__logo span {
  color: var(--accent-soft);
}

.navbar__links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.navbar__links a {
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.navbar__links a:hover {
  background: rgba(131, 124, 255, 0.25);
  color: var(--text-main);
  transform: translateY(-1px);
}

.navbar__links a.active {
  background: rgba(127, 92, 255, 0.4);
  color: #fff;
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(7, 9, 32, 0.9);
  cursor: pointer;
}

.navbar__toggle span {
  width: 18px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  margin: 0 auto;
}

.navbar__user-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  margin-left: 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(7, 9, 32, 0.9);
  cursor: pointer;
}

.navbar__user-toggle span {
  width: 16px;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  margin: 0 auto;
}

.navbar__user-dropdown {
  position: absolute;
  top: calc(var(--nav-height) - 0.4rem);
  right: 1.75rem;
  min-width: 160px;
  padding: 0.5rem 0.6rem;
  border-radius: 14px;
  background: rgba(4, 6, 30, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.75);
  display: none;
  flex-direction: column;
  gap: 0.3rem;
  z-index: 60;
}

.navbar__user-dropdown a,
.navbar__user-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-main);
  font-size: 0.85rem;
  cursor: pointer;
}

.navbar__user-dropdown a:hover,
.navbar__user-dropdown button:hover {
  background: rgba(127, 92, 255, 0.24);
}

.navbar__user-logout {
  color: var(--accent-danger);
}

.navbar__user-dropdown--open {
  display: flex;
}

.section {
  padding: 4rem min(7vw, 4.5rem);
}

.section--glass {
  background: radial-gradient(circle at top, rgba(24, 26, 76, 0.96), rgba(2, 3, 23, 0.96));
}

.section--dark {
  background: radial-gradient(circle at bottom, #040619, #020317 55%, #000 100%);
}

.section__header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section__header h2 {
  font-family: "Orbitron", sans-serif;
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section__header p {
  color: var(--text-muted);
  margin-top: 0.7rem;
}

.grid {
  display: grid;
  gap: 1.75rem;
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  border-radius: var(--radius-lg);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-soft);
}

.card--glass {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(18px) saturate(140%);
}

.card h3 {
  font-family: "Orbitron", sans-serif;
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
}

.card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.18s ease,
    color 0.18s ease;
}

.btn--primary {
  background: linear-gradient(135deg, #7f5cff, #26ffe6);
  color: #050816;
  box-shadow: 0 18px 30px rgba(14, 116, 144, 0.4);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 40px rgba(14, 116, 144, 0.65);
}

.btn--outline {
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: var(--text-main) !important;
}

.btn--ghost {
  background: rgba(6, 10, 40, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--text-main);
}

.btn--ghost:hover {
  background: rgba(16, 22, 68, 0.96);
}

.btn--glow {
  box-shadow: 0 0 25px rgba(127, 92, 255, 0.8);
}

.btn--sm {
  padding: 0.55rem 1.15rem;
  font-size: 0.8rem;
}

.footer {
  padding: 1.7rem 1.5rem 2.2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.preloader {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, #1b1640, #020317 50%, #000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.preloader-planet {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 20%, #fff, #7f5cff 45%, #050816 75%);
  box-shadow: 0 0 40px rgba(127, 92, 255, 0.8);
  position: relative;
  animation: spin 1.6s linear infinite;
}

.preloader-planet::after {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  border-top: 2px solid rgba(255, 255, 255, 0.65);
  border-bottom: 2px solid rgba(127, 92, 255, 0.9);
  border-left: transparent;
  border-right: transparent;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeInUp 0.8s ease forwards;
}

.fade-in-up.delay-1 {
  animation-delay: 0.16s;
}

.fade-in-up.delay-2 {
  animation-delay: 0.32s;
}

.footer a {
  color: var(--accent-soft);
}

.shooting-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.shooting-stars::before,
.shooting-stars::after {
  content: "";
  position: absolute;
  top: -20%;
  left: -10%;
  width: 2px;
  height: 80px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), transparent);
  opacity: 0.5;
  transform: rotate(35deg);
  animation: shooting 5s linear infinite;
}

.shooting-stars::after {
  left: 60%;
  top: -25%;
  animation-delay: 2.3s;
}

.footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: radial-gradient(circle at top, rgba(24, 26, 76, 0.8), rgba(2, 3, 23, 0.96));
}

input,
button,
textarea,
select {
  font-family: inherit;
}

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

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(16px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shooting {
  0% {
    transform: translate3d(0, 0, 0) rotate(35deg);
    opacity: 0;
  }
  40% {
    opacity: 0.9;
  }
  100% {
    transform: translate3d(140vw, 90vh, 0) rotate(35deg);
    opacity: 0;
  }
}

@media (max-width: 960px) {
  .navbar__links {
    position: fixed;
    top: var(--nav-height);
    right: 0.75rem;
    left: 0.75rem;
    background: rgba(4, 6, 24, 0.96);
    border-radius: 18px;
    padding: 0.75rem 0.6rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    transform: translateY(-24px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }

  .navbar__links--open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .navbar__toggle {
    display: flex;
  }

  .grid--3 {
    grid-template-columns: 1fr;
  }

  .section {
    padding-inline: 1.25rem;
  }
}

/* Chatbot Floating Action Button */
.chatbot-fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #7f5cff, #26ffe6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(127, 92, 255, 0.4);
  transition: all 0.3s ease;
  z-index: 1000;
}

.chatbot-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(127, 92, 255, 0.6);
  background: linear-gradient(135deg, #8f6dff, #36ffff);
}

.chatbot-fab svg {
  width: 24px;
  height: 24px;
}

@media (max-width: 768px) {
  .chatbot-fab {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
  }
  
  .chatbot-fab svg {
    width: 20px;
    height: 20px;
  }
}
