/* ===== Premium Typography & Variables ===== */
:root {
  --font-primary: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-accent: 'Playfair Display', serif;
  --color-primary: #f97316;
  --color-primary-dark: #ea580c;
  --color-accent: #4f46e5;
  --color-text: #111827;
  --color-text-light: #4b5563;
  --color-text-lighter: #6b7280;
  --color-border: #e5e7eb;
  --color-bg: #f5f5f7;
  --color-bg-alt: #f3f4f6;
  --color-white: #ffffff;
  --shadow-sm: 0 12px 30px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 16px 40px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.1);
  --radius-sm: 0.75rem;
  --radius-md: 1.1rem;
  --radius-lg: 1.2rem;

  
  
  /* Pledge Tracker Specific Variables */
  --pledge-success: #38a169;
  --pledge-primary: #3182ce;
  --pledge-warning: #d69e2e;
  --pledge-danger: #e53e3e;
  --pledge-dark: #2d3748;
  --pledge-gradient-primary: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
  --pledge-gradient-accent: linear-gradient(135deg, #3182ce 0%, #63b3ed 100%);
}


/* ===== Style only the "Bhutan in Data" text (do NOT touch BTN) ===== */
.navbar-brand .brand-text .brand-main{
  font-family: var(--font-accent);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: .02em;
  line-height: 1.05;

  /* Premium “earlier” look */
  background: linear-gradient(135deg,
    rgba(15,23,42,.98) 0%,
    rgba(17,24,39,.92) 35%,
    rgba(79,70,229,.92) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;

  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}

/* Optional subtle hover (text only) */
.navbar-brand:hover .brand-text .brand-main{
  filter: brightness(1.03);
}

/* Mobile sizing */
@media (max-width: 768px){
  .navbar-brand .brand-text .brand-main{ font-size: 16px; }
}


/* ===== Global / Body ===== */
body.bg-slate {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-primary);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Header & Footer ===== */
.bd-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
}

.navbar {
  padding-inline: 2rem;
}

