@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* Design Tokens & Theme Setup */
:root {
  /* Colors */
  --color-primary: #0A84FF;      /* Apple/Stripe Blue */
  --color-secondary-1: #5AC8FA;  /* Cyan */
  --color-secondary-2: #64D2FF;  /* Ice Cyan */
  --color-success: #30D158;      /* Neon Green */
  --color-accent: #BF5AF2;       /* Neon Purple */
  --color-warning: #FF9F0A;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Theme: Dark Mode (Default) */
  --bg-color: #050505;
  --bg-gradient: radial-gradient(circle at 50% 50%, #0a0a14 0%, #050505 100%);
  --text-color: #F5F5F7;
  --text-muted: rgba(245, 245, 247, 0.6);
  --text-inverse: #050505;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-bg-hover: rgba(255, 255, 255, 0.09);
  --card-border: rgba(255, 255, 255, 0.1);
  --card-border-hover: rgba(255, 255, 255, 0.2);
  --nav-bg: rgba(5, 5, 5, 0.7);
  --nav-border: rgba(255, 255, 255, 0.08);
  --shadow-premium: 0 20px 40px rgba(0, 0, 0, 0.5);
  --glow-color: rgba(10, 132, 255, 0.25);
  --input-bg: rgba(255, 255, 255, 0.03);
  --input-border: rgba(255, 255, 255, 0.1);
}

html.light {
  /* Theme: Light Mode */
  --bg-color: #FAF9F6;
  --bg-gradient: radial-gradient(circle at 50% 50%, #f0f4ff 0%, #faf9f6 100%);
  --text-color: #1D1D1F;
  --text-muted: rgba(29, 29, 31, 0.6);
  --text-inverse: #FFFFFF;
  --card-bg: rgba(255, 255, 255, 0.6);
  --card-bg-hover: rgba(255, 255, 255, 0.85);
  --card-border: rgba(10, 132, 255, 0.15);
  --card-border-hover: rgba(10, 132, 255, 0.35);
  --nav-bg: rgba(250, 249, 230, 0.75);
  --nav-border: rgba(0, 0, 0, 0.08);
  --shadow-premium: 0 20px 40px rgba(10, 132, 255, 0.06);
  --glow-color: rgba(10, 132, 255, 0.12);
  --input-bg: rgba(0, 0, 0, 0.02);
  --input-border: rgba(0, 0, 0, 0.08);
}

/* Reset & Base Styles */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  overflow-x: hidden;
  font-family: var(--font-sans);
  background: var(--bg-color);
  background-image: var(--bg-gradient);
  color: var(--text-color);
  line-height: 1.6;
  scroll-behavior: auto; /* Handled by Lenis */
}

/* Three.js Canvas container */
#three-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -2;
  pointer-events: none;
}

/* Loader Screen */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #050505;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.8s ease;
}
#page-loader.fade-out {
  opacity: 0;
  visibility: hidden;
}
.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
}
.loader-logo-wrapper {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
}
.loader-logo-img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  animation: logoPulse 2s ease-in-out infinite;
  z-index: 5;
}
.loader-orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid transparent;
}
.loader-orbit-1 {
  width: 100px;
  height: 100px;
  border-top-color: var(--color-primary);
  border-bottom-color: rgba(10, 132, 255, 0.05);
  animation: spinClockwise 1.6s cubic-bezier(0.53, 0.21, 0.29, 0.87) infinite;
}
.loader-orbit-2 {
  width: 130px;
  height: 130px;
  border-left-color: var(--color-accent);
  border-right-color: rgba(191, 90, 242, 0.05);
  animation: spinCounterClockwise 2.2s cubic-bezier(0.53, 0.21, 0.29, 0.87) infinite;
}
.loader-orbit-3 {
  width: 76px;
  height: 76px;
  border-top-color: #30D158;
  border-bottom-color: rgba(48, 209, 88, 0.05);
  animation: spinClockwise 1.1s linear infinite;
  opacity: 0.7;
}
.loader-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 25px;
  background: linear-gradient(135deg, #FFFFFF 30%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 40px rgba(10, 132, 255, 0.35);
}
.loader-progress-bar {
  width: 200px;
  height: 3px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}
.loader-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 0 10px var(--color-primary);
  animation: loadProgress 2.8s cubic-bezier(0.075, 0.82, 0.165, 1) forwards;
}

@keyframes spinClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes spinCounterClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}
@keyframes logoPulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 15px rgba(10, 132, 255, 0.5)); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 30px rgba(10, 132, 255, 0.85)); }
}
@keyframes loadProgress {
  0% { width: 0%; }
  12% { width: 20%; }
  35% { width: 50%; }
  65% { width: 88%; }
  100% { width: 100%; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 5px;
  border: 2px solid var(--bg-color);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Custom Glow Cursor */
#custom-cursor {
  width: 20px;
  height: 20px;
  background: rgba(10, 132, 255, 0.4);
  border: 1.5px solid var(--color-primary);
  border-radius: 50%;
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 99999;
  mix-blend-mode: screen;
  transition: width 0.2s, height 0.2s, background-color 0.2s, border-color 0.2s;
  box-shadow: 0 0 15px var(--color-primary);
}
#custom-cursor-glow {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(10, 132, 255, 0.1) 0%, rgba(10, 132, 255, 0) 70%);
  position: fixed;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 99998;
  transition: transform 0.1s ease-out;
}
body.light #custom-cursor {
  background: rgba(10, 132, 255, 0.15);
  border: 1.5px solid var(--color-primary);
  mix-blend-mode: multiply;
  box-shadow: none;
}
body.light #custom-cursor-glow {
  background: radial-gradient(circle, rgba(10, 132, 255, 0.05) 0%, rgba(10, 132, 255, 0) 70%);
}

