/* ===================================================
   SKILLFORCE HUB — Deep Space Command Center
   Core Design System
   =================================================== */

/* ===== FONTS ===== */
@import url('https://api.fontshare.com/v2/css?f[]=clash-display@400,500,600,700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800&display=swap');

/* ===== DESIGN TOKENS ===== */
:root {
  /* — Palette — */
  --deep:       #003840;
  --deep-light: #005060;
  --deep-mid:   #005a65;
  --charcoal:   #005a65;
  --teal:       #00C9B1;
  --teal-light: #33d4c0;
  --teal-dim:   rgba(0,201,177,0.18);
  --teal-glow:  rgba(0,201,177,0.40);
  --gold:       #FFD166;
  --gold-dim:   rgba(255,209,102,0.18);
  --gold-glow:  rgba(255,209,102,0.45);
  --white:      #F4F7F6;
  --white-pure: #ffffff;
  --body-bg:    #004952;
  --card-bg:    rgba(0,56,64,0.72);
  --card-border:rgba(0,201,177,0.16);
  --card-glow:  rgba(0,201,177,0.08);

  --gray-50:    #f0f4f3;
  --gray-100:   #dce5e3;
  --gray-200:   #b8ccc8;
  --gray-300:   #8aa8a0;
  --gray-400:   #5d8078;
  --gray-500:   #3d6058;
  --gray-600:   #2a4a43;
  --gray-700:   #1e3a34;
  --gray-800:   #152e28;
  --gray-900:   #0e2420;

  --success:    #34d399;
  --success-dim:rgba(52,211,153,0.15);
  --warning:    #fbbf24;
  --warning-dim:rgba(251,191,36,0.15);
  --danger:     #f87171;
  --danger-dim: rgba(248,113,113,0.15);
  --info:       #60a5fa;
  --info-dim:   rgba(96,165,250,0.15);

  /* — Typography — */
  --font-head:  'Clash Display', sans-serif;
  --font-body:  'DM Sans', sans-serif;

  --text-xs:    0.75rem;
  --text-sm:    0.875rem;
  --text-base:  1rem;
  --text-lg:    1.125rem;
  --text-xl:    1.25rem;
  --text-2xl:   1.5rem;
  --text-3xl:   2rem;
  --text-4xl:   2.75rem;
  --text-5xl:   3.5rem;
  --text-6xl:   4.5rem;

  /* — Spacing — */
  --sp-1: 0.25rem; --sp-2: 0.5rem; --sp-3: 0.75rem; --sp-4: 1rem;
  --sp-5: 1.25rem; --sp-6: 1.5rem; --sp-8: 2rem; --sp-10: 2.5rem;
  --sp-12: 3rem; --sp-16: 4rem; --sp-20: 5rem; --sp-24: 6rem;

  /* — Geometry — */
  --radius-sm:  6px;
  --radius:     10px;
  --radius-md:  14px;
  --radius-lg:  18px;
  --radius-xl:  24px;
  --radius-2xl: 32px;
  --radius-full:9999px;

  /* — Shadows — */
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.25);
  --shadow:     0 4px 16px rgba(0,0,0,0.30);
  --shadow-md:  0 8px 32px rgba(0,0,0,0.35);
  --shadow-lg:  0 16px 48px rgba(0,0,0,0.40);
  --shadow-xl:  0 24px 60px rgba(0,0,0,0.45);
  --shadow-teal:0 4px 24px rgba(0,201,177,0.25);
  --shadow-gold:0 4px 24px rgba(255,209,102,0.25);
  --glow-teal:  0 0 30px rgba(0,201,177,0.20), 0 0 60px rgba(0,201,177,0.08);
  --glow-gold:  0 0 30px rgba(255,209,102,0.20);

  /* — Motion — */
  --ease:       cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce:cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast:     180ms;
  --t-normal:   280ms;
  --t-slow:     450ms;

  /* — Layout — */
  --nav-h:      72px;
  --sidebar-w:  260px;
  --container:  1200px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--white);
  background: var(--body-bg);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

h1,h2,h3,h4,h5,h6 { font-family: var(--font-head); font-weight: 600; line-height: 1.15; }
h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }

a { color: var(--teal); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--teal-light); }

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
::selection { background: var(--teal); color: var(--deep); }

/* ===== LAYOUT ===== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-6); }
.container-xl { max-width: 1400px; margin: 0 auto; padding: 0 var(--sp-6); }
.section { padding: var(--sp-24) 0; }
.section-sm { padding: var(--sp-16) 0; }

.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; gap: var(--sp-4); }
  .section { padding: var(--sp-12) 0; }
  .section-header { margin-bottom: var(--sp-8); }
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  .section-title { font-size: var(--text-2xl); }
  .section-sub { font-size: var(--text-base); }
}
@media (max-width: 480px) {
  .container { padding: 0 var(--sp-4); }
  .section { padding: var(--sp-10) 0; }
}

/* ===== NOISE TEXTURE OVERLAY ===== */
.noise-overlay::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
}

