/* ==========================================================================
   TuteStudentHQ – Updated Styles
   Accent-color: #4D0610 (links, icons, etc.)
   Pastel-pink card background, hover/animations, spacing, typography
   ========================================================================== */

/* 0. Root Variables & Base Styles */
:root {
  --tadb-font-base:     14px;         /* body text */
  --tadb-font-h1:       24px;         /* main page title */
  --tadb-font-h2:       18px;         /* section subheads */
  --tadb-accent-color:  #4D0610;      /* new brand accent */
  --tadb-bg-page:       #F8F7F5;      /* very light off-white */
  --tadb-bg-card:       #FFF5F5;      /* pastel-pink card background */
  --tadb-border-color:  #E5DFDC;      /* slightly off-gray border */
  --tadb-shadow:        0 0 12px rgba(0, 0, 0, 0.05);
  --tadb-radius:        1rem;         /* 16px */
  --tadb-gap:           16px;         /* grid gap */
}

body {
  background: var(--tadb-bg-page);
  font-size: var(--tadb-font-base);
  color: #333;
  line-height: 1.5;
  font-family: ui-sans-serif, system-ui, sans-serif;
  margin: 0;
  padding: 0;
}

/* 1. Container */
.tadb-container {
  max-width: 1024px;
  margin: 3rem auto;
  padding: 0 1rem;
}

/* 2. Breadcrumb & Page Title */
.tadb-breadcrumb {
  margin-bottom: 0.5rem;
}
.tadb-breadcrumb-link {
  color: #666;
  font-size: 12px;
  text-decoration: none;
}
.tadb-breadcrumb-sep {
  margin: 0 0.25rem;
  color: #666;
}
.tadb-breadcrumb-current {
  font-size: 12px;
  color: #666;
}

.tadb-page-title {
  font-size: var(--tadb-font-h1);
  font-weight: 600;
  color: var(--tadb-accent-color);
  margin-top: 0.25rem;
  margin-bottom: 1.5rem;
}

/* 3. Overview Bar */
.tadb-overview {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--tadb-gap);
  margin-bottom: 32px;
}
.tadb-overview-card {
  background: var(--tadb-bg-card);
  border: 1px solid var(--tadb-border-color);
  border-radius: var(--tadb-radius);
  box-shadow: var(--tadb-shadow);
  padding: 24px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tadb-overview-card:hover,
.tadb-overview-card:focus {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  outline: none;
}
.tadb-overview-icon {
  color: var(--tadb-accent-color);
  font-size: 32px;
  margin-bottom: 8px;
}
.tadb-overview-number {
  font-size: var(--tadb-font-h2);
  font-weight: 600;
  color: var(--tadb-accent-color);
}
.tadb-overview-label {
  font-size: var(--tadb-font-base);
  color: #555;
}

/* 4. Tabs Navigation */
.tadb-tabs-nav {
  display: flex;
  gap: var(--tadb-gap);
  list-style: none;
  padding: 0;
  margin-bottom: 1.5rem;
  overflow-x: auto; /* allow horizontal scroll on mobile */
}
.tadb-tabs-nav li {
  cursor: pointer;
  padding: 0.5rem 1rem;
  background: #e5e7eb;
  border-radius: 0.5rem;
  font-weight: 600;
  flex: 0 0 auto;
  transition: background 0.2s ease, color 0.2s ease;
}
.tadb-tabs-nav li.active {
  background: var(--tadb-accent-color);
  color: #ffffff;
}
.tadb-tabs-nav li:hover {
  background: #d1c7c4;
}
.tadb-tab-panel {
  display: none;
}

/* 5. Sections & Headings */
.tadb-section {
  margin-bottom: 32px;
}
.tadb-section-title {
  font-size: var(--tadb-font-h2);
  font-weight: 600;
  color: var(--tadb-accent-color);
  margin-bottom: 16px;
  display: inline-block;
}
.tadb-tooltip {
  margin-left: 8px;
  color: #666;
  font-size: 14px;
  cursor: pointer;
  position: relative;
}
.tadb-tooltip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: 125%;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 10;
}
.tadb-tooltip:hover::before {
  content: '';
  position: absolute;
  left: 10px;
  bottom: 115%;
  border-width: 6px;
  border-style: solid;
  border-color: rgba(0,0,0,0.75) transparent transparent transparent;
  z-index: 10;
}

