/* ==========================================================================
   CodeNest - Page-Specific Layouts & Specialized Styles
   ========================================================================== */

/* ==========================================================================
   1. HOME PAGE
   ========================================================================== */
.hero-section {
  padding: 80px 0 60px;
  background: radial-gradient(100% 100% at 50% 0%, #eff6ff 0%, #ffffff 80%);
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 50px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--primary-light);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: var(--radius-full);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.hero-gradient-text {
  background: linear-gradient(135deg, var(--primary) 0%, var(--cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subheading {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Hero Code Window Illustration (Pure CSS) */
.hero-visual {
  background: #0f172a;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 1px solid #1e293b;
  overflow: hidden;
  position: relative;
}

.code-window-header {
  background: #1e293b;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.code-window-dots {
  display: flex;
  gap: 6px;
}

.code-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.code-window-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #94a3b8;
}

.code-window-body {
  padding: 24px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.8;
  color: #f8fafc;
}

.code-keyword { color: #38bdf8; }
.code-fn { color: #a855f7; }
.code-str { color: #34d399; }
.code-comment { color: #64748b; font-style: italic; }

/* Stats Bar */
.stats-section {
  padding: 40px 0;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item h3 {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.stat-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Section Shared Headers */
.section-wrap {
  padding: 80px 0;
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 48px;
}

.section-tag {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 8px;
  display: inline-block;
}

.section-h2 {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.section-p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* Learning Paths Grid */
.paths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.path-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.path-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.path-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.3rem;
  margin-bottom: 20px;
}

.path-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.path-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
}

.path-footer {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
}

.feature-box {
  background: #ffffff;
  padding: 32px 26px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.feature-box:hover {
  border-color: var(--cyan);
  box-shadow: var(--shadow-md);
}

.feature-box-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
}

/* Testimonials */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 28px;
}

.testimonial-card {
  background: #ffffff;
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.testimonial-rating {
  color: var(--warning);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.testimonial-text {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
  flex-grow: 1;
  font-style: italic;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 14px;
}

.testimonial-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-info h4 {
  font-size: 0.92rem;
  font-weight: 700;
}

.testimonial-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Call to Action */
.cta-section {
  padding: 70px 0;
}

.cta-box {
  background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
  color: #ffffff;
  padding: 60px 40px;
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.cta-box h2 {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 14px;
}

.cta-box p {
  font-size: 1.15rem;
  color: #dbeafe;
  max-width: 600px;
  margin: 0 auto 32px;
}

/* ==========================================================================
   2. COURSES MARKETPLACE PAGE (/courses)
   ========================================================================= */
.courses-page-header {
  padding: 40px 0;
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
}

.courses-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 36px;
  padding: 40px 0 80px;
}

.courses-sidebar {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  height: fit-content;
}

.filter-group {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-group-title {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  margin-bottom: 14px;
}

.filter-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  cursor: pointer;
}

.filter-checkbox-item input {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}

.courses-main-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.courses-search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 6px 14px;
  width: 100%;
  max-width: 400px;
}

.courses-search-bar input {
  border: none;
  outline: none;
  padding: 6px 8px;
  width: 100%;
  font-size: 0.92rem;
}

.courses-sort-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.courses-grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 24px;
}

/* ==========================================================================
   3. COURSE DETAIL PAGE (/course)
   ========================================================================== */
.course-detail-hero {
  background: #ffffff;
  border-bottom: 1px solid var(--border-subtle);
  padding: 50px 0;
}

.course-detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  padding: 50px 0;
}

.course-hero-badge-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.course-detail-title {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
}

.course-detail-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
}

.course-instructor-inline {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.course-instructor-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

/* Sticky Action Card */
.course-sidebar-card {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: sticky;
  top: 100px;
}

.course-sidebar-thumb {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 4.5rem;
}

.course-sidebar-body {
  padding: 24px;
}

/* Lesson Items */
.lesson-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.lesson-list-item:hover {
  background: #ffffff;
  color: var(--primary);
}

.lesson-list-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   4. INTERACTIVE LEARNING PAGE (/learning)
   ========================================================================== */
.learning-screen {
  display: grid;
  grid-template-columns: 320px 1fr 280px;
  height: calc(100vh - 72px);
  background: #ffffff;
  overflow: hidden;
}

.learning-curriculum-panel {
  background: #ffffff;
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.learning-content-panel {
  overflow-y: auto;
  padding: 40px;
  background: var(--bg-body);
}

.learning-sidebar-panel {
  background: #ffffff;
  border-left: 1px solid var(--border-subtle);
  overflow-y: auto;
  padding: 24px;
}

/* Real-looking Code Editor Container */
.code-editor-box {
  background: #0f172a;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: 24px 0;
  border: 1px solid #1e293b;
}

.code-editor-top {
  background: #1e293b;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #94a3b8;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.code-editor-pre {
  padding: 20px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: #f8fafc;
  line-height: 1.7;
  overflow-x: auto;
}

/* ==========================================================================
   5. DASHBOARD & SETTINGS
   ========================================================================== */
.dashboard-wrap {
  padding: 40px 0 80px;
}

.dash-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.dash-stat-box {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.dash-stat-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* Settings Tabs Layout */
.settings-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  padding: 40px 0 80px;
}

.settings-nav {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.settings-nav-item:hover {
  background: var(--bg-surface-alt);
  color: var(--primary);
}

.settings-nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.settings-panel {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px;
}

.settings-panel-head {
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 20px;
  margin-bottom: 28px;
}

/* Radio Group (Theme / Appearance) */
.radio-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 10px;
}

.radio-card {
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.radio-card.active,
.radio-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

/* ==========================================================================
   6. ADMIN DASHBOARD & MODULES
   ========================================================================== */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 72px);
}

.admin-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border-subtle);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.admin-sidebar-link:hover,
.admin-sidebar-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

.admin-content {
  padding: 36px;
  background: var(--bg-body);
  overflow-y: auto;
}

.admin-chart-mockup {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 30px;
}

.css-bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  height: 180px;
  padding-top: 20px;
  border-bottom: 2px solid var(--border-subtle);
}

.css-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--primary) 0%, var(--cyan) 100%);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height 0.6s ease;
  position: relative;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .hero-grid,
  .course-detail-layout,
  .courses-layout,
  .settings-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }
  
  .learning-screen {
    grid-template-columns: 1fr;
    height: auto;
  }
  
  .stats-grid,
  .dash-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .stats-grid,
  .dash-stats-row {
    grid-template-columns: 1fr;
  }
}
