/* HackerDNA - Professional Courses List (Refined Dark Theme) */

:root {
  --primary: #7367f0;
  --primary-dark: #5e50ee;
  --secondary: #28c76f;
  --accent: #00cfe8;
  --dark-bg: #1e1e2d;
  --card-bg: #282a3c;
  --text-primary: #e7e7ff;
  --text-secondary: #a8aabc;
  --border-color: rgba(115, 103, 240, 0.12);
}

/* === Page Layout === */
body {
  background: 
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(115, 103, 240, 0.08), transparent),
    #161622;
  min-height: 100vh;
}

.layout-wrapper {
  background: transparent;
}

.content-wrapper {
  background: transparent;
}

.container-xxl {
  background: transparent;
}

/* === Page Header === */
.page-header {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 2rem;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.page-header-content {
  position: relative;
  z-index: 1;
  padding: 1.75rem 2rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  letter-spacing: -0.01em;
}

.page-title i {
  font-size: 1.75rem;
  color: var(--primary);
}

.page-subtitle {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* === Stats Overview === */
.stats-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card-courses {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.stat-card-courses::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--stat-gradient);
}

.stat-card-courses:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  border-color: var(--stat-color);
}

.stat-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.stat-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stat-bg);
}

.stat-card-icon i {
  font-size: 1.25rem;
  color: var(--stat-color);
}

.stat-card-title {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--stat-color);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