/* 6. Generic Card (Pastel BG, Hover Lift) */
.tadb-card {
  background: var(--tadb-bg-card);
  border: 1px solid var(--tadb-border-color);
  border-radius: var(--tadb-radius);
  box-shadow: var(--tadb-shadow);
  padding: 16px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tadb-card:hover,
.tadb-card:focus-within {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.tadb-card:focus-within {
  outline: 2px dashed var(--tadb-accent-color);
  outline-offset: 2px;
}

/* 7. Empty State */
.tadb-empty-state {
  text-align: center;
  padding: 24px;
}
.tadb-empty-icon {
  font-size: 48px;
  color: #bbb;
  margin-bottom: 16px;
}
.tadb-empty-text {
  font-size: 16px;
  color: #555;
  margin-bottom: 12px;
}
.tadb-empty-illustration {
  max-width: 150px;
  margin-bottom: 16px;
}

/* 8. Timeline (Today’s Agenda) */
.tadb-timeline {
  list-style: none;
  padding-left: 0;
  border-left: 3px solid var(--tadb-border-color);
  margin: 0;
}
.tadb-timeline-item {
  position: relative;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: flex-start;
}
.tadb-timeline-item::before {
  content: '';
  position: absolute;
  left: -9px;
  top: 4px;
  width: 12px;
  height: 12px;
  background: var(--tadb-accent-color);
  border-radius: 50%;
}
.tadb-time {
  font-size: 0.85rem;
  color: #6b7280;
  margin-right: 0.5rem;
  min-width: 60px;
}
.tadb-timeline-card {
  background: var(--tadb-bg-card);
  border: 1px solid var(--tadb-border-color);
  border-radius: 0.75rem;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.tadb-timeline-card:hover {
  background: #f0e8e8;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.tadb-lesson-info {
  display: flex;
  align-items: center;
}
.tadb-lesson-icon {
  font-size: 20px;
  color: var(--tadb-accent-color);
  margin-right: 8px;
}
.tadb-lesson-details .tadb-lesson-title {
  font-size: var(--tadb-font-base);
  font-weight: 600;
  color: #333;
}
.tadb-lesson-details .tadb-lesson-subtitle {
  font-size: 12px;
  color: #666;
}

/* 9. Streak / Quiz / Badges Grid */
.tadb-section-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--tadb-gap);
}

/* 9a. Streak Counter */
.tadb-streak-card {
  text-align: center;
  padding: 24px;
}
.tadb-streak-icon {
  font-size: 32px;
  color: var(--tadb-accent-color);
  margin-bottom: 8px;
}
.tadb-streak-number {
  font-size: var(--tadb-font-h2);
  font-weight: 600;
  color: #333;
}
.tadb-streak-label {
  font-size: var(--tadb-font-base);
  color: #555;
}
.tadb-streak-milestone {
  font-size: 12px;
  color: var(--tadb-accent-color);
  margin-top: 8px;
}

/* 9b. Quiz Breakdown (Radar – original, if you still use elsewhere) */
.tadb-radar-card {
  position: relative;
}
.tadb-card-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  display: inline-block;
}
.tadb-radar-legend {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}
.tadb-actionable-insight {
  font-size: 13px;
  color: #e11d48;
  margin-top: 12px;
}
/* =====================================================================
   9b-ext. Quiz Strengths (HTML/CSS bar-graph)
   ===================================================================== */

.tadb-quiz-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Each bar container: JS will set `--tadb-fill-target: XX%;` on the .tadb-quiz-fill */
.tadb-quiz-bar {
  display: flex;
  flex-direction: column;
}

/* Label row: category name + percentage */
.tadb-quiz-label {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
  display: flex;
  justify-content: space-between;
}

