/* ═══════════════════════════════════════════════════════════════════════
   Mindrevel IoT Learning Platform — Global Stylesheet
   Monochromatic Blue Palette: #0F1F4A · #1F3C88 · #3656A6 · #6B87C9 · #A5B7E6 · #E3E9F9
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Custom Properties ──────────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --bg-dark:      #0F1F4A;
  --primary:      #1F3C88;
  --btn:          #3656A6;
  --btn-hover:    #2c4a8f;
  --card:         #6B87C9;
  --light-ui:     #A5B7E6;
  --bg-light:     #E3E9F9;
  --bg-page:      #F7F9FF;
  --bg-white:     #FFFFFF;

  /* Text */
  --text-dark:    #0F1F4A;
  --text-body:    #2D3561;
  --text-muted:   #6B87C9;
  --text-light:   #E3E9F9;
  --text-white:   #FFFFFF;

  /* Gradients */
  --grad-primary: linear-gradient(135deg, #0F1F4A 0%, #1F3C88 100%);
  --grad-btn:     linear-gradient(135deg, #1F3C88 0%, #3656A6 100%);
  --grad-accent:  linear-gradient(135deg, #3656A6 0%, #6B87C9 100%);
  --grad-light:   linear-gradient(135deg, #E3E9F9 0%, #FFFFFF 100%);

  /* Borders */
  --border:       #D0DCF5;
  --border-dark:  #1F3C88;

  /* Shadows */
  --shadow-sm:    0 2px 8px rgba(31, 60, 136, 0.08);
  --shadow-md:    0 8px 30px rgba(31, 60, 136, 0.12);
  --shadow-lg:    0 20px 60px rgba(15, 31, 74, 0.18);
  --shadow-btn:   0 4px 20px rgba(54, 86, 166, 0.35);
  --shadow-glow:  0 0 30px rgba(107, 135, 201, 0.4);

  /* Spacing */
  --section-py:   100px;
  --container:    1200px;
  --gap:          24px;

  /* Typography */
  --font-heading: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

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

  /* Transitions */
  --transition:        all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast:   all 0.15s ease;
  --transition-slow:   all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-body);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ── Typography ─────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
h4 { font-size: 1.2rem; }

p { margin-bottom: 1rem; color: var(--text-body); }
p:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--text-dark); }

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--bg-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 6px;
}

/* ── Layout Utilities ───────────────────────────────────────────────── */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section-pad { padding: var(--section-py) 0; }
.section-pad-sm { padding: 64px 0; }

.text-center { text-align: center; }
.text-left   { text-align: left; }

.flex          { display: flex; }
.flex-center   { display: flex; align-items: center; justify-content: center; }
.flex-between  { display: flex; align-items: center; justify-content: space-between; }
.gap-8         { gap: 8px; }
.gap-16        { gap: 16px; }
.gap-24        { gap: 24px; }

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

/* ── Section Labels ─────────────────────────────────────────────────── */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--btn);
  background: rgba(54, 86, 166, 0.1);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 20px;
}

.section-label.light {
  color: var(--light-ui);
  background: rgba(165, 183, 230, 0.15);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  color: var(--text-dark);
  margin-bottom: 16px;
}

.section-title.light { color: var(--text-light); }

.section-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 620px;
  line-height: 1.8;
}

.section-subtitle.light { color: var(--light-ui); }

/* ── Gradient Text ──────────────────────────────────────────────────── */
.gradient-text {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gradient-text-light {
  background: linear-gradient(135deg, #FFFFFF, #A5B7E6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 28px;
  border-radius: var(--radius-full);
  transition: var(--transition);
  cursor: pointer;
  white-space: nowrap;
  border: 2px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--grad-btn);
  color: var(--text-white);
  box-shadow: var(--shadow-btn);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(54, 86, 166, 0.45);
  background: linear-gradient(135deg, #1a3377 0%, #2d4b8a 100%);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-white);
  transform: translateY(-2px);
}

.btn-outline-light {
  background: transparent;
  color: var(--text-white);
  border-color: rgba(255,255,255,0.5);
}

.btn-outline-light:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.8);
}

.btn-sm { padding: 10px 20px; font-size: 0.875rem; }
.btn-lg { padding: 18px 40px; font-size: 1.05rem; }

.btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  padding: 0;
  font-size: 1rem;
}

/* ── Badge / Tag ────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-beginner     { background: #e8f0fe; color: #1F3C88; }
.badge-intermediate { background: #d4e0f7; color: #3656A6; }
.badge-advanced     { background: #c6d4f0; color: #0F1F4A; }
.badge-blue { background: var(--bg-light); color: var(--primary); }

/* ── Card ───────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--light-ui);
}

.card-body { padding: 28px; }

/* ── Divider ────────────────────────────────────────────────────────── */
.divider {
  width: 60px;
  height: 4px;
  background: var(--grad-btn);
  border-radius: var(--radius-full);
  margin: 20px 0;
}

.divider-center { margin: 20px auto; }

/* ── ═══════════════════════════════════════════ NAVBAR ═══════════════ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.logo-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.logo-img-sm {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.nav-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--grad-btn);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(54,86,166,0.4);
}

.logo-icon-sm {
  width: 30px;
  height: 30px;
  background: var(--grad-btn);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.8rem;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  color: var(--text-dark);
  letter-spacing: -0.02em;
}

.logo-accent { color: var(--btn); }

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: block;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-body);
  border-radius: var(--radius-full);
  transition: var(--transition-fast);
  text-decoration: none;
}

.nav-link:hover { color: var(--primary); background: rgba(31, 60, 136, 0.06); }
.nav-link.active { color: var(--primary); background: rgba(31, 60, 136, 0.1); font-weight: 600; }

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-cta { font-size: 0.85rem; padding: 10px 20px; }

/* Hamburger */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(31, 60, 136, 0.08);
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.bar {
  display: block;
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 9px;
  transition: var(--transition-fast);
}