.cursor-hover {
  width: 50px !important;
  height: 50px !important;
  background: rgba(10, 132, 255, 0.1) !important;
  border-color: var(--color-accent) !important;
  box-shadow: 0 0 25px var(--color-accent) !important;
}

/* Global Navigation */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1.5px solid var(--nav-border);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

header.scrolled {
  padding: 10px 0;
  background: rgba(5, 5, 5, 0.85);
  box-shadow: var(--shadow-premium);
}
html.light header.scrolled {
  background: rgba(250, 249, 230, 0.9);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.5px;
  color: var(--text-color);
  transition: transform 0.3s ease;
  white-space: nowrap;
}
.logo-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary-1));
  border-radius: 8px;
  color: #FFF;
}
.logo-text span {
  color: var(--color-primary);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 25px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
  padding: 5px 0;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-color);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary-1));
  transition: width 0.3s ease;
}
.nav-link:hover::after, .nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* Buttons & Links */
.btn-login {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  font-size: 0.95rem;
  transition: opacity 0.3s;
}
.btn-login:hover {
  opacity: 0.8;
}

.btn-register {
  text-decoration: none;
  background: var(--color-primary);
  color: var(--text-inverse);
  padding: 10px 22px;
  border-radius: 30px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid var(--color-primary);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 15px rgba(10, 132, 255, 0.3);
}
.btn-register:hover {
  background: transparent;
  color: var(--text-color);
  box-shadow: none;
}

/* User Account Icon Dropdown */
.nav-user {
  position: relative;
  display: none; /* Shown dynamically via JS when logged in */
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.9rem;
}
.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: 12px;
  padding: 10px;
  width: 180px;
  box-shadow: var(--shadow-premium);
  display: none;
  flex-direction: column;
  gap: 5px;
}
.user-dropdown a, .user-dropdown button {
  background: none;
  border: none;
  color: var(--text-color);
  text-align: left;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}
.user-dropdown a:hover, .user-dropdown button:hover {
  background: rgba(255, 255, 255, 0.1);
}
.nav-user:hover .user-dropdown {
  display: flex;
}

/* Theme Switcher */
.theme-switch {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
  border: 1px solid var(--card-border);
}
.theme-switch:hover {
  background: var(--card-bg);
}
.theme-switch svg {
  width: 20px;
  height: 20px;
}

.theme-switch .sun-icon { display: none; }
.theme-switch .moon-icon { display: block; }
html.light .theme-switch .sun-icon { display: block; }
html.light .theme-switch .moon-icon { display: none; }

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
}
.mobile-toggle span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text-color);
  transition: all 0.3s ease;
}

/* Main Container Layouts */
main {
  padding-top: 80px;
  min-height: calc(100vh - 400px);
}

.section {
  padding: 100px 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}
.section-tag {
  display: inline-block;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--color-primary);
  margin-bottom: 15px;
  background: rgba(10, 132, 255, 0.1);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(10, 132, 255, 0.2);
}
.section-title {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.2;
}
.section-desc {
  max-width: 600px;
  margin: 15px auto 0;
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Footer Styles */
footer {
  background: rgba(5, 5, 5, 0.95);
  border-top: 1.5px solid var(--nav-border);
  padding: 80px 30px 40px;
}
html.light footer {
  background: rgba(240, 240, 245, 0.95);
}

.footer-grid {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 50px;
  margin-bottom: 50px;
}

.footer-logo {
  margin-bottom: 20px;
}
.footer-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 25px;
  max-width: 300px;
}
.footer-socials {
  display: flex;
  gap: 15px;
}
.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-color);
  transition: all 0.3s;
}
.social-link:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  transform: translateY(-3px);
}
.social-link svg,
.social-link i {
  width: 18px !important;
  height: 18px !important;
  stroke: currentColor;
  stroke-width: 2px;
  fill: none;
  display: inline-block;
  vertical-align: middle;
}

.footer-heading {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 25px;
  color: var(--text-color);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.3s;
}
.footer-links a:hover {
  color: var(--color-primary);
}

.footer-newsletter p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}
.newsletter-form {
  display: flex;
  gap: 10px;
}
.newsletter-input {
  flex: 1;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 30px;
  padding: 12px 20px;
  color: var(--text-color);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s;
}
.newsletter-input:focus {
  border-color: var(--color-primary);
}
.btn-submit {
  background: var(--color-primary);
  color: var(--text-inverse);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s, transform 0.3s;
}
.btn-submit:hover {
  background: var(--color-secondary-1);
  transform: scale(1.05);
}

.footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  border-top: 1.5px solid var(--nav-border);
  padding-top: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}
.footer-copyright {
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-legal-links {
  display: flex;
  gap: 25px;
}
.footer-legal-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.3s;
}
.footer-legal-links a:hover {
  color: var(--color-primary);
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--bg-color);
    flex-direction: column;
    padding: 30px;
    border-bottom: 1.5px solid var(--nav-border);
    box-shadow: var(--shadow-premium);
  }
  .nav-menu.open {
    display: flex;
  }
  .mobile-toggle {
    display: flex;
  }
  .nav-actions {
    gap: 10px;
  }
  .btn-register {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  .section-title {
    font-size: 2.2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