/* Percentage text next to label */
.tadb-quiz-grade {
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* The track (background “rail”) */
.tadb-quiz-track {
  position: relative;
  background: #ececec;
  border-radius: 0.5rem;
  height: 20px;
  overflow: hidden;
}

/* The colored fill bar: 
   – Now uses `var(--fill-color)` (set inline from PHP) 
   – Its width animates from 0 → var(--tadb-fill-target) */
.tadb-quiz-fill {
  background: var(--fill-color);
  height: 100%;
  width: 0;
  border-radius: 0.5rem 0 0 0.5rem;
  transition: width 0.6s ease;
  animation: tadb-fill-anim 0.8s forwards;
}

/* The white percentage text overlaid on the fill */
.tadb-quiz-percent {
  position: absolute;
  top: 0;
  right: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  line-height: 20px;
  pointer-events: none;
}

/* Keyframe uses the CSS variable `--tadb-fill-target`, which JS must set inline to "XX%". */
@keyframes tadb-fill-anim {
  to {
    width: var(--tadb-fill-target);
  }
}

/* If a zero score, show a neutral gray fill */
.tadb-quiz-fill[aria-valuenow="0"] {
  background: #bbb;
}


/* 9c. Badges & Certificates Scroll */
.tadb-badges-card-container {
  position: relative;
  padding-bottom: 24px;
}
.tadb-badges-scroll {
  display: flex;
  gap: var(--tadb-gap);
  overflow-x: auto;
  padding-bottom: 8px;
}
.tadb-badge-snippet {
  display: inline-block;
  font-size: 20px;
  color: var(--tadb-accent-color);
  text-decoration: none;
}
.tadb-badge-snippet:hover,
.tadb-badge-snippet:focus {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  outline: none;
}
.tadb-badge-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.tadb-scroll-hint {
  position: absolute;
  bottom: 0;
  right: 0;
  font-size: 12px;
  color: #666;
  background: linear-gradient(to left, var(--tadb-bg-page) 40%, transparent);
  padding-left: 16px;
}

/* 9d. Recommended Next Course */
.tadb-course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--tadb-gap);
}
.tadb-course-recommend-card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: var(--tadb-bg-card);
  border: 1px solid var(--tadb-border-color);
  border-radius: var(--tadb-radius);
  box-shadow: var(--tadb-shadow);
  overflow: hidden;
}
.tadb-course-recommend-card:hover,
.tadb-course-recommend-card:focus {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  outline: none;
}
.tadb-course-no-thumb {
  width: 100%;
  height: 120px;
  background: #FCEDEC; /* subtle pastel */
  display: flex;
  align-items: center;
  justify-content: center;
  border-top-left-radius: var(--tadb-radius);
  border-top-right-radius: var(--tadb-radius);
  color: #aaa;
  font-size: 32px;
}
.tadb-course-thumb {
  width: 100%;
  height: auto;
}
.tadb-course-content {
  padding: 16px;
  position: relative;
}
.tadb-course-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px;
  line-height: 1.2;
}
.tadb-course-btn {
  margin-top: 8px;
}
.tadb-btn-outline {
  background: transparent;
  border: 2px solid var(--tadb-accent-color);
  color: var(--tadb-accent-color);
}
.tadb-btn-outline:hover,
.tadb-btn-outline:focus {
  background: var(--tadb-accent-color);
  color: #fff;
  outline: none;
}

