/* ==========================================================
   Courses Page Custom CSS (Dark Theme, Glassmorphism)
   Replicating the mock-up 1:1
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-deep: #060814;
  --bg-card: #12142B;
  --bg-card-hover: #1A1C36;
  --text-primary: #FFFFFF;
  --text-secondary: #94A3B8;
  --accent-purple: #6B46C1;
  --accent-purple-light: #9F7AEA;
  --accent-purple-glow: rgba(107, 70, 193, 0.4);
  --accent-blue: #3182CE;
  --accent-green: #38A169;
  --accent-orange: #DD6B20;
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-strong: rgba(255, 255, 255, 0.1);
}

body.courses-page {
  background-color: var(--bg-deep) !important;
  color: var(--text-primary) !important;
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body.courses-page h1, body.courses-page h2, body.courses-page h3, body.courses-page h4, body.courses-page h5, body.courses-page h6 {
  font-family: 'Inter', sans-serif;
  color: var(--text-primary) !important;
  font-weight: 700;
}

.courses-page .st-content {
  background-color: var(--bg-deep) !important;
}

a {
  text-decoration: none;
  transition: all 0.3s ease;
}

/* Typography Utils */
.text-gradient-purple {
  background: linear-gradient(90deg, #9F7AEA, #6B46C1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Navbar overrides */
.courses-page .st-main-header {
  background-color: var(--bg-deep) !important;
  border-bottom: 1px solid var(--border-subtle);
}
.courses-page .st-nav-list a {
  color: var(--text-primary) !important;
  opacity: 0.7;
}
.courses-page .st-nav-list li.current-menu-item a {
  color: var(--accent-purple-light) !important;
  opacity: 1;
  border-bottom: 2px solid var(--accent-purple-light);
}
.btn-enroll-nav {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-purple-light));
  color: white !important;
  padding: 10px 24px;
  border-radius: 30px;
  font-weight: 600;
  opacity: 1 !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-enroll-nav i { font-size: 0.8rem; }

/* ----- 1. Hero Section ----- */
.courses-hero-wrap {
  padding: 150px 0 100px;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-deep) !important;
}
.courses-hero-wrap::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-purple-glow) 0%, rgba(6, 8, 20, 0) 70%);
  filter: blur(60px);
  z-index: 0;
}
.hero-content-left {
  position: relative;
  z-index: 1;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-strong);
  border-radius: 30px;
  font-size: 14px;
  margin-bottom: 24px;
  color: var(--text-secondary);
}
.hero-badge i { color: #F6AD55; }
.hero-content-left h1 {
  font-size: 4.5rem;
  line-height: 1.1;
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.hero-content-left p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 450px;
  margin-bottom: 40px;
  line-height: 1.6;
}
.hero-mini-badges {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}
.hero-mini-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-strong);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.hero-mini-badge i { color: var(--accent-blue); }
.hero-mini-badge:nth-child(2) i { color: var(--accent-purple-light); }
.hero-mini-badge:nth-child(3) i { color: var(--accent-green); }

.hero-actions {
  display: flex;
  align-items: center;
  gap: 30px;
}
.btn-primary-gradient {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-purple-light));
  color: white;
  padding: 14px 30px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s;
}
.btn-primary-gradient:hover {
  transform: translateY(-2px);
  color: white;
}
.hero-learners {
  display: flex;
  align-items: center;
  gap: 15px;
}
.learner-avatars {
  display: flex;
}
.learner-avatars img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--bg-deep);
  margin-left: -15px;
}
.learner-avatars img:first-child { margin-left: 0; }
.learner-stats strong { display: block; font-size: 1.1rem; }
.learner-stats span { font-size: 0.8rem; color: var(--text-secondary); }