.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 31, 74, 0.6);
  z-index: 998;
  backdrop-filter: blur(4px);
}

.mobile-overlay.active { display: block; }

/* ── ═══════════════════════════════════════════ FOOTER ═══════════════ */
.site-footer {
  background: var(--bg-dark);
  color: var(--text-light);
  padding-top: 80px;
}

.footer-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px 60px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 48px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 20px;
  text-decoration: none;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--light-ui);
  line-height: 1.8;
  margin-bottom: 24px;
}

.footer-socials {
  display: flex;
  gap: 10px;
}

.social-link {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(165, 183, 230, 0.12);
  border: 1px solid rgba(165,183,230,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--light-ui);
  font-size: 0.9rem;
  transition: var(--transition-fast);
  text-decoration: none;
}

.social-link:hover {
  background: var(--btn);
  border-color: var(--btn);
  color: #fff;
  transform: translateY(-2px);
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-white);
  margin-bottom: 20px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a, .footer-links span {
  font-size: 0.9rem;
  color: var(--light-ui);
  transition: var(--transition-fast);
  text-decoration: none;
}

.footer-links a:hover { color: #fff; padding-left: 4px; }

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.footer-contact i {
  color: var(--card);
  width: 16px;
  margin-top: 3px;
  flex-shrink: 0;
}

.footer-bottom {
  border-top: 1px solid rgba(165,183,230,0.15);
  padding: 20px 24px;
}

.footer-bottom-inner {
  max-width: var(--container);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--light-ui);
}

.footer-admin-link {
  font-size: 0.8rem;
  color: var(--light-ui);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(165,183,230,0.2);
  transition: var(--transition-fast);
  text-decoration: none;
}

.footer-admin-link:hover {
  color: #fff;
  border-color: rgba(165,183,230,0.4);
  background: rgba(165,183,230,0.1);
}

/* ── ═══════════════════════════════ MODULE CARD (shared) ════════════ */
.module-card {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.module-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-lg);
  border-color: var(--light-ui);
}

.module-card-thumb {
  position: relative;
  height: 200px;
  background: var(--grad-primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-card-thumb-icon {
  font-size: 4rem;
  color: rgba(255,255,255,0.25);
}

.module-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.module-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
}

.module-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.module-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.module-card-meta i { color: var(--card); }

.module-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
  line-height: 1.3;
}

.module-card-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 20px;
}

.module-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.module-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--bg-light);
  color: var(--primary);
  letter-spacing: 0.04em;
}

/* ── ═══════════════════════════════════════════ FORMS ═══════════════ */
.form-group { margin-bottom: 20px; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-dark);
  background: var(--bg-white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  outline: none;
}

.form-control:focus {
  border-color: var(--btn);
  box-shadow: 0 0 0 3px rgba(54, 86, 166, 0.12);
}

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

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

select.form-control { cursor: pointer; }

/* ── Alert / Flash ──────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-success { background: #e8f5e9; color: #1b5e20; border-left: 4px solid #4caf50; }
.alert-error   { background: #ffebee; color: #b71c1c; border-left: 4px solid #f44336; }
.alert-info    { background: var(--bg-light); color: var(--primary); border-left: 4px solid var(--btn); }
.alert-warning { background: #fff8e1; color: #f57f17; border-left: 4px solid #ffc107; }

/* ── Page Hero (non-home) ───────────────────────────────────────────── */
.page-hero {
  background: var(--grad-primary);
  padding: 140px 0 80px;
  text-align: center;
}

.page-hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: #fff;
  margin-bottom: 16px;
}

.page-hero-subtitle {
  font-size: 1.1rem;
  color: var(--light-ui);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.8;
}

/* ── Breadcrumb ─────────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 20px;
  justify-content: center;
}

.breadcrumb a { color: rgba(255,255,255,0.7); text-decoration: none; transition: var(--transition-fast); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { opacity: 0.4; }
.breadcrumb .current { color: #fff; }

/* ── Spinner ────────────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--bg-light);
  border-top-color: var(--btn);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ── Scroll to Top ──────────────────────────────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 46px;
  height: 46px;
  background: var(--grad-btn);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
  border: none;
  font-size: 0.9rem;
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover { transform: translateY(-4px); box-shadow: var(--shadow-glow); }

/* ── Empty State ────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 4rem;
  color: var(--light-ui);
  margin-bottom: 20px;
}

.empty-state h3 {
  color: var(--text-dark);
  margin-bottom: 10px;
}

/* ── AOS overrides ──────────────────────────────────────────────────── */
[data-aos] { pointer-events: none; }
[data-aos].aos-animate { pointer-events: auto; }

/* ── ═══════════════════════════════════════════ RESPONSIVE ══════════ */
@media (max-width: 1024px) {
  .footer-container { grid-template-columns: 1fr 1fr; gap: 40px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --section-py: 70px; }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.7rem; }

  /* Mobile nav */
  .nav-links {
    position: fixed;
    top: 0;
    right: -320px;
    bottom: 0;
    width: 300px;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-dark);
    padding: 80px 24px 40px;
    gap: 4px;
    z-index: 999;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 40px rgba(0,0,0,0.3);
  }

  .nav-links.open { right: 0; }

  .nav-link {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: var(--radius-md);
    color: rgba(255,255,255,0.8);
  }

  .nav-link.active, .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
  }

  .nav-toggle { display: flex; }
  .nav-cta    { display: none; }

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

  .footer-container {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .footer-bottom-inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .page-hero { padding: 120px 0 60px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .btn-lg { padding: 14px 28px; font-size: 0.95rem; }
}