/* 9e. Recent Billing */
.tadb-billing-card {
  overflow-x: auto;
  background: var(--tadb-bg-card);
  border: 1px solid var(--tadb-border-color);
  border-radius: var(--tadb-radius);
  box-shadow: var(--tadb-shadow);
  padding: 16px;
}
.tadb-billing-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
}
.tadb-billing-table thead th {
  background: #f0e8e8; /* light pastel */
  padding: 8px;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
.tadb-billing-table tbody tr {
  background: var(--tadb-bg-card);
}
.tadb-billing-table tbody tr:nth-child(even) {
  background: #FDF5F5; /* alternating pastel */
}
.tadb-billing-table td {
  padding: 8px;
  white-space: nowrap;
}
.tadb-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
}
.tadb-pill-green  { background: #10b981; }
.tadb-pill-orange { background: #f59e0b; }
.tadb-pill-red    { background: #e11d48; }
.tadb-view-all {
  margin-top: 12px;
  text-align: right;
}

/* 10. My Courses (interactive cards) */
.tadb-course-card {
  background: var(--tadb-bg-card);
  border: 1px solid var(--tadb-border-color);
  border-radius: var(--tadb-radius);
  box-shadow: var(--tadb-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tadb-course-card:hover,
.tadb-course-card:focus {
  outline: none;
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}
.tadb-course-card:focus {
  outline: 2px dashed var(--tadb-accent-color);
  outline-offset: 2px;
}
.tadb-course-no-thumb {
  width: 100%;
  height: 120px;
  background: #FCEDEC; /* subtle pastel */
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaa;
  font-size: 32px;
}
.tadb-course-thumb {
  width: 100%;
  height: auto;
}
.tadb-course-content {
  padding: 16px;
  position: relative;
}
.tadb-course-status {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 18px;
  color: var(--tadb-accent-color);
}
.tadb-course-status-complete { color: #10b981; }
.tadb-course-status-progress { color: #f59e0b; }
.tadb-course-title {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 8px;
  line-height: 1.2;
}
.tadb-progress-ring {
  width: 40px;
  height: 40px;
  position: relative;
  margin-bottom: 8px;
}
.tadb-progress-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.tadb-progress-bg {
  fill: none;
  stroke: #e0e5ec;
  stroke-width: 4;
}
.tadb-progress-fg {
  fill: none;
  stroke: var(--tadb-accent-color);
  stroke-width: 4;
  stroke-dasharray: 113;
  stroke-dashoffset: 113;
  transition: stroke-dashoffset 0.5s ease-out;
}
.tadb-progress-text {
  font-size: 12px;
  fill: #333;
  transform: rotate(90deg);
}
.tadb-course-btn {
  font-size: 14px;
}

/* 11. Enroll New (cards + load more) */
.tadb-course-enroll-card {
  background: var(--tadb-bg-card);
  border: 1px solid var(--tadb-border-color);
  border-radius: var(--tadb-radius);
  box-shadow: var(--tadb-shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tadb-course-enroll-card:hover,
.tadb-course-enroll-card:focus {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  outline: none;
}
.tadb-course-content {
  padding: 16px;
}
.tadb-load-more {
  text-align: center;
  margin-top: 16px;
}

/* 12. Utility Buttons */
.tadb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  background: var(--tadb-accent-color);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
  text-decoration: none;
}
.tadb-btn:hover,
.tadb-btn:focus {
  background: #3a040c; /* slightly darker variant of #4D0610 */
  transform: translateY(-2px);
  outline: none;
}

/* 13. Messages (comment notifications) */
.tadb-message-card {
  background: var(--tadb-bg-card);
  border: 1px solid var(--tadb-border-color);
  border-radius: var(--tadb-radius);
  padding: 16px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.tadb-message-card:hover,
.tadb-message-card:focus-within {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  outline: none;
}
.tadb-message-content {
  font-size: var(--tadb-font-base);
  color: #333;
}
.tadb-message-date {
  font-size: 12px;
  color: #666;
  margin-top: 8px;
}

/* 14. Loading Skeleton (optional) */
.tadb-skeleton {
  position: relative;
  background: #e5e7eb;
  overflow: hidden;
}
.tadb-skeleton::before {
  content: '';
  position: absolute;
  top: 0; left: -200px;
  height: 100%;
  width: 200px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.6), transparent);
  animation: tadb-shimmer 1.2s infinite;
}
@keyframes tadb-shimmer {
  0%   { left: -200px; }
  100% { left: 100%; }
}

/* 15. Mobile-first Adjustments */
@media (max-width: 640px) {
  .tadb-overview {
    grid-template-columns: 1fr !important;
  }
  .tadb-course-card,
  .tadb-course-recommend-card,
  .tadb-course-enroll-card {
    margin-bottom: 16px;
  }
  .tadb-tabs-nav {
    overflow-x: auto;
    white-space: nowrap;
  }
  .tadb-tabs-nav li {
    flex: 0 0 auto;
  }
  .tadb-btn {
    padding: 12px 16px;
    font-size: 16px;
  }
}
