/* ==========================================================================
   programCard Component Styles
   Supports Programs Tab View with 3 distinct layouts:
   - In Progress: 1 item per row full-width card with progress bar
   - Available Programs: 2 items per row grid cards
   - Completed: 1 narrow item per row compact horizontal bar
   ========================================================================== */

/* Main Container */
.programs-section-container {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 100%;
  box-sizing: border-box;
}

/* Group Section Header */
.programs-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.programs-group-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.programs-group-title {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.015em;
  margin: 0;
}

.programs-group-subtitle {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 11.5px;
  font-weight: 400;
  color: #6b7280;
  margin: 0;
}

/* Shared Card Base */
.program-card {
  background-color: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  box-sizing: border-box;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.program-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* Badge Pills - Subtle, greyish, text-length bound */
.program-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  align-self: flex-start;
  padding: 2.5px 7px;
  border-radius: 4px;
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
}

.badge-in-progress,
.badge-new,
.badge-popular,
.badge-completed {
  background-color: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #374151;
}

/* Menu Button */
.program-menu-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
  outline: none;
}

.program-menu-btn:hover {
  color: #111827;
  background-color: #f3f4f6;
}

/* Buttons */
.program-action-btn {
  background-color: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #111827;
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  outline: none;
  white-space: nowrap;
}

.program-action-btn:hover {
  background-color: #f3f4f6;
  border-color: #d1d5db;
}

/* ==========================================================================
   1. IN PROGRESS LAYOUT (1 item per row)
   ========================================================================== */
.programs-list-in-progress {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.program-card-in-progress {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.program-in-progress-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.program-card-img {
  width: 76px;
  height: 76px;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #f1f5f9;
}

.program-in-progress-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.program-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.program-card-title {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 13.5px;
  font-weight: 700;
  color: #111827;
  margin: 2px 0 0 0;
  line-height: 1.3;
}

.program-card-subtitle {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Progress Bar - Enforces primary brand blue #5170FF */
.program-progress-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.program-progress-text-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 11px;
}

.program-progress-days {
  color: #6b7280;
  font-weight: 400;
}

.program-progress-percent {
  color: #111827;
  font-weight: 700;
}

.program-progress-track {
  width: 100%;
  height: 6px;
  background-color: #f1f5f9;
  border-radius: 3px;
  overflow: hidden;
}

.program-progress-fill {
  height: 100%;
  background-color: #5170FF;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* Footer Row */
.program-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-top: 2px;
}

.program-footer-date {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #6b7280;
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 11px;
}

.btn-continue {
  padding: 6px 14px;
}

/* ==========================================================================
   2. AVAILABLE PROGRAMS LAYOUT (2 items per row)
   ========================================================================== */
.programs-grid-available {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.program-card-available {
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  height: 100%;
}

.program-available-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
}

.program-card-img-sm {
  width: 44px;
  height: 44px;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #f1f5f9;
}

.program-available-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.program-card-title-sm {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 12.5px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.program-card-subtitle-sm {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 10.5px;
  font-weight: 400;
  color: #6b7280;
  margin: 0;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 28px;
}

.program-available-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.program-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 10px;
  color: #6b7280;
}

.btn-view-details {
  width: 100%;
  padding: 6.5px 0;
  text-align: center;
  margin-top: auto; /* Fixed in reference to card bottom */
}

/* ==========================================================================
   3. COMPLETED LAYOUT (1 narrow item per row)
   ========================================================================== */
.programs-list-completed {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.program-card-completed {
  padding: 12px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.program-card-img-compact {
  width: 52px;
  height: 52px;
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background-color: #f1f5f9;
}

.program-completed-main {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

/* Top Row: COMPLETED badge on left, Completed on ... date + dots menu on right */
.program-completed-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.program-completed-date-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.program-completed-date {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 11px;
  color: #6b7280;
  font-weight: 400;
}

/* Body: Title + Subtitle */
.program-completed-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.program-card-title-compact {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  line-height: 1.35;
}

.program-card-subtitle-compact {
  font-family: var(--font-inter, 'Inter', sans-serif);
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
  margin: 0;
  line-height: 1.35;
}

/* Bottom Row: View Program button at bottom left corner */
.program-completed-bottom-row {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin-top: 6px;
}

.btn-view-program {
  padding: 5.5px 14px;
  font-size: 11.5px;
}
