/* ============================================================
   Mahir Ngedit — Design System
   Light theme — putih bersih & biru tua soft
   ============================================================ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800;900&display=swap');

/* ─── CSS Custom Properties (Design Tokens) ─── */
:root {
  /* Colors — Base (Light) */
  --color-bg-primary: #f8faff;
  --color-bg-secondary: #eef2fb;
  --color-bg-tertiary: #e2e8f6;
  --color-bg-card: #ffffff;
  --color-bg-card-hover: #f0f4ff;
  --color-bg-glass: rgba(255, 255, 255, 0.85);
  --color-border: #d1daf0;
  --color-border-hover: #a8b8e0;

  /* Colors — Text */
  --color-text-primary: #1a2550;
  --color-text-secondary: #3a4f7a;
  --color-text-muted: #6b7ea8;
  --color-text-accent: #612AFF;

  /* Colors — Accent (#612AFF purple brand) */
  --color-accent-primary: #612AFF;
  --color-accent-secondary: #612AFF;
  --color-accent-tertiary: #8B5FFF;
  --color-accent-glow: rgba(97, 42, 255, 0.18);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #4A1FCC 0%, #612AFF 60%, #8B5FFF 100%);
  --gradient-hero: linear-gradient(135deg, #f0f0ff 0%, #e8e0ff 40%, #f5f3ff 100%);
  --gradient-card: linear-gradient(145deg, rgba(97, 42, 255, 0.05) 0%, rgba(139, 95, 255, 0.02) 100%);
  --gradient-text: linear-gradient(135deg, #612AFF, #8B5FFF);
  --gradient-cta: linear-gradient(135deg, #4A1FCC, #612AFF);

  /* Semantic Colors */
  --color-success: #059669;
  --color-success-bg: rgba(5, 150, 105, 0.1);
  --color-warning: #d97706;
  --color-warning-bg: rgba(217, 119, 6, 0.1);
  --color-error: #dc2626;
  --color-error-bg: rgba(220, 38, 38, 0.1);
  --color-info: #612AFF;
  --color-info-bg: rgba(97, 42, 255, 0.1);

  /* Typography */
  --font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;
  --fs-5xl: 3.75rem;
  --fs-6xl: 4.5rem;

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

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

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(97, 42, 255, 0.08);
  --shadow-md: 0 4px 16px rgba(97, 42, 255, 0.12);
  --shadow-lg: 0 8px 32px rgba(97, 42, 255, 0.15);
  --shadow-xl: 0 16px 48px rgba(97, 42, 255, 0.18);
  --shadow-glow: 0 0 30px rgba(97, 42, 255, 0.2);
  --shadow-glow-lg: 0 0 60px rgba(97, 42, 255, 0.25);

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(97, 42, 255, 0.12);
  --glass-blur: blur(16px);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index layers */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-toast: 600;

  /* Layout */
  --container-max: 1200px;
  --container-narrow: 800px;
  --navbar-height: 72px;
  --sidebar-width: 260px;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-normal);
  color: var(--color-text-primary);
  background-color: var(--color-bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: var(--lh-tight);
  font-weight: var(--fw-bold);
  color: var(--color-text-primary);
}

h1 { font-size: var(--fs-5xl); }
h2 { font-size: var(--fs-3xl); }
h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-xl); }
h5 { font-size: var(--fs-lg); }
h6 { font-size: var(--fs-md); }

p {
  color: var(--color-text-secondary);
  line-height: var(--lh-normal);
}

/* ─── Layout Utilities ─── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: var(--space-24) 0;
  position: relative;
}

.section-sm {
  padding: var(--space-16) 0;
}

/* Flex utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* Grid utilities */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-accent { color: var(--color-text-accent); }
.text-muted { color: var(--color-text-muted); }
.text-sm { font-size: var(--fs-sm); }
.text-lg { font-size: var(--fs-lg); }
.text-xl { font-size: var(--fs-xl); }

/* Spacing utilities */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mx-auto { margin-left: auto; margin-right: auto; }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

/* Display */
.hidden { display: none !important; }
.block { display: block; }
.inline-block { display: inline-block; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }

/* ─── Section Header ─── */
.section-header {
  text-align: center;
  margin-bottom: var(--space-16);
}

.section-header .section-label {
  display: inline-block;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent-primary);
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-4);
  background: rgba(97, 42, 255, 0.08);
  border: 1px solid rgba(97, 42, 255, 0.2);
  border-radius: var(--radius-full);
}