/* Stat Colors */
.stat-total {
  --stat-color: #7367f0;
  --stat-bg: rgba(115, 103, 240, 0.1);
  --stat-gradient: linear-gradient(90deg, #7367f0, #9e95f5);
}

.stat-completed {
  --stat-color: #28c76f;
  --stat-bg: rgba(40, 199, 111, 0.1);
  --stat-gradient: linear-gradient(90deg, #28c76f, #48da89);
}

.stat-in-progress {
  --stat-color: #ff9f43;
  --stat-bg: rgba(255, 159, 67, 0.1);
  --stat-gradient: linear-gradient(90deg, #ff9f43, #ffb976);
}

.stat-chapters {
  --stat-color: #00cfe8;
  --stat-bg: rgba(0, 207, 232, 0.1);
  --stat-gradient: linear-gradient(90deg, #00cfe8, #1ce7ff);
}

/* === Section Card === */
.section-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.section-card-header {
  background: transparent;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.section-card-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--section-color, #7367f0);
}

.section-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title-wrapper {
  flex: 1;
  min-width: 250px;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--section-bg, rgba(115, 103, 240, 0.12));
}

.section-icon i {
  font-size: 0.875rem;
  color: var(--section-color, #7367f0);
}

.section-subtitle {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Section Colors */
.section-latest {
  --section-color: #00cfe8;
  --section-bg: rgba(0, 207, 232, 0.12);
}

.section-completed {
  --section-color: #28c76f;
  --section-bg: rgba(40, 199, 111, 0.12);
}

.section-in-progress {
  --section-color: #ff9f43;
  --section-bg: rgba(255, 159, 67, 0.12);
}

.section-available {
  --section-color: #7367f0;
  --section-bg: rgba(115, 103, 240, 0.12);
}

.section-card-body {
  padding: 0;
}

/* === Course Grid === */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  padding: 1.5rem;
}

.course-card {
  background: rgba(40, 42, 60, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--course-color, #7367f0);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.course-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  border-color: var(--course-color, rgba(115, 103, 240, 0.4));
}

.course-card:hover::before {
  opacity: 1;
}

.course-card-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.course-image-wrapper {
  position: relative;
  flex-shrink: 0;
}

.course-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.course-status-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.course-status-badge.completed {
  background: var(--secondary);
  color: #fff;
}

.course-status-badge.in-progress {
  background: #ff9f43;
  color: #fff;
}

.course-status-badge i {
  font-size: 0.75rem;
}

.course-info {
  flex: 1;
  min-width: 0;
}

.course-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  text-decoration: none;
  display: block;
  line-height: 1.3;
}

.course-name:hover {
  color: var(--primary);
  text-decoration: none;
}

.course-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.new-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  background: rgba(40, 199, 111, 0.15);
  color: var(--secondary);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  border: 1px solid rgba(40, 199, 111, 0.25);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.new-badge i {
  font-size: 0.75rem;
}

.course-description {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.skill-tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: rgba(115, 103, 240, 0.12);
  color: var(--primary);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 500;
  border: 1px solid rgba(115, 103, 240, 0.2);
}

.course-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.course-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.course-meta-item i {
  font-size: 0.875rem;
  color: var(--primary);
}

.course-points {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  background: rgba(255, 159, 67, 0.12);
  color: #ff9f43;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(255, 159, 67, 0.2);
}

.course-points i {
  font-size: 0.875rem;
}

/* === Course Progress === */
.course-progress {
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.progress-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-percentage {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--progress-color, #7367f0);
}

.progress-bar-wrapper {
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--progress-color, #7367f0);
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-completed {
  --progress-color: #28c76f;
}

.progress-in-progress {
  --progress-color: #ff9f43;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.375rem;
}

/* === Course Actions === */
.course-actions {
  display: flex;
  gap: 0.5rem;
}

.btn-course {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.8125rem;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-course i {
  font-size: 0.875rem;
}

.btn-course-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(115, 103, 240, 0.25);
}

.btn-course-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 12px rgba(115, 103, 240, 0.35);
  color: #fff;
}

.btn-course-success {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(40, 199, 111, 0.25);
}

.btn-course-success:hover {
  background: #22b865;
  box-shadow: 0 4px 12px rgba(40, 199, 111, 0.35);
  color: #fff;
}

.btn-course-warning {
  background: #ff9f43;
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 159, 67, 0.25);
}

.btn-course-warning:hover {
  background: #ff8f22;
  box-shadow: 0 4px 12px rgba(255, 159, 67, 0.35);
  color: #fff;
}

/* === Latest Chapters Compact List === */
.chapters-compact-list {
  padding: 0;
}

.chapter-compact-item {
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.chapter-compact-item:last-child {
  border-bottom: none;
}

.chapter-compact-item:hover {
  background: rgba(115, 103, 240, 0.06);
}

.chapter-image {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.chapter-info {
  flex: 1;
  min-width: 0;
}

.chapter-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  text-decoration: none;
  display: block;
}

.chapter-name:hover {
  color: var(--primary);
  text-decoration: none;
}

.chapter-course {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.chapter-meta-compact {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.chapter-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chapter-date i {
  font-size: 0.875rem;
  color: var(--accent);
}

.chapter-points-badge {
  padding: 0.25rem 0.5rem;
  background: rgba(0, 207, 232, 0.12);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  border: 1px solid rgba(0, 207, 232, 0.2);
}

.chapter-action {
  flex-shrink: 0;
}

.btn-chapter {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.btn-chapter-start {
  background: rgba(0, 207, 232, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 207, 232, 0.25);
}

.btn-chapter-start:hover {
  background: rgba(0, 207, 232, 0.2);
  box-shadow: 0 2px 8px rgba(0, 207, 232, 0.2);
  color: var(--accent);
  text-decoration: none;
}

.btn-chapter-completed {
  background: rgba(40, 199, 111, 0.12);
  color: var(--secondary);
  border: 1px solid rgba(40, 199, 111, 0.25);
  cursor: default;
}

/* === Empty State === */
.empty-state-courses {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-icon-courses {
  width: 64px;
  height: 64px;
  background: rgba(115, 103, 240, 0.12);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.empty-icon-courses i {
  font-size: 2rem;
  color: var(--primary);
}

.empty-title-courses {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.empty-text-courses {
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

/* === Expand Button === */
.expand-section-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
}

.expand-section-btn:hover {
  background: rgba(115, 103, 240, 0.12);
  border-color: rgba(115, 103, 240, 0.3);
  color: var(--primary);
}

.expand-section-btn i {
  font-size: 0.875rem;
  transition: transform 0.3s ease;
}

.expand-section-btn.expanded i {
  transform: rotate(180deg);
}

/* === Hidden items for expansion === */
.expandable-item {
  display: none;
  opacity: 0;
  animation: fadeIn 0.3s ease-in-out forwards;
}

.expandable-item.show {
  display: flex;
}

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

/* === Responsive Design === */
@media (max-width: 768px) {
  .page-header-content {
    padding: 1.25rem 1.5rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .stats-overview {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .stat-card-value {
    font-size: 1.5rem;
  }

  .courses-grid {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .course-card {
    padding: 1rem;
  }

  .chapter-compact-item {
    flex-wrap: wrap;
    padding: 0.75rem 1rem;
  }

  .chapter-meta-compact {
    width: 100%;
  }

  .chapter-action {
    width: 100%;
  }

  .btn-chapter {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .page-title {
    font-size: 1.25rem;
    gap: 0.5rem;
  }

  .page-title i {
    font-size: 1.5rem;
  }

  .section-header-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .expand-section-btn {
    width: 100%;
    justify-content: center;
  }

  .stats-overview {
    grid-template-columns: 1fr;
  }

  .course-image {
    width: 48px;
    height: 48px;
  }

  .chapter-compact-item {
    flex-direction: column;
    align-items: flex-start;
  }
}
