/* =========================================================
   Frontend Layout - Production Grade & Mobile Responsive
   FIXED VERSION - Sticky Navbar + No Underlines
   Namespaced with fe-
========================================================= */

/* -----------------------------
   CSS Reset & Base Styles
------------------------------*/
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  background: var(--fe-bg, #0b1220);
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
  position: relative;
}

/* ========================================
   GLOBAL TEXT DECORATION FIX
======================================== */
a {
  color: inherit;
  text-decoration: none !important;
  -webkit-tap-highlight-color: transparent;
}

a:hover,
a:focus,
a:active,
a:visited {
  text-decoration: none !important;
}

/* Buttons and interactive elements - NO underlines */
button,
.fe-btn,
.fe-icon-btn,
.fe-nav-toggle,
a.fe-btn,
a.fe-icon-btn,
.fe-whatsapp-btn,
.whatsapp-float {
  text-decoration: none !important;
}

button:hover,
.fe-btn:hover,
.fe-icon-btn:hover,
a.fe-btn:hover,
a.fe-icon-btn:hover,
.fe-whatsapp-btn:hover,
.whatsapp-float:hover {
  text-decoration: none !important;
}

a:focus-visible {
  outline: 2px solid var(--fe-primary, #3b82f6);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Improved image handling */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Remove default button styles */
button {
  font-family: inherit;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
}

/* -----------------------------
   Layout Components
------------------------------*/
.fe-container {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 640px) {
  .fe-container {
    width: min(1200px, calc(100% - 48px));
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .fe-container {
    width: min(1200px, calc(100% - 64px));
  }
}

.fe-container-narrow {
  width: min(800px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 16px;
}

.fe-container-wide {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 16px;
}

/* Sections */
.fe-section {
  padding: 48px 0;
}

@media (min-width: 768px) {
  .fe-section {
    padding: 64px 0;
  }
}

@media (min-width: 1024px) {
  .fe-section {
    padding: 80px 0;
  }
}

.fe-section-sm {
  padding: 32px 0;
}

@media (min-width: 768px) {
  .fe-section-sm {
    padding: 48px 0;
  }
}

.fe-section-lg {
  padding: 64px 0;
}

@media (min-width: 768px) {
  .fe-section-lg {
    padding: 96px 0;
  }
}

@media (min-width: 1024px) {
  .fe-section-lg {
    padding: 120px 0;
  }
}

/* Section Headers */
.fe-section-title {
  margin: 0 0 12px;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
}

.fe-section-subtitle {
  margin: 0;
  font-size: clamp(14px, 2vw, 18px);
  color: var(--fe-text-muted, rgba(255, 255, 255, 0.70));
  max-width: 65ch;
  line-height: 1.6;
}

/* Grid System */
.fe-grid {
  display: grid;
  gap: 16px;
  width: 100%;
}

@media (min-width: 640px) {
  .fe-grid {
    gap: 20px;
  }
}

@media (min-width: 1024px) {
  .fe-grid {
    gap: 24px;
  }
}

@media (min-width: 640px) {
  .fe-grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  .fe-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .fe-grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  .fe-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1280px) {
  .fe-grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Auto-fit grid for responsive card layouts */
.fe-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
}

/* ========================================
   STICKY HEADER / NAVBAR - FIXED
======================================== */
.fe-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 18, 32, 0.95);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fe-header-sticky {
  position: sticky !important;
  top: 0 !important;
}

.fe-header.scrolled {
  background: rgba(11, 18, 32, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.fe-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  min-height: 64px;
}

@media (min-width: 768px) {
  .fe-nav {
    padding: 14px 0;
    min-height: 72px;
  }
}

/* Brand */
.fe-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: clamp(18px, 3vw, 20px);
  letter-spacing: -0.02em;
  text-decoration: none !important;
  transition: opacity 0.2s ease;
  flex-shrink: 0;
}

.fe-brand:hover {
  opacity: 0.9;
  text-decoration: none !important;
}

.fe-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--fe-primary, #3b82f6) 0%, var(--fe-primary-2, #2563eb) 100%);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .fe-brand-mark {
    width: 40px;
    height: 40px;
  }
}

.fe-brand:hover .fe-brand-mark {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.4);
}

/* Navigation Links */
.fe-nav-links {
  display: none;
  align-items: center;
  gap: 8px;
}

@media (min-width: 960px) {
  .fe-nav-links {
    display: flex;
    gap: 12px;
  }
}

@media (min-width: 1200px) {
  .fe-nav-links {
    gap: 16px;
  }
}