/* Mock Editor right */
.hero-editor-wrapper {
  position: relative;
  z-index: 1;
}
.mock-editor {
  background: #0D1126;
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}
.editor-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-subtle);
}
.editor-dots {
  display: flex;
  gap: 8px;
}
.editor-dots span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #E2E8F0;
  opacity: 0.3;
}
.editor-dots span:nth-child(1) { background: #FC8181; opacity: 1; }
.editor-dots span:nth-child(2) { background: #F6AD55; opacity: 1; }
.editor-dots span:nth-child(3) { background: #68D391; opacity: 1; }
.editor-tab {
  color: var(--text-secondary);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  padding: 6px 12px;
  border-radius: 6px;
}
.editor-copy {
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  padding: 6px 12px;
  border-radius: 6px;
}
.editor-body {
  padding: 20px;
  font-family: monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #A0AEC0;
}
.editor-line { display: flex; }
.line-num { width: 30px; color: #4A5568; user-select: none; }
.code-tag { color: #FC8181; }
.code-attr { color: #F6AD55; }
.code-val { color: #68D391; }
.floating-icons {
  position: absolute;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.float-icon {
  background: #1A202C;
  border: 1px solid var(--border-strong);
  padding: 10px 15px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

/* ----- 2. Courses Section ----- */
.courses-grid-section {
  padding: 80px 0;
  position: relative;
  border-top: 1px solid var(--border-subtle);
}
.section-pill {
  display: inline-block;
  background: rgba(107, 70, 193, 0.1);
  color: var(--accent-purple-light);
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 15px;
  border: 1px solid rgba(107, 70, 193, 0.3);
  text-transform: uppercase;
}
.section-header {
  text-align: center;
  margin-bottom: 50px;
}
.section-header h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
}
.section-header p {
  color: var(--text-secondary);
}
.course-tabs-wrapper {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 50px;
}
.tab-pill {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 8px 24px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.3s;
}
.tab-pill:hover { background: rgba(255,255,255,0.05); }
.tab-pill.active {
  background: linear-gradient(90deg, var(--accent-purple), var(--accent-purple-light));
  border-color: transparent;
  color: white;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}
.course-card-v2 {
  position: relative;
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Subtle moving glow border */
.course-card-v2::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 0.7px; /* Border thickness */
  background: linear-gradient(
    120deg, 
    rgba(255, 255, 255, 0.05) 0%, 
    rgba(255, 255, 255, 0.05) 20%, 
    #ff007f 35%,
    #7928ca 50%, 
    #00dfd8 65%,
    #ffaa00 80%,
    rgba(255, 255, 255, 0.05) 100%
  );
  background-size: 300% 300%;
  animation: smoothGlowBorder 8s ease-in-out infinite;
  -webkit-mask: 
    linear-gradient(#fff 0 0) content-box, 
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 10;
}

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

.course-card-v2:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.card-img-placeholder {
  height: 180px;
  background: linear-gradient(135deg, #1A202C, #2D3748);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-img-placeholder::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at center, rgba(107, 70, 193, 0.2) 0%, transparent 70%);
}
.card-img-placeholder i {
  font-size: 4rem;
  color: rgba(255,255,255,0.8);
  z-index: 1;
  opacity: 0.8;
}

.card-body {
  padding: 25px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  position: relative;
}
.cat-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 15px;
  width: max-content;
  background: rgba(255,255,255,0.1);
}
.cat-badge.marketing { color: #F6AD55; background: rgba(246, 173, 85, 0.1); }
.cat-badge.development { color: #63B3ED; background: rgba(99, 179, 237, 0.1); }

.card-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
  line-height: 1.4;
}
.card-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}
.card-meta-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.meta-item i { color: var(--text-secondary); opacity: 0.7; }

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}
.price-block {
  display: none;
  flex-direction: column;
}
.price-block .current {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}
.price-block .original {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: line-through;
}
.btn-arrow-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: all 0.3s;
}
.course-card-v2:hover .btn-arrow-circle {
  background: var(--accent-purple);
}
.view-all-link {
  display: block;
  text-align: center;
  margin-top: 40px;
  color: var(--accent-purple-light);
  font-weight: 600;
  font-size: 0.95rem;
}
.view-all-link i { font-size: 0.8rem; margin-left: 5px; }

/* ----- 3. Feature Bar ----- */
.feature-bar-section {
  padding: 40px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}
.feature-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.feature-box {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  min-width: 250px;
}
.feat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.feat-icon.bg-purple { background: rgba(107, 70, 193, 0.2); color: #9F7AEA; }
.feat-icon.bg-blue { background: rgba(49, 130, 206, 0.2); color: #63B3ED; }
.feat-icon.bg-green { background: rgba(56, 161, 105, 0.2); color: #68D391; }
.feat-icon.bg-orange { background: rgba(221, 107, 32, 0.2); color: #F6AD55; }
.feat-text h4 { font-size: 0.95rem; margin-bottom: 4px; }
.feat-text p { font-size: 0.8rem; color: var(--text-secondary); margin: 0; line-height: 1.4; }

/* ----- 4. Paths Section ----- */
.paths-section {
  padding: 80px 0;
}
.path-cards {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
}
.path-card {
  flex: 1;
  min-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 30px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all 0.3s;
}
.path-card:hover { border-color: var(--accent-purple); }
.path-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.path-icon.purple { background: linear-gradient(135deg, rgba(107,70,193,0.3), rgba(107,70,193,0.1)); color: #9F7AEA; }
.path-icon.blue { background: linear-gradient(135deg, rgba(49,130,206,0.3), rgba(49,130,206,0.1)); color: #63B3ED; }
.path-content { flex-grow: 1; }
.path-content h3 { font-size: 1.2rem; margin-bottom: 8px; }
.path-content p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 10px; }
.path-meta { font-size: 0.8rem; color: var(--text-secondary); }
.path-meta span { color: var(--text-primary); font-weight: 500; }

/* ----- 5. Bottom CTA Section ----- */
.cta-banner {
  background: linear-gradient(90deg, #12142B, #1A1C36);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  padding: 40px 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 80px;
  position: relative;
  overflow: hidden;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.05)"/></svg>');
}
.cta-left { display: flex; align-items: center; gap: 30px; position: relative; z-index: 1; }
.trophy-icon { font-size: 4rem; color: #F6AD55; }
.cta-text h2 { font-size: 1.8rem; margin-bottom: 10px; }
.cta-text p { color: var(--text-secondary); margin: 0; font-size: 0.95rem; }
.cta-right { position: relative; z-index: 1; }

/* ----- 6. Footer Stats ----- */
.footer-stats-section {
  padding-bottom: 50px;
}
.stats-row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}
.stat-box {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  min-width: 200px;
}
.stat-icon { font-size: 1.8rem; color: var(--accent-purple-light); }
.stat-text h4 { font-size: 1.5rem; margin-bottom: 2px; }
.stat-text p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; }

@media (max-width: 991px) {
  .courses-hero-wrap { padding: 120px 0 60px; }
  .hero-editor-wrapper { margin-top: 50px; }
  .floating-icons { display: none; }
  .hero-content-left h1 { font-size: 3rem; }
  .cta-banner { flex-direction: column; text-align: center; gap: 30px; }
  .cta-left { flex-direction: column; }
}

/* Nav Enroll Button */
.btn-enroll-nav {
  padding: 5px 60px !important;
  height: 41px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #6B46C1, #9F7AEA);
  color: #fff !important;
  border-radius: 20px;
  font-weight: 600;
  box-sizing: border-box;
}

.btn-enroll-nav i {
  color: #fff !important;
  margin-left: 8px;
}

/* Mobile Navbar Fixes */
@media screen and (max-width: 991px) {
  .st-nav.st-mobile-nav a, 
  .st-nav-list a,
  .st-mobile-nav ul li a {
    color: #060814 !important; /* Force dark text for all nav links on mobile */
  }
  .st-nav.st-mobile-nav li.current-menu-item > a,
  .st-nav-list li.current-menu-item > a {
    color: var(--accent-purple) !important;
  }
  
  .st-nav.st-mobile-nav .btn-enroll-nav,
  .st-nav-list .btn-enroll-nav,
  .btn-enroll-nav {
    padding: 10px 20px !important;
    margin: 15px auto !important;
    width: 90% !important;
    max-width: 250px;
    display: flex !important;
    justify-content: center;
    color: #fff !important; /* Keep button text white */
    box-sizing: border-box;
  }
}
