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

/* CSS VARIABLES */
:root {
  --bg-primary: #0D0D1A;
  --bg-secondary: #13132B;
  --bg-card: #1A1A35;
  --bg-card2: #1E1E3A;
  --purple-dark: #3B2F8F;
  --purple-mid: #5A3FD6;
  --purple-main: #6C63FF;
  --purple-light: #7C4DFF;
  --neon-blue: #00E5FF;
  --neon-pink: #FF6BD6;
  --text-primary: #FFFFFF;
  --text-secondary: #B0B0CC;
  --text-muted: #6B6B8A;
  --border: #2A2A4A;
  --border-light: #3A3A5C;
  --success: #22D87A;
  --warning: #FFB800;
  --danger: #FF4D6A;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;

  --shadow-glow: 0 0 30px rgba(108, 99, 255, 0.25);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-btn: 0 4px 16px rgba(66, 66, 107, 0.4);

  --nav-height: 68px;
  --sidebar-width: 240px;
  --transition: 0.2s ease;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: inherit;
}

input,
textarea,
select {
  font-family: inherit;
  outline: none;
  border: none;
  background: none;
}

img {
  max-width: 100%;
  display: block;
}

ul,
ol {
  list-style: none;
}

/* SCROLLBAR */
::-webkit-scrollbar {
  width: 5px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--purple-dark);
  border-radius: 10px;
}

/* TYPOGRAPHY */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Sora', sans-serif;
  line-height: 1.2;
}

.text-gradient {
  background: linear-gradient(135deg, var(--purple-main), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@media (max-width: 767px) {
  * {
    -webkit-tap-highlight-color: transparent;
  }
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-muted {
  color: var(--text-muted);
}

.text-secondary {
  color: var(--text-secondary);
}

.font-bold {
  font-weight: 700;
}

.font-semi {
  font-weight: 600;
}

.font-med {
  font-weight: 500;
}

/* UTILITY */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.gap-1 {
  gap: 4px;
}

.gap-2 {
  gap: 8px;
}

.gap-3 {
  gap: 12px;
}

.gap-4 {
  gap: 16px;
}

.gap-5 {
  gap: 20px;
}

.gap-6 {
  gap: 24px;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.hidden {
  display: none !important;
}

/* BACKGROUNDS */
.bg-mesh {
  background:
    radial-gradient(ellipse 80% 50% at 20% 10%, rgba(30, 26, 104, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(0, 229, 255, 0.08) 0%, transparent 50%),
    var(--bg-primary);
}

/* CARD */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.card-glow {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card2));
  border: 1px solid rgba(108, 99, 255, 0.3);
  border-radius: var(--radius-lg);
  box-shadow: rgba(4, 1, 66, 0.1);
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  font-family: 'Sora', sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  transition: all var(--transition);
  letter-spacing: 0.01em;
}

.btn-primary {
  background: linear-gradient(135deg, #191348, #4338A8);
  color: #fff;
  box-shadow: none;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border-light);
  color: var(--text-secondary);
}

.btn-outline:hover {
  /* border-color: var(--purple-main); */
  color: var(--text-primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background: rgba(108, 99, 255, 0.1);
  color: var(--purple-main);
}

.btn-ghost:hover {
  background: rgba(108, 99, 255, 0.2);
}

.btn-sm {
  padding: 9px 18px;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 17px 36px;
  font-size: 1rem;
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-full);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  border-color: var(--purple-main);
}

/* FORMS*/
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9375rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.15);
}

.form-input::placeholder {
  color: var(--text-muted);
}

/* BADGE */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-purple {
  background: rgba(108, 99, 255, 0.2);
  color: var(--purple-main);
}

.badge-blue {
  background: rgba(0, 229, 255, 0.15);
  color: var(--neon-blue);
}

.badge-success {
  background: rgba(34, 216, 122, 0.15);
  color: var(--success);
}

/* PROGRESS BAR */
.progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg-card2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple-main), var(--neon-blue));
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

/* DIVIDER */
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* AVATAR */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #191348, #574bbc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}

/* TOAST */
#toast-container {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-size: 0.875rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  white-space: nowrap;
}

.toast.success {
  border-color: var(--success);
}

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

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

@keyframes toastOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  transform: translateY(20px);
  transition: transform 0.2s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

/* SCREEN SYSTEM */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* PAGE TRANSITIONS*/
.screen.fade-in {
  animation: fadeIn 0.35s ease;
}

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

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

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

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

/* GLOW RING */
.glow-ring {
  border-radius: var(--radius-full);
  padding: 3px;
  background: linear-gradient(135deg, var(--purple-main), var(--neon-blue));
}

.glow-ring-inner {
  border-radius: var(--radius-full);
  background: var(--bg-card);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* SVG ICON SIZES */
.icon-sm {
  width: 16px;
  height: 16px;
}

.icon-md {
  width: 20px;
  height: 20px;
}

.icon-lg {
  width: 24px;
  height: 24px;
}

.icon-xl {
  width: 32px;
  height: 32px;
}

svg {
  flex-shrink: 0;
}

/* Tutorial Category Filter Tabs */
.filter-tab {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 999px; /* Capsule shape */
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.25s ease;
}

.filter-tab:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.filter-tab.active {
  background: var(--purple-main);
  border-color: var(--purple-main);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108, 99, 255, 0.25);
}

/* Dynamic mobile viewport scaling */
@media (max-width: 768px) {
  body {
    zoom: 0.85;
  }
  body.no-zoom {
    zoom: 1;
  }
}