/* ===== Header Brand Fix ===== */
.navbar-brand {
  font-family: var(--font-accent);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.navbar-brand .brand-pill {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.4rem 1.2rem;
  border-radius: 999px;
  font-size: 1.3rem;
  font-weight: 600;
}

.navbar-brand .brand-text {
  color: var(--color-text);
  font-weight: 700;
  font-size: 1.4rem;
}

.navbar-dark .navbar-brand .brand-text {
  color: var(--color-text);
}

.navbar-dark .navbar-nav .nav-link {
  color: var(--color-text-light);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  transition: color 0.2s ease;
}

.navbar-dark .navbar-nav .nav-link:hover {
  color: var(--color-text);
}

.bd-main {
  padding: 4rem 0 5rem;
}

.bd-footer {
  background: #ffffff; /* or your chosen slate/dark color */
  border-top: 1px solid rgba(148, 163, 184, 0.4);
  color: #3f4043;
  font-size: 1.1rem;
}

.bd-footer a {
  color: #393c41;
}

.bd-footer a:hover {
  text-decoration: underline;
}


/* ===== Pledge Tracker Specific Styles ===== */
.section-block {
  padding: 2rem 0;
}

.hero-kicker {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 1rem;
  background: var(--pledge-gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
  max-width: 800px;
}

.hero-footnote {
  font-size: 0.875rem;
  color: #718096;
  font-style: italic;
  border-left: 3px solid var(--color-accent);
  padding-left: 1rem;
}

.chart-card, .insight-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.chart-card:hover, .insight-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.section-title {
  color: var(--color-text);
  font-weight: 600;
}

.section-pill {
  background: var(--pledge-gradient-accent);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.chart-intro {
  color: var(--color-text-light);
  font-size: 0.875rem;
}

.insight-card {
  background: var(--pledge-gradient-primary);
  color: white;
}

.insight-card .section-title {
  color: white;
}

.insight-list {
  padding-left: 1rem;
}

.insight-list li {
  margin-bottom: 0.5rem;
}

.pledge-table {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.pledge-table thead th {
  background: var(--pledge-gradient-primary);
  color: white;
  font-weight: 600;
  border: none;
  padding: 1rem 0.75rem;
}

.pledge-table tbody tr {
  transition: all 0.2s ease;
}

.pledge-table tbody tr:hover {
  background-color: var(--color-bg-alt);
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.375rem 0.75rem;
}

.bg-outline {
  background-color: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-light);
}

.kpi-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid var(--color-accent);
  transition: all 0.3s ease;
}

.kpi-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.kpi-1 .kpi-icon { background: rgba(56, 161, 105, 0.1); color: var(--pledge-success); }
.kpi-2 .kpi-icon { background: rgba(49, 130, 206, 0.1); color: var(--pledge-primary); }
.kpi-3 .kpi-icon { background: rgba(214, 158, 46, 0.1); color: var(--pledge-warning); }
.kpi-4 .kpi-icon { background: rgba(229, 62, 62, 0.1); color: var(--pledge-danger); }

.export-btn {
  background: var(--pledge-gradient-primary);
  border: none;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: all 0.3s ease;
}

.export-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.status-summary {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.status-item {
  text-align: center;
  flex: 1;
}

.status-count {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.status-label {
  font-size: 0.75rem;
  color: var(--color-text-lighter);
}


.hero-lead {
  font-size: 1.15rem;
  line-height: 1.6;
  max-width: 42rem;
  color: var(--color-text-light);
  margin-bottom: 2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.5rem;
}



.hero-actions .btn-primary:hover {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}



.hero-actions .btn-outline-light:hover {
  background: var(--color-bg-alt);
  border-color: var(--color-text-lighter);
  transform: translateY(-1px);
}

.hero-footnote {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--color-text-lighter);
  max-width: 32rem;
}


.hero-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hero-stat-card:hover::before {
  opacity: 1;
}

.hero-stat-card .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-text-lighter);
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: block;
}

.hero-stat-card .value {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  margin: 0.5rem 0;
  color: var(--color-text);
  font-family: var(--font-accent);
}

.hero-stat-card .hint {
  font-size: 0.85rem;
  color: var(--color-text-lighter);
  line-height: 1.4;
}

/* ===== Sections ===== */
.section-block {
  padding: 4rem 0;
}

.section-alt {
  background: var(--color-bg-alt);
  position: relative;
}

.section-title {
  font-family: var(--font-accent);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

.section-link {
  font-size: 0.95rem;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.section-link:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* ===== Cards: domain, dataset, chart, insight ===== */


.domain-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--domain-color, var(--color-primary));
}

.domain-card:hover::before {
  transform: scaleX(1);
}

.domain-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(249, 115, 22, 0.1);
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.domain-card:hover .domain-icon {
  background: var(--domain-color, var(--color-primary));
  transform: scale(1.05);
}

.domain-icon i {
  font-size: 1.4rem;
  color: var(--color-primary);
  transition: color 0.3s ease;
}

.domain-card:hover .domain-icon i {
  color: var(--color-white);
}

.domain-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  transition: color 0.2s ease;
}

.domain-card p {
  font-size: 0.9rem;
  color: var(--color-text-light);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.chip {
  display: inline-block;
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  font-size: 0.8rem;
  color: var(--color-text-light);
  background: var(--color-bg);
  font-weight: 500;
  transition: all 0.2s ease;
}

.domain-card:hover .chip {
  background: var(--domain-color, var(--color-primary));
  color: var(--color-white);
  border-color: var(--domain-color, var(--color-primary));
}

/* Dataset cards */
.dataset-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  height: 100%;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
}

.dataset-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-accent);
}

.dataset-domain {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.dataset-card h3 {
  font-size: 1.1rem;
  margin: 0.5rem 0;
  color: var(--color-text);
  font-weight: 600;
  line-height: 1.3;
}

.dataset-subtitle {
  font-size: 0.9rem;
  color: var(--color-text-light);
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.dataset-description {
  font-size: 0.9rem;
  color: var(--color-text-lighter);
  line-height: 1.5;
  margin-bottom: 1rem;
}

.dataset-meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-lighter);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.dataset-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Chart & insight cards */
.chart-card,
.insight-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.chart-card:hover,
.insight-card:hover {
  box-shadow: var(--shadow-md);
}

.chart-card {
  position: relative;
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  flex: 1;
  max-height: 240px;
}

.chart-intro {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.insight-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-text);
  font-family: var(--font-accent);
}

