/* ─────────────────────────────────────────────
   XNUM - Custom Stylesheet
   ───────────────────────────────────────────── */

/* CSS Variables */
:root {
  --primary:       #1a56db;
  --primary-light: #1a56db22;
  --secondary:     #0e9f6e;
  --dark-bg:       #111928;
  --card-bg:       #ffffff;
  --card-border:   #e5e7eb;
  --text-primary:  #111928;
  --text-muted:    #6b7280;
  --light:         #f9fafb;
  --success:       #0e9f6e;
  --warning:       #e3a008;
  --danger:        #e02424;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,.12);
  --radius:        10px;
  --radius-lg:     16px;
  --transition:    all .22s ease;
}

/* Dark Mode */
[data-theme="dark"] {
  --card-bg:      #1f2937;
  --card-border:  #374151;
  --text-primary: #f9fafb;
  --text-muted:   #9ca3af;
  --light:        #111928;
  color-scheme: dark;
}
[data-theme="dark"] body         { background: #111928; color: #f9fafb; }
[data-theme="dark"] .navbar-xnum { background: #1f2937 !important; border-bottom: 1px solid #374151; }
[data-theme="dark"] .stat-card,
[data-theme="dark"] .card,
[data-theme="dark"] .dataset-card,
[data-theme="dark"] .report-card,
[data-theme="dark"] .insight-card,
[data-theme="dark"] .industry-detail-card,
[data-theme="dark"] .filter-sidebar,
[data-theme="dark"] .chart-card { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-light-custom { background: #1f2937 !important; }
[data-theme="dark"] .bg-dark-custom   { background: #111928 !important; }
[data-theme="dark"] .table            { --bs-table-color: #f9fafb; --bs-table-border-color: #374151; --bs-table-hover-bg: #374151; }
[data-theme="dark"] .footer-main      { background: #111928; border-top: 1px solid #374151; }
[data-theme="dark"] .footer-bottom    { background: #0d1321; }
[data-theme="dark"] .form-control,
[data-theme="dark"] .form-select      { background: #111928; border-color: #374151; color: #f9fafb; }
[data-theme="dark"] .list-group-item  { background: #1f2937; border-color: #374151; color: #f9fafb; }
[data-theme="dark"] .result-item      { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .result-item:hover{ background: #374151; }
[data-theme="dark"] .dropdown-menu    { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .dropdown-item    { color: #f9fafb; }
[data-theme="dark"] .dropdown-item:hover { background: #374151; }
[data-theme="dark"] .accordion-item   { background: #1f2937; border-color: #374151; }
[data-theme="dark"] .accordion-button { background: #1f2937; color: #f9fafb; }
[data-theme="dark"] .accordion-button:not(.collapsed) { background: #1a56db22; color: #1a56db; }
[data-theme="dark"] .map-bg           { --map-bg: #1f2937; }

/* ── Body offset for fixed navbar ─────────────── */
body { padding-top: 64px; }

/* ── Navbar ─────────────────────────────────── */
.navbar-xnum {
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: .6rem 0;
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
  z-index: 1035;
}
.navbar-brand { color: var(--primary) !important; }
.logo-num { color: #111928; }
[data-theme="dark"] .logo-num { color: #f9fafb; }
.navbar-xnum .nav-link { color: #4b5563; font-size: .9rem; padding: .4rem .75rem; border-radius: 6px; transition: var(--transition); }
.navbar-xnum .nav-link:hover { color: var(--primary); background: var(--primary-light); }
.navbar-search { max-width: 460px; }
.search-input { border-left: none; }
.search-icon  { background: #f9fafb; border-right: none; }
[data-theme="dark"] .search-icon { background: #374151; border-color: #4b5563; }
.search-autocomplete {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 9999;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 0 0 8px 8px;
  max-height: 280px; overflow-y: auto; box-shadow: var(--shadow-md); display: none;
}
[data-theme="dark"] .search-autocomplete { background: #1f2937; border-color: #374151; }
.search-autocomplete.show { display: block; }
.autocomplete-item { padding: .6rem 1rem; cursor: pointer; font-size: .875rem; transition: var(--transition); }
.autocomplete-item:hover { background: var(--primary-light); color: var(--primary); }

/* ── Hero ─────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #111928 0%, #1a2f52 60%, #0e1f3d 100%);
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero-section::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231a56db' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
}
.hero-badge { display: inline-flex; align-items: center; background: #1a56db33; color: #93c5fd; padding: .35rem .9rem; border-radius: 20px; font-size: .8rem; border: 1px solid #1a56db55; }
.hero-title { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 800; color: #fff; line-height: 1.15; }
.text-gradient { background: linear-gradient(135deg, #1a56db, #0e9f6e); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.hero-subtitle { color: #9ca3af; font-size: 1.1rem; max-width: 600px; margin: 0 auto; }
.hero-search-form { position: relative; }
.hero-search-group { border-radius: 50px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,.3); }
.hero-search-group .input-group-text,
.hero-search-group .form-control,
.hero-search-group .btn { border-radius: 0 !important; }
.hero-search-group .form-control { font-size: 1rem; padding: .75rem 1rem; border: none; }
.trending-tag { display: inline-block; background: rgba(255,255,255,.1); color: #d1d5db; padding: .3rem .75rem; border-radius: 20px; font-size: .8rem; margin: .2rem; text-decoration: none; transition: var(--transition); border: 1px solid rgba(255,255,255,.15); }
.trending-tag:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Stats Counter Bar ───────────────────────── */
.stats-bar { background: #fff; border-bottom: 1px solid #e5e7eb; }
[data-theme="dark"] .stats-bar { background: #1f2937; border-color: #374151; }
.stats-counter-card { padding: 1rem; }
.counter-number { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.counter-label  { font-size: .85rem; color: var(--text-muted); font-weight: 500; }

/* ── Sections ─────────────────────────────────── */
.section-pad { padding: 4rem 0; }
.section-title { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
.section-subtitle { font-size: 1rem; }
.bg-light-custom { background: #f3f4f6; }
.bg-dark-custom  { background: #111928; }

/* ── Industry Cards ─────────────────────────── */
.industry-card {
  display: flex; align-items: center; gap: .75rem;
  background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius);
  padding: .9rem 1rem; transition: var(--transition); cursor: pointer;
}
.industry-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.industry-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.industry-name { font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.industry-count { font-size: .75rem; }
.industry-arrow { margin-left: auto; color: var(--text-muted); font-size: .75rem; }
.industry-detail-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); }
.industry-detail-card:hover { box-shadow: var(--shadow-md); }
.industry-detail-header { padding: 1.25rem; }
.industry-icon-lg { width: 64px; height: 64px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.industry-detail-body { padding: .75rem 1.25rem; border-top: 1px solid #e5e7eb; }
.industry-detail-footer { padding: .75rem 1.25rem; border-top: 1px solid #e5e7eb; background: #f9fafb; }
[data-theme="dark"] .industry-detail-footer { background: #111928; }

/* ── Stat Cards ─────────────────────────────── */
.stat-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg);
  overflow: hidden; transition: var(--transition); position: relative;
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: var(--primary); }
.stat-card-chart { padding: .75rem .75rem 0; }
.stat-card-body  { padding: .75rem 1rem .5rem; }
.stat-card-title { font-size: .875rem; font-weight: 600; line-height: 1.3; color: var(--text-primary); }
.stat-card-title a:hover { color: var(--primary); }
.stat-card-meta  { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .75rem; color: var(--text-muted); margin-top: .35rem; }
.stat-card-footer{ border-top: 1px solid var(--card-border); margin-top: auto; }
.stat-premium-badge { position: absolute; top: .5rem; right: .5rem; font-size: .65rem; z-index: 2; }
.stat-category-badge { font-size: .7rem; font-weight: 600; }

/* ── Chart Cards ─────────────────────────────── */
.chart-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); padding: 1.25rem; }
.chart-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.chart-container-main { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); padding: 1.25rem; }

/* ── Report Cards ─────────────────────────────── */
.report-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); }
.report-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.report-cover { position: relative; height: 160px; display: flex; align-items: center; justify-content: center; }
.report-cover-icon { font-size: 3rem; color: rgba(255,255,255,.5); }
.report-premium-badge { position: absolute; top: .6rem; right: .6rem; background: #e3a008; color: #fff; font-size: .65rem; padding: .25rem .5rem; border-radius: 4px; font-weight: 600; }
.report-free-badge { position: absolute; top: .6rem; right: .6rem; background: #0e9f6e; color: #fff; font-size: .65rem; padding: .25rem .5rem; border-radius: 4px; font-weight: 600; }
.report-body { padding: 1rem; }
.report-title { font-size: .875rem; font-weight: 600; line-height: 1.3; margin-bottom: .5rem; }
.report-title a:hover { color: var(--primary); }
.report-meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--text-muted); }

/* ── Dataset Cards ─────────────────────────────── */
.dataset-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); padding: 1.25rem; transition: var(--transition); display: flex; flex-direction: column; }
.dataset-card:hover { box-shadow: var(--shadow-md); border-color: var(--primary); }
.dataset-title { font-size: .9rem; font-weight: 600; margin: .5rem 0; }
.dataset-desc  { font-size: .8rem; flex-grow: 1; }
.dataset-meta  { margin-top: .75rem; }

/* ── Insight Cards ─────────────────────────────── */
.insight-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); overflow: hidden; transition: var(--transition); display: flex; flex-direction: column; }
.insight-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.insight-cover { height: 130px; display: flex; align-items: center; justify-content: center; }
.insight-body  { padding: 1rem; flex-grow: 1; display: flex; flex-direction: column; }
.insight-title { font-size: .875rem; font-weight: 600; line-height: 1.3; flex-grow: 1; }
.insight-title a:hover { color: var(--primary); }
.insight-excerpt { font-size: .8rem; flex-grow: 1; }
.insight-footer { display: flex; justify-content: space-between; align-items: center; margin-top: .75rem; font-size: .75rem; }
.featured-insight { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); overflow: hidden; }
[data-theme="dark"] .featured-insight { background: #1f2937; border-color: #374151; }

/* ── Filter Sidebar ─────────────────────────────── */
.filter-sidebar { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); overflow: hidden; position: sticky; top: 80px; }
.filter-header { display: flex; justify-content: space-between; align-items: center; padding: .875rem 1rem; border-bottom: 1px solid #e5e7eb; }
.filter-section { padding: .75rem 1rem; border-bottom: 1px solid #f3f4f6; }
.filter-section:last-child { border-bottom: none; }
.filter-label { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; display: block; margin-bottom: .4rem; }

/* ── Country List ─────────────────────────────── */
.country-list { display: flex; flex-direction: column; gap: .5rem; }
.country-list-item { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; background: #f9fafb; border-radius: 8px; transition: var(--transition); border: 1px solid #e5e7eb; }
.country-list-item:hover { background: var(--primary-light); border-color: var(--primary); }
.country-rank  { width: 20px; font-size: .75rem; font-weight: 700; color: var(--text-muted); text-align: right; flex-shrink: 0; }
.country-flag  { font-size: 1.2rem; flex-shrink: 0; }
.country-name  { font-size: .875rem; font-weight: 600; flex-grow: 1; color: var(--text-primary); }
.country-stat-count { flex-shrink: 0; }
.country-flag-lg    { font-size: 4rem; line-height: 1; }
.key-metric-card    { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius); padding: 1rem; }

/* ── Pricing ─────────────────────────────── */
.pricing-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-lg); padding: 1.75rem; color: #fff; position: relative; }
.pricing-featured { background: rgba(26,86,219,.15); border-color: var(--primary); }
.pricing-popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; padding: .25rem .9rem; border-radius: 20px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.pricing-price .price-amount { font-size: 2rem; font-weight: 800; }
.pricing-features { list-style: none; padding: 0; margin: 1rem 0; font-size: .9rem; }
.pricing-features li { padding: .35rem 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.pricing-card-full { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; }
[data-theme="dark"] .pricing-card-full { background: #1f2937; border-color: #374151; }
.pricing-card-featured { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.pricing-popular-ribbon { background: var(--primary); color: #fff; text-align: center; font-size: .75rem; font-weight: 600; padding: .3rem; }
.pricing-card-header { padding: 1.5rem; text-align: center; border-bottom: 1px solid #e5e7eb; }
[data-theme="dark"] .pricing-card-header { border-color: #374151; }
.pricing-price-big span:first-child { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.pricing-features-full { list-style: none; padding: 1rem 1.5rem; flex-grow: 1; }
.pricing-features-full li { padding: .4rem 0; font-size: .9rem; border-bottom: 1px solid #f3f4f6; }
[data-theme="dark"] .pricing-features-full li { border-color: #374151; }
.pricing-card-footer { padding: 1.25rem 1.5rem; border-top: 1px solid #e5e7eb; }
[data-theme="dark"] .pricing-card-footer { border-color: #374151; }
.comparison-table th, .comparison-table td { padding: .6rem .75rem; }

/* ── Auth Cards ─────────────────────────────── */
.auth-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); padding: 2rem; box-shadow: var(--shadow-md); }
[data-theme="dark"] .auth-card { background: #1f2937; border-color: #374151; }
.auth-logo span { line-height: 1; }

/* ── Dashboard ─────────────────────────────── */
.dashboard-stat-card { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius-lg); padding: 1.25rem; display: flex; gap: 1rem; align-items: center; transition: var(--transition); }
.dashboard-stat-card:hover { box-shadow: var(--shadow-md); }
.dashboard-stat-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dashboard-stat-number { font-size: 1.5rem; font-weight: 700; }
.dashboard-stat-label  { font-size: .8rem; color: var(--text-muted); }
.bg-primary-soft  { background: #1a56db22 !important; }
.bg-success-soft  { background: #0e9f6e22 !important; }
.bg-warning-soft  { background: #e3a00822 !important; }
.bg-info-soft     { background: #0891b222 !important; }
.text-primary     { color: #1a56db !important; }
.text-success     { color: #0e9f6e !important; }

/* ── Key Stats ─────────────────────────────── */
.key-stat-box { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 8px; padding: .75rem; text-align: center; }
[data-theme="dark"] .key-stat-box { background: #111928; border-color: #374151; }
.key-stat-value { font-size: 1.25rem; font-weight: 700; }
.key-stat-label { font-size: .75rem; color: var(--text-muted); }

/* ── Footer ─────────────────────────────── */
.footer-main { background: #111928; color: #9ca3af; border-top: 1px solid #1f2937; }
.footer-heading { color: #f9fafb; }
.footer-logo-text { color: #f9fafb; }
.footer-links { padding: 0; margin: 0; list-style: none; }
.footer-links li { margin-bottom: .4rem; }
.footer-links a { color: #9ca3af; text-decoration: none; font-size: .875rem; transition: var(--transition); }
.footer-links a:hover { color: #f9fafb; }
.footer-desc { font-size: .875rem; }
.social-link { color: #6b7280; font-size: 1.1rem; text-decoration: none; transition: var(--transition); }
.social-link:hover { color: var(--primary); }
.footer-bottom { background: #0d1321; border-top: 1px solid #1f2937; }
.footer-bottom a { text-decoration: none; transition: var(--transition); }
.footer-bottom a:hover { color: #f9fafb !important; }

/* ── Search Results ─────────────────────────────── */
.result-item { background: #fff; border: 1px solid #e5e7eb; border-radius: var(--radius); padding: .875rem 1rem; margin-bottom: .5rem; transition: var(--transition); }
.result-item:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }
.result-title { font-size: .9rem; font-weight: 600; color: var(--text-primary); }

/* ── Breadcrumb ─────────────────────────────── */
.breadcrumb { font-size: .8rem; }
.breadcrumb-item a { color: var(--primary); text-decoration: none; }

/* ── World Map ─────────────────────────────── */
.world-map-container { border-radius: var(--radius-lg); overflow: hidden; }
.world-map-svg { width: 100%; height: auto; }

/* ── Article ─────────────────────────────── */
.article-content { line-height: 1.8; }
.article-body h2 { font-size: 1.4rem; font-weight: 700; margin: 1.5rem 0 .75rem; border-bottom: 2px solid var(--primary); padding-bottom: .35rem; }
.article-body h3 { font-size: 1.1rem; font-weight: 600; margin: 1.25rem 0 .5rem; }
.article-body p  { margin-bottom: 1rem; }
.article-body ul { margin-bottom: 1rem; }
.toc-list li { padding: .3rem 0; border-bottom: 1px solid #f3f4f6; }
.toc-list a { color: var(--text-primary); }
[data-theme="dark"] .toc-list li { border-color: #374151; }
.author-bio-card { background: #f9fafb; border: 1px solid #e5e7eb; border-radius: var(--radius); padding: 1.25rem; }
[data-theme="dark"] .author-bio-card { background: #111928; border-color: #374151; }

/* ── Industry Hero ─────────────────────────────── */
.industry-hero { background: #f9fafb; }
[data-theme="dark"] .industry-hero { background: #1f2937; }
.industry-hero-icon { width: 80px; height: 80px; border-radius: 16px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Report Blur ─────────────────────────────── */
.report-preview { max-height: 300px; overflow: hidden; position: relative; }
.report-blur-overlay { background: linear-gradient(transparent 0%, rgba(255,255,255,.95) 50%); position: relative; }
[data-theme="dark"] .report-blur-overlay { background: linear-gradient(transparent, rgba(31,41,55,.95)); }

/* ── Loading Skeleton ─────────────────────────────── */
.skeleton { background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%); background-size: 200% 100%; animation: skeleton-loading 1.5s infinite; border-radius: 6px; }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%); background-size: 200% 100%; }
@keyframes skeleton-loading { 0%{background-position:200% 0} 100%{background-position:-200% 0} }

/* ── Buttons ─────────────────────────────── */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: #1648c0; border-color: #1648c0; }
.btn-xs { padding: .2rem .45rem; font-size: .7rem; }

/* ── Responsive ─────────────────────────────── */
@media (max-width: 768px) {
  .hero-section { padding: 3rem 0 2.5rem; }
  .section-pad { padding: 2.5rem 0; }
  .stats-counter-card { padding: .75rem .5rem; }
  .counter-number { font-size: 1.4rem; }
  .industry-detail-card .industry-detail-body { display: none; }
}

/* ── Badge soft variants ─────────────────────────────── */
.bg-primary-soft { background: #1a56db22; }
.bg-success-soft { background: #0e9f6e22; }
.bg-warning-soft { background: #e3a00822; }
