/* ==========================================================================
   Báo cáo bài tập thực hành React — Stylesheet
   ========================================================================== */

:root {
  --bg-page: #F7F6F3;
  --bg-paper: #FFFFFF;
  --border-color: #EAEAEA;
  --border-table: #D6D5D0;
  --text-primary: #111111;
  --text-body: #222222;
  --text-muted: #666666;
  --code-bg: #F1F5F9;
  --code-border: #CBD5E1;

  --font-serif: 'Newsreader', 'Times New Roman', Georgia, serif;
  --font-sans: 'Be Vietnam Pro', 'Helvetica Neue', sans-serif;
  --font-mono: 'JetBrains Mono', Consolas, monospace;
}

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

html {
  background-color: var(--bg-page);
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.72;
  background-color: var(--bg-page);
  color: var(--text-body);
}

/* Top Navigation Bar (hidden when printing) */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(247, 246, 243, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
}

.topbar-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  color: var(--text-muted);
}

.topbar-brand a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
}

.topbar-brand a:hover {
  opacity: 0.7;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.nav-pill:hover,
.nav-pill.is-active {
  color: var(--text-primary);
  background-color: var(--bg-paper);
  border-color: var(--border-color);
}

.btn-print {
  background-color: var(--text-primary);
  color: #FFFFFF;
  border-color: var(--text-primary);
}

.btn-print:hover {
  background-color: #333333;
  color: #FFFFFF;
  border-color: #333333;
}

/* Document Paper Container */
.report-sheet {
  max-width: 920px;
  margin: 32px auto 64px;
  padding: 52px 60px 64px;
  background-color: var(--bg-paper);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.report-main-title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 3.2vw, 34px);
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  margin-bottom: 36px;
}

.report-section {
  margin-bottom: 36px;
}

.report-section:last-child {
  margin-bottom: 0;
}

.report-section h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.report-section h3 {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 22px;
  margin-bottom: 10px;
}

.report-section p {
  margin-bottom: 14px;
  text-align: justify;
}

.report-list {
  padding-left: 22px;
  margin-bottom: 14px;
}

.report-list li {
  margin-bottom: 8px;
  text-align: justify;
}

/* Diagrams */
.diagram-figure {
  margin: 22px 0 26px;
  text-align: center;
}

.diagram-scroll {
  overflow-x: auto;
}

.diagram-scroll svg {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 780px;
  min-width: 620px;
  height: auto;
}

.diagram-caption {
  margin-top: 12px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--text-body);
}

/* Props Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0 20px;
}

.props-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.props-table th,
.props-table td {
  border: 1px solid var(--border-table);
  padding: 10px 12px;
  vertical-align: top;
}

.props-table thead th {
  background-color: #F3F4F6;
  font-weight: 600;
  color: var(--text-primary);
}

/* Code Snippet Box */
.code-snippet {
  margin: 10px 0 22px;
  padding: 12px 16px;
  background-color: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-primary);
}

/* Responsive */
@media (max-width: 768px) {
  .topbar-inner {
    padding: 0 16px;
  }

  .report-sheet {
    margin: 16px 12px 40px;
    padding: 28px 20px 36px;
  }
}

/* Print Optimization */
@media print {
  html,
  body {
    background-color: #FFFFFF;
    font-size: 13px;
  }

  .no-print {
    display: none !important;
  }

  .report-sheet {
    max-width: none;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
  }

  .diagram-figure,
  .code-snippet,
  .props-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