.section-header h2 {
  font-size: var(--fs-4xl);
  font-weight: var(--fw-extrabold);
  margin-bottom: var(--space-4);
}

.section-header p {
  font-size: var(--fs-lg);
  max-width: 600px;
  margin: 0 auto;
}

/* ─── Keyframe Animations ─── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes gradientMove {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

/* Animation classes */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out both;
}

.animate-fade-in-down {
  animation: fadeInDown 0.5s ease-out both;
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-out both;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out both;
}

.animate-slide-left {
  animation: slideInLeft 0.6s ease-out both;
}

.animate-slide-right {
  animation: slideInRight 0.6s ease-out both;
}

/* Scroll reveal (triggered by JS) */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ─── Decorative Elements ─── */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.glow-orb-primary {
  background: var(--color-accent-primary);
}

.glow-orb-secondary {
  background: var(--color-accent-tertiary);
}

/* ─── Scrollbar ─── */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--color-border-hover);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent-primary);
}

/* ─── Selection ─── */
::selection {
  background: rgba(97, 42, 255, 0.2);
  color: var(--color-text-primary);
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  h1 { font-size: var(--fs-4xl); }
  h2 { font-size: var(--fs-2xl); }
  .section { padding: var(--space-16) 0; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .section-header h2 { font-size: var(--fs-3xl); }
}

@media (max-width: 768px) {
  html { font-size: 15px; }
  h1 { font-size: var(--fs-3xl); }
  h2 { font-size: var(--fs-2xl); }
  .container { padding: 0 var(--space-4); }
  .section { padding: var(--space-12) 0; }
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
  .hide-mobile { display: none !important; }
  .section-header h2 { font-size: var(--fs-2xl); }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  h1 { font-size: var(--fs-2xl); }
  .section { padding: var(--space-10) 0; }
}

/* ─── Mobile Fixes ─── */
@media (max-width: 640px) {
  /* Container padding fix */
  .container { padding: 0 var(--space-4); }

  /* Hero fixes */
  .hero { min-height: auto; padding-top: calc(var(--navbar-height) + var(--space-6)); padding-bottom: var(--space-12); }
  .hero-content { max-width: 100%; }
  .hero h1 { font-size: var(--fs-3xl); line-height: 1.2; }
  .hero p { font-size: var(--fs-base); margin-bottom: var(--space-6); }
  .hero-actions { flex-direction: column; gap: var(--space-3); }
  .hero-actions .btn { width: 100%; justify-content: center; }
  .hero-stats { flex-wrap: wrap; gap: var(--space-6); margin-top: var(--space-8); padding-top: var(--space-6); }
  .hero-stat { flex: 1 1 45%; }
  .hero-stat h3 { font-size: var(--fs-2xl); }
  .hero-label { font-size: var(--fs-xs); padding: var(--space-1) var(--space-3); }

  /* Navbar logo fix */
  .navbar-brand img { height: 28px !important; }

  /* Section headers */
  .section-header h2 { font-size: var(--fs-xl); }
  .section-header p { font-size: var(--fs-sm); }

  /* Cards */
  .course-card, .class-card, .testimonial-card { margin: 0 var(--space-2); }

  /* Footer fixes */
  .footer-grid { grid-template-columns: 1fr; gap: var(--space-8); text-align: center; }
  .footer-brand { align-items: center; }
  .footer-social { justify-content: center; }
  .footer-bottom { flex-direction: column; gap: var(--space-2); text-align: center; }

  /* CTA section */
  .cta-section h2 { font-size: var(--fs-2xl); }

  /* Modal fix */
  .modal-content { width: 95%; margin: var(--space-4); max-height: 90vh; }

  /* Tables */
  .admin-table { font-size: var(--fs-xs); }
  .admin-table th, .admin-table td { padding: var(--space-2); }
}
