@charset "utf-8";
/* =========================================
   Learning Design Lesson Insights
   Global Stylesheet
   ========================================= */

/* ---------- CSS Variables / Theme ---------- */

:root {
  --endeavor-blue: #235ff8;
  --deep-sea: #0b1b42;
  --sky-blue: #e1f5fc;
  --tangelo: #f15624;
  --sunglow: #ffcf30;
  --alt-gray: #56668c;
  --bg-soft: #f5f6fa;
  --card-bg: #ffffff;
  --border-soft: #e0e4f0;
  --text-main: #111827;
  --text-muted: #6b7280;
  --radius-lg: 16px;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
}

/* ---------- Base / Reset ---------- */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e1f5fc, #f5f6fa 40%, #ffffff 80%);
  color: var(--text-main);
  min-height: 100vh;
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- Top Bar / Header ---------- */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  background: rgba(11, 27, 66, 0.97);
  color: #ffffff;
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark{
  width: 50px;
  height: 50px;
  background: url("../images/cat-nap.svg") center/contain no-repeat;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-weight: 650;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
}

.brand-subtitle {
  font-size: 0.78rem;
  color: rgba(226, 232, 240, 0.9);
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* Course selector in header */

.select-course {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-size: 0.8rem;
  color: #e5e7eb;
}

.select-course label {
  font-size: 0.78rem;
  color: #cbd5f5;
}

.select-course select {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  outline: none;
  appearance: none;
  padding-right: 1.25rem;
  cursor: pointer;
}

.select-course::after {
  content: "▾";
  font-size: 0.7rem;
  color: #9ca3af;
  pointer-events: none;
  margin-left: -1rem;
}

/* ---------- Buttons / Pills ---------- */

.muted-arrow {
  opacity: .35;
  font-weight: 600;
}

.pill-button {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.45rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.85);
  color: #e5e7eb;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.12s ease,
    border-color 0.12s ease, color 0.12s ease;
}

.pill-button span.icon {
  font-size: 0.9rem;
}

.pill-button.primary {
  background: linear-gradient(135deg, var(--endeavor-blue), #3b82f6);
  color: #ffffff;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.35);
  border-color: rgba(191, 219, 254, 0.2);
}

.pill-button.danger {
  background: rgba(248, 113, 113, 0.08);
  border-color: rgba(248, 113, 113, 0.7);
  color: #fecaca;
}

.pill-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

.pill-button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 310px) minmax(0, 1fr);
  gap: 1.5rem;
  padding: 1.5rem 1.75rem 1.75rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.full-width { width: 100%; }

@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.course-header{
  margin: 0 0 1rem 0;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(15,35,80,0.08);
}

.course-title{
  font-weight: 700;
  font-size: 1.05rem;
}

.course-sub{
  margin-top: 0.25rem;
  font-size: 0.82rem;
  opacity: 0.8;
}

/* ---------- Panels / Cards ---------- */

.panel {
  background: rgba(255, 255, 255, 0.98);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-soft);
  padding: 1rem 1.1rem;
}

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

.panel-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--deep-sea);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.panel-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--sky-blue);
  color: var(--endeavor-blue);
  font-weight: 500;
}

.panel table td {
  word-break: break-word;
}

.helper-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ---------- Upload Area ---------- */

.upload-area {
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.8);
  padding: 0.75rem;
  background: linear-gradient(
    135deg,
    rgba(225, 245, 252, 0.8),
    rgba(255, 255, 255, 0.95)
  );
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.upload-main {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.upload-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: radial-gradient(circle at 20% 20%, #ffffff, var(--endeavor-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.upload-text {
  font-size: 0.8rem;
  color: var(--text-main);
}

.upload-text strong {
  font-weight: 600;
}

.upload-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
  align-items: center;
}

/* File input styling */

.file-input-wrapper {
  position: relative;
  display: inline-block;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-input-label {
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.9);
  color: #111827;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.file-input-label span.icon {
  font-size: 0.9rem;
}

.upload-note {
  font-size: 0.7rem;
  color: var(--alt-gray);
}

/* Dedicated submit button used in upload form */

