/* ---- Page container ------------------------------------------------------ */

.page-wrap {
  max-width: 1200px;
  margin-inline: auto;
  padding: 1.5rem 1rem;
}

/* ---- Navbar ------------------------------------------------------------ */

.navbar {
  background: linear-gradient(135deg, #005a8e 0%, #0072B2 100%) !important;
  box-shadow: 0 4px 20px rgba(0, 90, 142, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.75rem 1.5rem;
}

.navbar-brand img.navbar-logo {
  height: 34px;
  width: 34px;
  object-fit: cover;
  border-radius: 50%;
  margin-right: 10px;
  border: 2px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
}

.navbar-brand:hover img.navbar-logo {
  transform: rotate(10deg) scale(1.05);
}

.navbar .nav-link,
.navbar-brand {
  color: #fff !important;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.navbar .nav-link:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ---- Cards & Containers ------------------------------------------------------------- */

.card {
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 0.8rem;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  background-color: #ffffff;
  margin-bottom: 1.5rem;
}

/* Hover effect on regular cards to make the layout feel interactive */
.card:not(.hero-card):hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 35px -10px rgba(0, 90, 142, 0.1), 0 1px 5px rgba(0, 0, 0, 0.04);
}

.card-header {
  background-color: rgba(0, 114, 178, 0.03);
  border-bottom: 1px solid rgba(0, 114, 178, 0.08);
  font-weight: 600;
  color: #2b3a4a;
  padding: 0.85rem 1.25rem;
}

.card-footer {
  background-color: rgba(0, 0, 0, 0.01);
  border-top: 1px solid rgba(0, 0, 0, 0.04);
  font-size: 0.85rem;
  color: #5c6b73;
}

.card img.img-content {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  display: block;
  margin: 0.5rem auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ---- Hero (Home page) --------------------------------------------------- */

.hero-card {
  background: linear-gradient(135deg, #005a8e 0%, #0072B2 50%, #56B4E9 100%);
  color: #fff;
  border: none;
  box-shadow: 0 15px 35px rgba(0, 90, 142, 0.2);
  position: relative;
}

.hero-card::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.15) 0%, transparent 50%);
  pointer-events: none;
}

.hero-card h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.8rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-card .lead {
  font-size: 1.15rem;
  font-weight: 400;
  opacity: 0.95;
  line-height: 1.5;
}

/* ---- Value Boxes --------------------------------------------------------- */

.value-box {
  border-radius: 0.8rem !important;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.05) !important;
  border: 1px solid rgba(0, 0, 0, 0.04) !important;
  transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

.value-box:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.1) !important;
}

/* ---- Buttons & Inputs ---------------------------------------------------- */

.btn {
  border-radius: 0.4rem;
  font-weight: 550;
  padding: 0.45rem 1rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
  background-color: #0072B2;
  border-color: #0072B2;
  box-shadow: 0 4px 10px rgba(0, 114, 178, 0.2);
}

.btn-primary:hover, .btn-primary:focus {
  background-color: #005a8e;
  border-color: #005a8e;
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(0, 90, 142, 0.3);
}

.btn-outline-primary {
  color: #0072B2;
  border-color: #0072B2;
}

.btn-outline-primary:hover {
  background-color: #0072B2;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn:active {
  transform: scale(0.98) !important;
}

/* ---- Quiz --------------------------------------------------------------- */

.quiz-progress {
  height: 10px;
  border-radius: 6px;
  background-color: var(--bs-secondary-bg, #f1f3f5);
  overflow: hidden;
  margin-bottom: 1rem;
  border: 1px solid rgba(0, 0, 0, 0.03);
}

.quiz-progress > div {
  height: 100%;
  background: linear-gradient(90deg, #0072B2 0%, #56B4E9 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-image {
  max-width: 620px;
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--bs-border-color);
  margin: 0.75rem 0 1.25rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.quiz-topic-badge {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
}

/* Pointer lock style for quiz options after submission */
.quiz-disabled-options {
  pointer-events: none;
  opacity: 0.75;
  filter: grayscale(15%);
  transition: all 0.3s ease;
}

.quiz-disabled-options .shiny-options-group {
  cursor: not-allowed;
}

/* ---- Flow map (AI-assisted analysis page) ------------------------------- */

.flow-map {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem 0;
}

.flow-map .flow-step {
  background: linear-gradient(135deg, #0072B2 0%, #005a8e 100%);
  color: #fff;
  border-radius: 2rem;
  padding: 0.45rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 550;
  box-shadow: 0 3px 8px rgba(0, 90, 142, 0.15);
  white-space: nowrap;
}

.flow-map .flow-arrow {
  color: #5C6B73;
  font-weight: 700;
  font-size: 1.1rem;
  padding: 0 0.1rem;
}

/* ---- Markdown content pages ---------------------------------------------- */

/* Images rendered from markdown carry no class; without a cap, wide figures
   are clipped by the card's overflow: hidden. Percentage width attributes
   (e.g. width="60%") still apply below the cap. */
.md-page img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

/* ---- Prompt / code blocks ------------------------------------------------ */

.prompt-block {
  background-color: #f8fafc;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 0.6rem;
  padding: 1rem 1.25rem;
  font-size: 0.88rem;
  line-height: 1.5;
  white-space: pre-wrap;
  font-family: var(--bs-font-monospace);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* ---- Customizing DataTable (DT) ------------------------------------------- */

.dataTable {
  border-collapse: collapse !important;
  width: 100% !important;
  font-size: 0.9rem !important;
}

.dataTable thead th {
  background-color: #f8fafc !important;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08) !important;
  color: #2b3a4a !important;
  font-weight: 600 !important;
  padding: 10px 8px !important;
}

.dataTable tbody td {
  padding: 8px 8px !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04) !important;
  color: #4a5568 !important;
}

.dataTables_wrapper .dt-buttons .dt-button {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  color: #4a5568 !important;
  border-radius: 4px !important;
  padding: 4px 10px !important;
  font-size: 0.8rem !important;
  font-weight: 550 !important;
  transition: all 0.2s ease !important;
}

.dataTables_wrapper .dt-buttons .dt-button:hover {
  background: #0072B2 !important;
  color: #ffffff !important;
  border-color: #0072B2 !important;
}

/* ---- Misc ---------------------------------------------------------------- */

.stat-formula {
  font-family: var(--bs-font-monospace);
  font-size: 1.05rem;
  background-color: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.03);
  border-radius: 0.4rem;
  padding: 0.5rem 1rem;
  display: inline-block;
  margin: 0.4rem 0;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.01);
}

.table-sm-tight td,
.table-sm-tight th {
  padding: 0.35rem 0.75rem;
}

.accordion-button:not(.collapsed) {
  background-color: rgba(0, 114, 178, 0.05) !important;
  color: #005a8e !important;
}