/* Hex mesh background */
.hex-mesh {
  background-image:
    linear-gradient(30deg, var(--card-border) 12%, transparent 12.5%, transparent 87%, var(--card-border) 87.5%, var(--card-border)),
    linear-gradient(150deg, var(--card-border) 12%, transparent 12.5%, transparent 87%, var(--card-border) 87.5%, var(--card-border)),
    linear-gradient(30deg, var(--card-border) 12%, transparent 12.5%, transparent 87%, var(--card-border) 87.5%, var(--card-border)),
    linear-gradient(150deg, var(--card-border) 12%, transparent 12.5%, transparent 87%, var(--card-border) 87.5%, var(--card-border)),
    linear-gradient(60deg, rgba(0,201,177,0.04) 25%, transparent 25.5%, transparent 75%, rgba(0,201,177,0.04) 75%);
  background-size: 80px 140px;
  background-position: 0 0, 0 0, 40px 70px, 40px 70px, 0 0;
}

/* ===== SECTION HEADERS ===== */
.section-header { text-align: center; margin-bottom: var(--sp-12); }
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--teal-dim);
  color: var(--teal);
  border: 1px solid rgba(0,201,177,0.2);
  margin-bottom: var(--sp-4);
}
.section-title {
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--white);
  max-width: 700px;
  margin: 0 auto;
}
.section-title .highlight {
  background: linear-gradient(90deg, var(--teal) 0%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.section-sub {
  font-size: var(--text-lg);
  color: var(--gray-300);
  max-width: 560px;
  margin: var(--sp-4) auto 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 8px var(--teal-glow); } 50% { box-shadow: 0 0 24px var(--teal-glow), 0 0 48px rgba(0,201,177,0.1); } }
@keyframes pulse-dot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: 0.5; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes orbit { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes goldSweep {
  0% { background-position: -100% 50%; }
  100% { background-position: 200% 50%; }
}
@keyframes countUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes waxSeal { 0% { transform: scale(0) rotate(-90deg); opacity: 0; } 60% { transform: scale(1.15) rotate(5deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes starBurst {
  0% { transform: translate(0,0) scale(1); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0); opacity: 0; }
}
@keyframes confettiBurst {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(-200px) rotate(720deg); opacity: 0; }
}

.animate-fadeIn { animation: fadeIn var(--t-slow) var(--ease) both; }
.animate-fadeInUp { animation: fadeInUp 0.6s var(--ease-out) both; }
.animate-float { animation: float 4s ease-in-out infinite; }

/* Scroll Reveal */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, rgba(0,201,177,0.06) 25%, rgba(0,201,177,0.14) 50%, rgba(0,201,177,0.06) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite linear;
  border-radius: var(--radius);
}

/* ===== PAGE LOADER ===== */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--body-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s var(--ease), visibility 0.5s;
  gap: var(--sp-4);
}
.page-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.loader-logo { font-family: var(--font-head); font-weight: 700; font-size: var(--text-xl); color: var(--teal); }
.loader-bar { width: 180px; height: 3px; background: var(--deep-mid); border-radius: var(--radius-full); overflow: hidden; }
.loader-progress {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--gold));
  border-radius: var(--radius-full);
  animation: loaderFill 1.2s var(--ease-out) forwards;
}
@keyframes loaderFill { to { width: 100%; } }

/* ===== PILL TABS ===== */
.pill-content { display: none; }
.pill-content.active { display: block; animation: fadeIn 0.3s var(--ease); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--body-bg); }
::-webkit-scrollbar-thumb { background: var(--deep-mid); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--teal); }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: calc(var(--nav-h) + var(--sp-4));
  right: var(--sp-4);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.toast {
  padding: var(--sp-4) var(--sp-5);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--white);
  backdrop-filter: blur(12px);
  animation: slideInRight 0.4s var(--ease-out);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-width: 280px;
  border: 1px solid;
}
.toast.success { background: rgba(52,211,153,0.15); border-color: rgba(52,211,153,0.3); }
.toast.error   { background: rgba(248,113,113,0.15); border-color: rgba(248,113,113,0.3); }
.toast.warning { background: rgba(251,191,36,0.15); border-color: rgba(251,191,36,0.3); }
.toast.info    { background: rgba(0,201,177,0.15); border-color: rgba(0,201,177,0.3); }