.insight-card p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.insight-list {
  padding-left: 1.2rem;
  font-size: 0.9rem;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.insight-list li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* ===== Page titles & breadcrumbs ===== */
.page-title {
  font-family: var(--font-accent);
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text);
  letter-spacing: -0.02em;
}

.breadcrumb-link {
  font-size: 0.9rem;
  color: var(--color-text-lighter);
}

.breadcrumb-link a {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.breadcrumb-link a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Dataset detail meta block */
.dataset-meta-details {
  font-size: 0.95rem;
}

.dataset-meta-details dt {
  font-weight: 600;
  margin-top: 0.75rem;
  color: var(--color-text);
}

.dataset-meta-details dd {
  margin-bottom: 0.3rem;
  color: var(--color-text-light);
}

/* ===== Domain hierarchy (Bhutan in Data) ===== */
.domain-hierarchy {
  margin-top: 0.5rem;
}

.domain-tier-card {
  position: relative;
  border-radius: 1.4rem;
  background: #ffffff;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(15, 23, 42, 0.06);
  overflow: hidden;
  display: flex;
}

.domain-tier-accent {
  width: 6px;
  flex-shrink: 0;
  background: var(--color-accent);
}

.domain-tier-body {
  padding: 1.4rem 1.6rem 1.5rem;
  width: 100%;
}

.domain-tier-header {
  margin-bottom: 0.9rem;
}

.domain-tier-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.domain-tier-pill {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #6b7280;
}

.domain-meta-chip {
  font-size: 0.78rem;
  padding: 0.12rem 0.6rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
}

.domain-tier-title {
  font-family: var(--font-accent);
  font-size: 1.25rem;
  margin: 0;
}

.domain-tier-description {
  font-size: 0.94rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
  margin-bottom: 0;
}

/* Subdomains */
.domain-tier-subdomains {
  margin-top: 0.9rem;
  border-top: 1px solid #e5e7eb;
  padding-top: 0.8rem;
}

.subdomain-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
}

.subdomain-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.subdomain-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
  font-size: 0.83rem;
  text-decoration: none;
  color: #111827;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    box-shadow 0.15s ease;
}

.subdomain-chip:hover {
  background: #eef2ff;
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.subdomain-chip-name {
  font-weight: 500;
}

.subdomain-chip-meta {
  font-size: 0.75rem;
  color: #6b7280;
}

.subdomain-count {
  font-size: 0.78rem;
}

/* ===== Wider Container & Layout ===== */
.container {
  max-width: 1400px;
}

.bd-header .container-fluid {
  max-width: 100%;
}


@media (min-width: 1400px) {
  .container, 
  .container-fluid {
    max-width: 1600px;
  }
}

/* ===== Hero Section - Wider Layout ===== */
.hero-grid {
  grid-template-columns: minmax(0, 2.5fr) minmax(0, 1.2fr);
  gap: 4rem;
}

.hero-title {
  font-size: clamp(3rem, 5vw, 4rem);
}

.hero-lead {
  font-size: 1.2rem;
  max-width: 48rem;
}

/* ===== Cards - Wider Layout ===== */
.domain-card,
.dataset-card,
.chart-card,
.insight-card {
  padding: 2rem;
}

/* ===== Section Width Adjustments ===== */
.section-block {
  padding: 5rem 0;
}

/* ===== Chart Cards - More Horizontal Space ===== */
.chart-card {
  min-height: 350px;
}

.chart-card canvas {
  max-height: 280px;
}

/* ===== Domain Hierarchy - Wider Layout ===== */
.domain-tier-body {
  padding: 1.8rem 2rem 2rem;
}

.domain-tier-title {
  font-size: 1.4rem;
}


/* OVERRIDE THE CHART VISIBILITY ISSUE */
.chart-container {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.plot-wrap .chart-container {
  opacity: 1 !important;
}

/* Ensure Plotly charts are visible */
#hwcPlotOverview, #trendPlot, #hwcPlotCrop, #hwcPlotProperty, #hwcPlotHuman {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Make sure the chart containers are visible */
.js-plotly-plot, .plotly {
  opacity: 1 !important;
  visibility: visible !important;
}


/* ===== Chart Animations & Motion Effects ===== */


.chart-container.chart-visible {
  opacity: 1;
  transform: translateY(0);
}

.chart-container:nth-child(1) { transition-delay: 0.1s; }
.chart-container:nth-child(2) { transition-delay: 0.2s; }
.chart-container:nth-child(3) { transition-delay: 0.3s; }
.chart-container:nth-child(4) { transition-delay: 0.4s; }

.card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15) !important;
}