.upload-submit {
  border-radius: 999px;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--endeavor-blue), #3b82f6);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.upload-submit span.icon {
  font-size: 0.9rem;
}

/* ---------- Filters ---------- */

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-control {
  flex: 1;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-control label {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.filter-control input,
.filter-control select {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
  outline: none;
  background: rgba(248, 250, 252, 0.9);
}

.filter-control input:focus,
.filter-control select:focus {
  border-color: var(--endeavor-blue);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
  background: #ffffff;
}

/* ---------- Metrics Row ---------- */

.metrics-row{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  align-items: stretch;
}

@media (max-width: 900px){
  .metrics-row{
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .metrics-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

.metric-card {
  padding: 0.9rem;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at top left, #e1f5fc, #ffffff);
  border: 1px solid var(--border-soft);
  box-shadow: 0 10px 25px rgba(148, 163, 184, 0.25);
  position: relative;
  overflow: hidden;
}

.metric-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--alt-gray);
  margin-bottom: 0.35rem;
}

.metric-value {
  font-size: 1.3rem;
  font-weight: 650;
  color: var(--deep-sea);
}

.metric-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

.metric-pill {
  position: absolute;
  bottom: 0.5rem;
  right: 0.8rem;
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(35, 95, 248, 0.07);
  color: var(--endeavor-blue);
  border: 1px solid rgba(129, 140, 248, 0.35);
}

/* ---------- Sections / Two-column Layout ---------- */

.section {
  margin-top: 0.75rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--deep-sea);
}

.section-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

/* Prevent panels from overflowing their column */
.two-column > * {
  min-width: 0;
}

.panel {
  overflow: hidden;
}

.panel table {
  display: block;
  width: 100%;
  overflow-x: auto;
}

@media (max-width: 900px) {
  .two-column {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- Tables & Badges ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  table-layout: fixed; /* 👈 ADD THIS */
}

th,
td {
  padding: 0.4rem 0.35rem;
  text-align: left;
  word-wrap: break-word;      /* 👈 ADD */
  overflow-wrap: break-word; /* 👈 ADD */
  vertical-align: top;        /* 👈 ADD (optional but recommended) */
}

td.num {
  text-align: right;
  white-space: nowrap;
}

th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--alt-gray);
  border-bottom: 1px solid var(--border-soft);
}

tr:not(:last-child) td {
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.18rem 0.55rem;
  font-size: 0.68rem;
  border-radius: 999px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-hot {
  background: rgba(241, 86, 36, 0.08);
  color: var(--tangelo);
  border: 1px solid rgba(241, 86, 36, 0.5);
}

.badge-good {
  background: rgba(22, 163, 74, 0.08);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.4);
}

.mini-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  font-size: 0.65rem;
  background: rgba(37, 99, 235, 0.06);
  color: #1d4ed8;
}

/* ---------- Chart Placeholder ---------- */

.chart-placeholder {
  height: 180px;
  border-radius: 14px;
  border: 1px dashed rgba(148, 163, 184, 0.8);
  background: repeating-linear-gradient(
    -45deg,
    rgba(226, 232, 240, 0.6),
    rgba(226, 232, 240, 0.6) 1px,
    rgba(248, 250, 252, 0.5) 1px,
    rgba(248, 250, 252, 0.5) 6px
  );
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1rem;
}

/* ---------- Footer ---------- */

.footer {
  padding: 0.75rem 1.75rem 1.25rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

@media (max-width: 700px) {
  .footer {
    flex-direction: column;
  }
}

/* ---------- Print Styles (for PDF export) ---------- */

@media print {
  body {
    background: #ffffff;
  }

  .top-bar,
  .sidebar,
  .footer,
  .pill-button {
    display: none !important;
  }

  .layout {
    padding: 0;
    margin: 0;
    max-width: 100%;
    grid-template-columns: minmax(0, 1fr);
  }

  .main-content {
    gap: 0.5rem;
  }

  .panel,
  .metric-card {
    box-shadow: none;
    border-radius: 0;
    border: 1px solid #e5e7eb;
  }
}