.fe-nav-links a {
  padding: 8px 12px;
  text-decoration: none !important;
  color: var(--fe-text-muted, rgba(255, 255, 255, 0.70));
  font-weight: 600;
  font-size: 14px;
  border-radius: 8px;
  transition: color 0.2s ease, background-color 0.2s ease;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .fe-nav-links a {
    font-size: 15px;
    padding: 8px 14px;
  }
}

.fe-nav-links a:hover,
.fe-nav-links a.active {
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none !important;
}

.fe-nav-links a:focus-visible {
  outline: 2px solid var(--fe-primary, #3b82f6);
  outline-offset: 2px;
}

/* Navigation Actions */
.fe-nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .fe-nav-actions {
    gap: 12px;
  }
}

/* WhatsApp Button Specific Styles */
.fe-whatsapp-btn {
  text-decoration: none !important;
  position: relative;
}

.fe-whatsapp-btn:hover,
.fe-whatsapp-btn:focus,
.fe-whatsapp-btn:active {
  text-decoration: none !important;
}

/* Mobile Toggle Button */
.fe-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
  -webkit-tap-highlight-color: transparent;
}

.fe-nav-toggle:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
}

.fe-nav-toggle:active {
  transform: scale(0.95);
}

.fe-nav-toggle:focus-visible {
  outline: 2px solid var(--fe-primary, #3b82f6);
  outline-offset: 2px;
}

@media (min-width: 960px) {
  .fe-nav-toggle {
    display: none;
  }
}

/* Hamburger Icon */
.fe-nav-toggle-icon {
  position: relative;
  width: 20px;
  height: 14px;
}

.fe-nav-toggle-icon span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

.fe-nav-toggle-icon span:nth-child(1) {
  top: 0;
}

.fe-nav-toggle-icon span:nth-child(2) {
  top: 6px;
}

.fe-nav-toggle-icon span:nth-child(3) {
  top: 12px;
}

.fe-mobile-open .fe-nav-toggle-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.fe-mobile-open .fe-nav-toggle-icon span:nth-child(2) {
  opacity: 0;
}

.fe-mobile-open .fe-nav-toggle-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* -----------------------------
   Mobile Menu - Enhanced
------------------------------*/
.fe-mobile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.60);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 90;
}

.fe-mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 85vw);
  background: rgba(11, 18, 32, 0.98);
  border-left: 1px solid rgba(255, 255, 255, 0.10);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 95;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.fe-mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 8px;
}

.fe-mobile-menu-close {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fe-text-muted, rgba(255, 255, 255, 0.70));
  transition: background-color 0.2s ease, color 0.2s ease;
}

.fe-mobile-menu-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
}

.fe-mobile-menu a {
  padding: 14px 16px;
  border-radius: 12px;
  text-decoration: none !important;
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-weight: 700;
  font-size: 16px;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.fe-mobile-menu a:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.18);
  text-decoration: none !important;
}

.fe-mobile-menu a:active {
  transform: scale(0.98);
}

.fe-mobile-menu a.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.30);
  color: var(--fe-primary, #3b82f6);
}

.fe-mobile-open .fe-mobile-overlay {
  opacity: 1;
  pointer-events: auto;
}

.fe-mobile-open .fe-mobile-menu {
  transform: translateX(0);
}

/* Prevent body scroll when menu is open */
body.fe-mobile-open {
  overflow: hidden;
  touch-action: none;
}

/* -----------------------------
   Hero Section - Enhanced
------------------------------*/
.fe-hero {
  padding: 48px 0 32px;
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .fe-hero {
    padding: 80px 0 56px;
  }
}

@media (min-width: 1024px) {
  .fe-hero {
    padding: 100px 0 72px;
  }
}

.fe-hero-wrap {
  display: grid;
  gap: 32px;
  align-items: center;
}

@media (min-width: 768px) {
  .fe-hero-wrap {
    gap: 40px;
  }
}

@media (min-width: 1024px) {
  .fe-hero-wrap {
    grid-template-columns: 1.2fr 0.8fr;
    gap: 48px;
  }
}

.fe-hero-content {
  text-align: center;
}

@media (min-width: 1024px) {
  .fe-hero-content {
    text-align: left;
  }
}