.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--color-text-lighter);
  font-style: italic;
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 200% 100%;
  animation: loadingShimmer 2s infinite;
  border-radius: var(--radius-lg);
}

@keyframes loadingShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.chart-card:focus-within {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

@keyframes dataPointPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.chart-point-highlight {
  animation: dataPointPulse 0.6s ease-out;
}

html {
  scroll-behavior: smooth;
}

/* Performance optimizations for animations */
@media (prefers-reduced-motion: reduce) {
  .chart-container,
  .card,
  .chart-loading {
    transition: none !important;
    animation: none !important;
  }
  
  .chart-container {
    opacity: 1;
    transform: none;
  }
}

/* ===== Enhanced Analytics Dashboard Specific Styles ===== */
.executive-kpi .card {
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.executive-kpi .card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: var(--shadow-lg) !important;
}

.chartjs-tooltip {
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
}

.section-alt::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-border), transparent);
}

/* ===== Responsive Design ===== */
@media (max-width: 1200px) {
  .container, 
  .container-fluid {
    max-width: 1140px;
  }
  
  .hero-grid {
    gap: 3rem;
  }
}

@media (max-width: 992px) {
  .container, 
  .container-fluid {
    max-width: 960px;
  }
  
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 3rem;
  }
  
  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .hero-actions .btn {
    width: 100%;
    max-width: 280px;
    margin-bottom: 0.5rem;
  }
  
  .section-block {
    padding: 3rem 0;
  }
  
  .navbar {
    padding-inline: 1rem;
  }
}