.fe-hero-title {
  margin: 0 0 16px;
  font-size: clamp(32px, 5vw, 60px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
}

@media (min-width: 768px) {
  .fe-hero-title {
    margin-bottom: 20px;
  }
}

.fe-hero-title-gradient {
  background: linear-gradient(135deg, var(--fe-primary, #3b82f6) 0%, var(--fe-primary-2, #2563eb) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fe-hero-lead {
  margin: 0 0 24px;
  color: var(--fe-text-muted, rgba(255, 255, 255, 0.70));
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.65;
  max-width: 65ch;
}

@media (min-width: 768px) {
  .fe-hero-lead {
    margin-bottom: 32px;
  }
}

@media (min-width: 1024px) {
  .fe-hero-lead {
    max-width: 60ch;
  }
}

.fe-hero-actions {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

@media (min-width: 768px) {
  .fe-hero-actions {
    gap: 16px;
  }
}

@media (min-width: 1024px) {
  .fe-hero-actions {
    justify-content: flex-start;
  }
}

.fe-hero-panel {
  border-radius: var(--fe-radius-lg, 20px);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.40);
  padding: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (min-width: 768px) {
  .fe-hero-panel {
    padding: 24px;
  }
}

/* -----------------------------
   Footer - Enhanced
------------------------------*/
.fe-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 32px 0;
  color: var(--fe-text-muted, rgba(255, 255, 255, 0.70));
  font-size: 14px;
  background: rgba(0, 0, 0, 0.20);
}

@media (min-width: 768px) {
  .fe-footer {
    padding: 40px 0;
  }
}

.fe-footer-content {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .fe-footer-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
  }
}

@media (min-width: 1024px) {
  .fe-footer-content {
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 48px;
  }
}

.fe-footer-section h3 {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
}

.fe-footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fe-footer-links a {
  color: var(--fe-text-muted, rgba(255, 255, 255, 0.70));
  transition: color 0.2s ease;
  text-decoration: none !important;
}

.fe-footer-links a:hover {
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
  text-decoration: none !important;
}

.fe-footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

@media (min-width: 768px) {
  .fe-footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    text-align: left;
  }
}

/* -----------------------------
   Back to Top - Enhanced
------------------------------*/
.fe-backtotop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(11, 18, 32, 0.90);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--fe-text, rgba(255, 255, 255, 0.92));
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.9);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s ease;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.30);
}

@media (min-width: 768px) {
  .fe-backtotop {
    right: 24px;
    bottom: 24px;
    width: 52px;
    height: 52px;
  }
}

.fe-backtotop:hover {
  background: rgba(11, 18, 32, 0.98);
  transform: translateY(0) scale(1);
}

.fe-backtotop:active {
  transform: translateY(0) scale(0.95);
}

.fe-backtotop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.fe-backtotop:focus-visible {
  outline: 2px solid var(--fe-primary, #3b82f6);
  outline-offset: 2px;
}

/* -----------------------------
   Utility Classes
------------------------------*/
.fe-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.fe-hidden {
  display: none !important;
}

.fe-visible {
  display: block !important;
}

@media (min-width: 640px) {
  .fe-hidden-sm {
    display: none !important;
  }
}

@media (min-width: 768px) {
  .fe-hidden-md {
    display: none !important;
  }
}

@media (min-width: 1024px) {
  .fe-hidden-lg {
    display: none !important;
  }
}

/* Loading States */
.fe-loading {
  pointer-events: none;
  opacity: 0.6;
  cursor: wait;
}

.fe-skeleton {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(255, 255, 255, 0.12) 50%,
    rgba(255, 255, 255, 0.06) 100%
  );
  background-size: 200% 100%;
  animation: fe-skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes fe-skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Print styles */
@media print {
  .fe-header,
  .fe-nav-toggle,
  .fe-mobile-menu,
  .fe-mobile-overlay,
  .fe-backtotop,
  .fe-nav-actions {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }
}

/* Popular courses grid: 2 rows x 5 columns (desktop) */
.fe-courses-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .fe-courses-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 900px) {
  .fe-courses-grid { grid-template-columns: repeat(5, 1fr); }
}

.fe-course-tile {
  padding: 14px;
  min-height: 92px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.fe-course-tile h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.fe-course-tile p {
  margin: 0;
  font-size: 12.5px;
  color: var(--fe-text-muted, rgba(255,255,255,0.70));
}

/* ========================================
   STICKY HEADER SCROLL PADDING
======================================== */
:root {
  /* updated by JS initStickyHeader() */
  --fe-header-h: 72px;
  scroll-padding-top: calc(var(--fe-header-h) + 20px);
}

@media (max-width: 767px) {
  :root {
    --fe-header-h: 64px;
    scroll-padding-top: calc(var(--fe-header-h) + 16px);
  }
}

/* ========================================
   HIDE MOBILE UTILITY
======================================== */
@media (max-width: 959px) {
  .fe-hide-mobile {
    display: none !important;
  }
}