@media (max-width: 768px) {
  .container, 
  .container-fluid {
    max-width: 720px;
  }
  
  .bd-main {
    padding: 2rem 0 3rem;
  }
  
  .hero-section {
    padding: 3rem 0;
  }
  
  .hero-title {
    font-size: 2.2rem;
  }
  
  .hero-lead {
    font-size: 1.05rem;
  }
  
  .chart-card,
  .insight-card {
    padding: 1.5rem;
  }
  
  .domain-card,
  .dataset-card,
  .chart-card,
  .insight-card {
    padding: 1.5rem;
  }
  
  .domain-tier-body {
    padding: 1.4rem 1.5rem 1.5rem;
  }
  
  .chart-container {
    transform: translateY(20px);
    transition-duration: 0.6s;
  }
  
  .card:hover {
    transform: translateY(-2px);
  }
  
  .status-summary {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .status-item {
    flex: 0 0 calc(50% - 0.5rem);
  }
}

@media (max-width: 576px) {
  .container, 
  .container-fluid {
    max-width: 540px;
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .hero-stat-card {
    padding: 1.25rem;
  }
  
  .hero-stat-card .value {
    font-size: 1.75rem;
  }
  
  .domain-card,
  .dataset-card {
    padding: 1.25rem;
  }
  
  .hero-title {
    font-size: 2rem;
  }
}

/* Print styles - disable animations */
@media print {
  .chart-container,
  .card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ===== CLUSTER DETAIL PAGE STYLES ===== */

/* Hero Section */
.hero-section {
    padding: 2rem 0;
    background: #f8f9fa;
    position: relative;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(249,115,22,0.03) 0%, transparent 70%);
    pointer-events: none;
}

/* Stat Badges */
.stat-badge {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 20px;
    min-width: 100px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4361ee;
}

.stat-label {
    font-size: 0.875rem;
    color: #6c757d;
}

/* Section Blocks */
.section-block {
    padding: 2rem 0;
}

.section-alt {
    background-color: #f8fafc;
}

/* Table Styles */
.table th {
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table td {
    vertical-align: middle;
}

.kpi-title {
    color: #2d3748;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Card Styles for Cluster Detail */
.cluster-summary-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.cluster-summary-card:hover {
    box-shadow: var(--shadow-md);
}

.cluster-summary-card .card-title {
    font-family: var(--font-accent);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 1rem;
}

.cluster-summary-list {
    font-size: 0.9rem;
    color: var(--color-text-light);
}

.cluster-summary-list li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.cluster-summary-list i {
    color: var(--color-accent);
    margin-top: 0.15rem;
}

/* Filter Bar */
.filter-bar {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
}

.filter-select {
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.filter-select:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* KPI Table Card */
.kpi-table-card {
    border: none;
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.kpi-table-card .card-header {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
}

.kpi-table-card .card-header h5 {
    font-family: var(--font-accent);
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.kpi-table-card .card-footer {
    background: var(--color-white);
    border-top: 1px solid var(--color-border);
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    color: var(--color-text-light);
}

/* Table Headers with Sort Links */
.table th a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.table th a:hover {
    color: var(--color-accent);
}

/* Status Badges */
.status-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
}

/* Gap Analysis Styles */
.gap-positive {
    color: var(--pledge-success);
    font-weight: 600;
}

.gap-negative {
    color: var(--pledge-danger);
    font-weight: 600;
}

.gap-percentage {
    font-size: 0.875rem;
    color: var(--color-text-lighter);
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: transparent;
    padding-left: 0;
    margin-bottom: 0;
}

.breadcrumb-item a {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: var(--color-text-light);
}

/* Responsive Adjustments for Cluster Detail */
@media (max-width: 768px) {
    .hero-section {
        padding: 1.5rem 0;
    }
    
    .stat-badge {
        min-width: 80px;
        padding: 8px 12px;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .section-block {
        padding: 1.5rem 0;
    }
    
    .kpi-table-card .card-header,
    .kpi-table-card .card-footer {
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section {
        padding: 1rem 0;
    }
    
    .stat-badge {
        min-width: 70px;
        padding: 6px 10px;
    }
    
    .stat-number {
        font-size: 1.1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .filter-bar .col-auto {
        margin-bottom: 0.5rem;
    }
}

/* Print Styles for KPI Table */
@media print {
    .hero-section,
    .filter-bar,
    .card-footer,
    .breadcrumb,
    .btn-group {
        display: none !important;
    }
    
    .kpi-table-card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
    
    .table {
        page-break-inside: auto;
    }
    
    .table tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }
    
    .table td,
    .table th {
        padding: 0.5rem;
        border: 1px solid #ddd;
    }
}

/* Animation for Chart Loading */
@keyframes chartFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#progressChart {
    animation: chartFadeIn 0.6s ease-out;
}

/* Tooltip Customization */
.tooltip-inner {
    background-color: var(--color-text);
    color: var(--color-white);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    max-width: 300px;
}

.bs-tooltip-top .tooltip-arrow::before {
    border-top-color: var(--color-text);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-lighter);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}


/* Trend Button Styles */
.btn-outline-info.trend-toggle {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.btn-outline-info.trend-toggle:hover {
    background-color: var(--color-accent);
    color: white;
    transform: scale(1.05);
}

/* Trend Modal Styles */
.trend-modal .modal-content {
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
}

.trend-modal .modal-header {
    background: var(--pledge-gradient-primary);
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.trend-modal .modal-title {
    font-family: var(--font-accent);
    font-weight: 600;
}

.chart-container {
    height: 400px;
    position: relative;
}

/* Make sure charts in the Trend modal are actually visible */
.trend-modal .chart-container {
    opacity: 1 !important;
    transform: none !important;
}


.trend-stat {
    background: var(--color-bg-alt);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--color-accent);
}

#trendTable tbody tr:hover {
    background-color: var(--color-bg);
}


/* Enhanced Dual-handle trend slider with track fill */
.trend-range-wrapper {
  position: relative;
  height: 32px;
  margin-top: 4px;
  --track-height: 4px;
  --thumb-size: 16px;
  --track-color: #dee2e6;
  --track-fill-color: #0d6efd;
}

/* Fill area between thumbs (requires JavaScript to update --fill-start and --fill-end) */
.trend-range-wrapper::before {
  content: '';
  position: absolute;
  left: var(--fill-start, 0%);
  right: calc(100% - var(--fill-end, 100%));
  top: 50%;
  transform: translateY(-50%);
  height: var(--track-height);
  background: var(--track-fill-color);
  border-radius: 999px;
  pointer-events: none;
  z-index: 0;
}

/* Base tracks */
.trend-range {
  position: absolute;
  inset: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.trend-range-lower {
  z-index: 1;
}

.trend-range-upper {
  z-index: 2;
}

/* WebKit track */
.trend-range::-webkit-slider-runnable-track {
  height: var(--track-height);
  background: transparent;
  border-radius: 999px;
}

/* Firefox track */
.trend-range::-moz-range-track {
  height: var(--track-height);
  background: transparent;
  border-radius: 999px;
}

/* WebKit thumb */
.trend-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  height: var(--thumb-size);
  width: var(--thumb-size);
  border-radius: 50%;
  background: var(--track-fill-color);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  margin-top: calc((var(--thumb-size) / 2) * -1 + (var(--track-height) / 2));
  touch-action: manipulation;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 3;
}

.trend-range::-webkit-slider-thumb:hover {
  background: #0b5ed7;
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

.trend-range::-webkit-slider-thumb:active {
  background: #0a58ca;
  cursor: grabbing;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.trend-range::-webkit-slider-thumb:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* Firefox thumb */
.trend-range::-moz-range-thumb {
  pointer-events: auto;
  height: var(--thumb-size);
  width: var(--thumb-size);
  border-radius: 50%;
  background: var(--track-fill-color);
  border: 2px solid #ffffff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  z-index: 3;
}

.trend-range::-moz-range-thumb:hover {
  background: #0b5ed7;
  transform: scale(1.15);
  box-shadow: 0 3px 6px rgba(0,0,0,0.25);
}

.trend-range::-moz-range-thumb:active {
  background: #0a58ca;
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.trend-range::-moz-range-thumb:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* Disabled state */
.trend-range:disabled::-webkit-slider-thumb {
  background: #adb5bd;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.trend-range:disabled::-moz-range-thumb {
  background: #adb5bd;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

/* ===== Overview tab styling ===== */
.overview-section {
  border-radius: 10px;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.overview-intro-badges .badge {
  font-weight: 500;
  padding: 0.35rem 0.75rem;
}

/* Right-hand orientation card */
.overview-orientation {
  border-radius: 14px;
  background: #f9fafb;
}

.overview-orientation .badge {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
}

/* Key concept mini cards */
.overview-key-card {
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, #ffffff 0%, #f9fafb 100%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.overview-key-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 0.4rem;
}

/* ===== Budget Execution Overview Typography ===== */

/* Kicker: "Public Finance · Budget Execution" */
.overview-kicker {
  font-family: var(--font-primary);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 1rem;   /* tweak here if you want it bigger */
  font-weight: 600;
  color: var(--color-text-lighter);
}

/* Main title: "Budget execution and expenditure outturn in Bhutan" */
.overview-title {
  font-family: var(--font-accent); /* Playfair Display */
  font-size: clamp(2.2rem, 3vw, 2.8rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--color-text);
  margin-bottom: 1rem;
}

/* Lead paragraph: "This dashboard tracks…" */
.overview-lead {
  font-family: var(--font-accent);  /* Playfair Display (your last choice) */
  font-size: 1.2rem;                /* increase if it still feels small */
  line-height: 1.7;
  color: var(--color-text-light);
  max-width: 46rem;
}

.pdp-contract-wrap{
  display:flex;
  justify-content:center;
}

.pdp-contract-img{
  width: 100%;
  max-width: 980px;     /* controls how wide it can get on large screens */
  max-height: 460px;    /* controls how tall it can get */
  height: auto;
  object-fit: contain;  /* ensures the whole image fits without distortion */
  border-radius: 16px;
}
@media (max-width: 576px){
  .pdp-contract-img{
    max-height: 280px;
  }
}




.insight-callout{
  display:flex;
  align-items:center;
  gap:12px;
  padding:14px 14px;
  border-radius:16px;
  border:1px solid rgba(148,163,184,.45);
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(255,255,255,.62));
  box-shadow: 0 10px 26px rgba(2,6,23,.06);
  backdrop-filter: blur(10px);
}

.callout-icon{
  width:40px;
  height:40px;
  border-radius:12px;
  display:grid;
  place-items:center;
  background: rgba(37,99,235,.10);
  border: 1px solid rgba(37,99,235,.20);
  color:#2563eb;
  flex:0 0 auto;
}

.callout-body{ min-width: 0; }

.callout-eyebrow{
  font-size:.72rem;
  letter-spacing:.16em;
  text-transform:uppercase;
  color: var(--color-text-light);
  margin-bottom:2px;
}

.callout-text{
  font-weight:700;
  font-size:1.02rem;
  line-height:1.25;
  color: var(--color-text);
}

.callout-pill{
  margin-left:auto;
  padding:.35rem .75rem;
  border-radius:999px;
  font-weight:700;
  font-size:.78rem;
  color:#0f172a;
  background: rgba(15,23,42,.06);
  border:1px solid rgba(15,23,42,.12);
  flex:0 0 auto;
}

@media (max-width: 576px){
  .insight-callout{ align-items:flex-start; }
  .callout-pill{ display:none; }
}



.callout-source{
  margin-top: 8px;
  font-size: .82rem;
  color: var(--color-text-light);
  display:flex;
  gap:.35rem;
  flex-wrap:wrap;
  align-items:center;
}

.callout-source a{
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 1px dashed rgba(37,99,235,.45);
  padding-bottom: 1px;
}

.callout-source a:hover{
  border-bottom-style: solid;
}



/* ===== Domain hierarchy motion (place at end of file) ===== */

.domain-tier-card{
  will-change: transform, box-shadow, border-color;
  transform: translateY(0);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1),
              box-shadow 220ms cubic-bezier(.2,.8,.2,1),
              border-color 220ms ease;
}

/* Soft glow overlay */
.domain-tier-card::after{
  content:"";
  position:absolute;
  inset:-2px;
  border-radius: 1.6rem;
  pointer-events:none;
  opacity:0;
  transition: opacity 220ms ease;
  background: radial-gradient(600px 220px at 30% 0%,
              rgba(79,70,229,0.18),
              rgba(79,70,229,0) 60%);
}

.domain-tier-card:hover{
  transform: translateY(-6px);
  box-shadow: 0 22px 55px rgba(0,0,0,0.12);
  border-color: rgba(79,70,229,0.30);
}

.domain-tier-card:hover::after{ opacity:1; }

.domain-tier-accent{
  transform: scaleY(1);
  transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease;
  opacity: .9;
}

.domain-tier-card:hover .domain-tier-accent{
  transform: scaleY(1.02);
  opacity: 1;
}

/* Chips motion */
.subdomain-chip{
  will-change: transform, box-shadow, border-color, background;
  transition: transform 180ms cubic-bezier(.2,.8,.2,1),
              box-shadow 180ms cubic-bezier(.2,.8,.2,1),
              border-color 180ms ease,
              background 180ms ease,
              color 180ms ease;
}

.subdomain-chip:hover{
  transform: translateY(-2px);
  box-shadow: 0 14px 24px rgba(0,0,0,0.10);
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce){
  .domain-tier-card,
  .domain-tier-card::after,
  .domain-tier-accent,
  .subdomain-chip{
    transition:none !important;
  }
}


/* Add to your styles.css */
.icon-lg {
  width: 80px;
  height: 80px;
}

.icon-xl {
  width: 100px;
  height: 100px;
}

/* Smooth transitions */
.card {
  transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1) !important;
}

/* Better button styling */
.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 0.625rem 1.5rem;
}

.btn-lg {
  padding: 0.75rem 2rem;
}

/* Auth forms styling */
.auth-container {
    max-width: 440px;
    margin: 0 auto;
}

.auth-card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.auth-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.auth-icon i {
    font-size: 2rem;
    color: white;
}

.btn-auth {
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
}

.form-control-auth {
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s;
}

.form-control-auth:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}




/* Hero section styles - REMOVED */
.hero-section {
  padding: 5rem 0 4rem;
  background: radial-gradient(ellipse at top left, rgba(255,255,255,0.9) 0%, rgba(245,245,247,0.8) 100%);
  /* ... */
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.3fr) minmax(0, 1.4fr);
  /* ... */
}

.hero-kicker {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  /* ... */
}

.hero-title {
  font-family: var(--font-accent);
  font-size: clamp(2.8rem, 5vw, 3.5rem);
  /* ... */
}

/* Hero stats - REMOVED */
.hero-stats {
  display: grid;
  gap: 1.25rem;
}

.hero-stat-card {
  background: var(--color-white);
  /* ... */
}

/* Button styles - REMOVED */
.hero-actions .btn-primary {
  background: var(--color-primary);
  /* ... */
}

.hero-actions .btn-outline-light {
  border-color: var(--color-border);
  /* ... */
}