/* Base HTML and body styling with scroll behavior */
html,
body {
  margin: 0;
  padding: 0;
}

html {
  overflow-y: auto !important;
  overflow-x: hidden !important;
  height: 100%;
  scroll-behavior: smooth;
}

body {
  overflow: visible !important;
  height: auto;
  min-height: 100vh;
}

/* Scroll margin for navigation anchor links */
.nation-grid,
.state-summary {
  scroll-margin-top: 80px;
}

/* Logo and brand icon hover effects */
.main-logo-icon,
.nav-brand-icon {
  transition:
    transform 0.3s ease,
    filter 0.3s ease;
  will-change: auto;
}

.main-logo-icon:hover,
.nav-brand-icon:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 10px var(--slime-blue));
}

.emblem-core {
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  will-change: auto;
}

.emblem-core:hover {
  transform: scale(1.02);
  box-shadow: 0 0 15px var(--accent-gold);
}

/* Main content layout and positioning */
.main-content {
  position: relative;
  z-index: 10;
  padding: 2rem 3rem;
  padding-top: 2rem;
  max-width: 1600px;
  margin: 0 auto;
  overflow: visible;
  height: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Floating decorative orbs with animated positioning */
.floating-orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(77, 21, 22, 0.4),
    rgba(77, 21, 22, 0.1)
  );
  filter: blur(1px);
  pointer-events: none;
  z-index: 1;
}

.floating-orb:nth-child(1) {
  width: 120px;
  height: 120px;
  top: 10%;
  right: 5%;
  animation-delay: 0s;
}

.floating-orb:nth-child(2) {
  width: 80px;
  height: 80px;
  top: 60%;
  left: 3%;
  animation-delay: 2s;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(170, 85, 25, 0.3),
    rgba(170, 85, 25, 0.1)
  );
}

.floating-orb:nth-child(3) {
  width: 60px;
  height: 60px;
  top: 30%;
  left: 15%;
  animation-delay: 4s;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(25, 52, 150, 0.3),
    rgba(25, 52, 150, 0.1)
  );
}

/* Hero welcome section with grid layout and backdrop effects */
.hero-welcome {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 4rem;
  align-items: center;
  margin-bottom: 4rem;
  padding: 4rem;
  border-radius: 32px;
  background: linear-gradient(
    135deg,
    rgba(10, 14, 39, 0.9),
    rgba(21, 27, 61, 0.8),
    rgba(10, 14, 39, 0.9)
  );
  border: 1px solid rgba(77, 212, 255, 0.3);
  backdrop-filter: blur(15px);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.hero-welcome:hover {
  transform: translateY(-2px);
  box-shadow:
    0 25px 70px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-welcome::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(77, 212, 255, 0.1),
    transparent
  );
}

.hero-welcome::after {
  content: "";
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(
    45deg,
    var(--primary-blue),
    var(--accent-cyan),
    var(--accent-gold),
    var(--primary-blue)
  );
  border-radius: 32px;
  z-index: -1;
  opacity: 0.2;
}

/* Welcome content text and styling */
.welcome-content {
  z-index: 2;
  position: relative;
}

/* Main welcome title with gradient text effect */
.welcome-title {
  font-family: "Cinzel", serif;
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 2rem;
  text-shadow: 0 0 40px var(--glow-blue);
  background: linear-gradient(
    135deg,
    var(--text-light),
    var(--primary-blue),
    var(--accent-gold)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  position: relative;
}

.welcome-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-blue),
    var(--accent-gold),
    transparent
  );
  border-radius: 2px;
}

.welcome-description {
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Welcome badges grid layout */
.welcome-badges {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

/* Interactive badge components with hover effects */
.badge {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.8),
    rgba(10, 14, 39, 0.6)
  );
  border: 1px solid rgba(77, 212, 255, 0.3);
  border-radius: 16px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.badge::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.3s ease;
}

.badge:hover {
  transform: translateY(-2px);
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.9),
    rgba(10, 14, 39, 0.7)
  );
  border-color: rgba(77, 212, 255, 0.5);
  box-shadow:
    0 12px 30px rgba(77, 212, 255, 0.2),
    0 0 0 1px rgba(77, 212, 255, 0.1);
}

.badge:hover::before {
  left: 100%;
}

.badge-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 10px currentColor);
  transition: transform 0.3s ease;
}

.badge:hover .badge-icon {
  transform: scale(1.1);
}

/* Welcome visual section with federation emblem */
.welcome-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

/* Federation emblem container with concentric rings */
.federation-emblem {
  position: relative;
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Central emblem core with glowing border */
.emblem-core {
  width: 180px;
  height: 180px;
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.9),
    rgba(10, 14, 39, 0.8),
    rgba(21, 27, 61, 0.9)
  );
  border-radius: 50%;
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 0 30px rgba(77, 212, 255, 0.6),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  border: 3px solid rgba(77, 212, 255, 0.8);
  overflow: hidden;
}

/* Emblem image with glow animation */
.emblem-image {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  filter: brightness(1.1) contrast(1.1);
  transition: all 0.3s ease;
  animation: imageGlow 3s ease-in-out infinite alternate;
}

.emblem-core:hover .emblem-image {
  transform: scale(1.05);
  filter: brightness(1.2) contrast(1.2);
}

/* Glow animation keyframes for emblem image */
@keyframes imageGlow {
  from {
    box-shadow: 0 0 15px rgba(77, 212, 255, 0.4);
  }
  to {
    box-shadow: 0 0 25px rgba(77, 212, 255, 0.8);
  }
}

/* Concentric rings around the emblem */
.emblem-rings {
  position: absolute;
  width: 100%;
  height: 100%;
}

.ring {
  position: absolute;
  border: 1px solid rgba(77, 212, 255, 0.3);
  border-radius: 50%;
}

.ring.outer {
  width: 300px;
  height: 300px;
  top: 0;
  left: 0;
  border-style: dashed;
}

.ring.middle {
  width: 225px;
  height: 225px;
  top: 37.5px;
  left: 37.5px;
  border-color: rgba(77, 212, 255, 0.4);
}

.ring.inner {
  width: 150px;
  height: 150px;
  top: 75px;
  left: 75px;
  border-color: rgba(77, 212, 255, 0.5);
}

/* Section titles with underline decoration */
.section-title {
  font-family: "Cinzel", serif;
  font-size: 2rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  text-align: center;
  text-shadow: 0 0 20px var(--glow-blue);
  position: relative;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--slime-blue),
    transparent
  );
  border-radius: 2px;
}

/* State summary grid layout */
.state-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

/* State cards with backdrop blur and hover effects */
.state-card {
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.8),
    rgba(21, 27, 61, 0.4)
  );
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.state-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--slime-blue),
    transparent
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.state-card.primary::before {
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-emerald),
    transparent
  );
}

.state-card.secondary::before {
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-gold),
    transparent
  );
}

.state-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-blue);
  box-shadow:
    0 15px 35px rgba(77, 21, 22, 0.2),
    0 0 0 1px rgba(77, 212, 255, 0.2);
}

.state-card:hover::before {
  opacity: 1;
}

.state-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.state-title {
  font-family: "Cinzel", serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-light);
  margin: 0;
  text-shadow: 0 0 10px rgba(232, 224, 25, 0.3);
}

.state-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent-emerald);
  font-weight: 600;
}

/* Status indicator with pulsing animation */
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  position: relative;
}

.status-indicator.stable {
  background: var(--accent-emerald);
  box-shadow: 0 0 15px var(--accent-emerald-glow);
  animation: statusPulse 2s ease-in-out infinite;
}

/* Status pulse animation keyframes */
@keyframes statusPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.3);
  }
}

.strength-rating {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.rating-display {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.25rem;
}

.rating-score {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(0, 255, 136, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  text-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.state-content {
  margin-bottom: 1.5rem;
}

.state-description {
  font-size: 0.9rem;
  line-height: 1.6;
  color: rgba(232, 224, 25, 0.8);
  margin-bottom: 1.5rem;
}

.state-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: rgba(232, 224, 25, 0.7);
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  transition: all 0.3s ease;
}

.highlight-item:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateX(2px);
}

.highlight-icon {
  font-size: 1rem;
  filter: drop-shadow(0 0 4px currentColor);
}

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

.strength-category {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.strength-category:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(77, 21, 22, 0.2);
  transform: translateY(-1px);
}

.strength-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.strength-icon {
  font-size: 1.1rem;
  filter: drop-shadow(0 0 6px currentColor);
}

.strength-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-light);
  flex: 1;
}

.strength-score {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(255, 165, 0, 0.1);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  text-shadow: 0 0 8px rgba(255, 165, 0, 0.3);
}

.strength-desc {
  font-size: 0.75rem;
  line-height: 1.4;
  color: rgba(232, 224, 25, 0.6);
  margin: 0;
  padding-left: 1.85rem;
}

/* Nation statistics grid layout */
.nation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

/* Statistical cards with color variants and animations */
.stat-card {
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.9),
    rgba(21, 27, 61, 0.6),
    rgba(77, 21, 22, 0.05)
  );
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-subtle);
  border-radius: 24px;
  padding: 2.5rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 450px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--slime-blue),
    transparent
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 50% 50%,
    rgba(77, 21, 22, 0.05),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.4s ease;
}

.stat-card.gold::before {
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-gold),
    transparent
  );
}

.stat-card.gold::after {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 165, 0, 0.05),
    transparent 70%
  );
}

.stat-card.crimson::before {
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-crimson),
    transparent
  );
}

.stat-card.crimson::after {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(255, 51, 102, 0.05),
    transparent 70%
  );
}

.stat-card.cyan::before {
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-cyan),
    transparent
  );
}

.stat-card.cyan::after {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(0, 212, 255, 0.05),
    transparent 70%
  );
}

.stat-card.purple::before {
  background: linear-gradient(
    90deg,
    transparent,
    var(--accent-purple),
    transparent
  );
}

.stat-card.purple::after {
  background: radial-gradient(
    circle at 50% 50%,
    rgba(170, 85, 255, 0.05),
    transparent 70%
  );
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary-blue);
  box-shadow:
    0 20px 45px rgba(77, 21, 22, 0.25),
    0 0 0 1px rgba(77, 21, 22, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

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

.stat-card.gold:hover {
  border-color: var(--accent-gold);
  box-shadow:
    0 25px 50px rgba(255, 165, 0, 0.25),
    0 0 0 1px rgba(255, 165, 0, 0.15);
}

.stat-card.crimson:hover {
  border-color: var(--accent-crimson);
  box-shadow:
    0 25px 50px rgba(255, 51, 102, 0.25),
    0 0 0 1px rgba(255, 51, 102, 0.15);
}

.stat-card.cyan:hover {
  border-color: var(--accent-cyan);
  box-shadow:
    0 25px 50px rgba(0, 212, 255, 0.25),
    0 0 0 1px rgba(0, 212, 255, 0.15);
}

.stat-card.purple:hover {
  border-color: var(--accent-purple);
  box-shadow:
    0 25px 50px rgba(170, 85, 255, 0.25),
    0 0 0 1px rgba(170, 85, 255, 0.15);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.stat-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 8px currentColor);
  transition: all 0.2s ease;
}

.stat-card:hover .stat-icon {
  transform: scale(1.05);
  filter: drop-shadow(0 0 12px currentColor);
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(232, 224, 25, 0.7);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 0.75rem;
  font-weight: 600;
}

.stat-value {
  font-family: "Rajdhani", sans-serif;
  font-size: 3rem;
  font-weight: 800;
  color: var(--text-light);
  margin-bottom: 1.5rem;
  text-shadow: 0 0 20px rgba(232, 224, 25, 0.3);
  transition: all 0.3s ease;
  word-wrap: break-word;
  hyphens: auto;
  line-height: 1.1;
}

#economy-value,
#magic-value {
  font-size: 2.2rem;
  line-height: 1.2;
}

.stat-card:hover .stat-value {
  text-shadow: 0 0 25px rgba(232, 224, 25, 0.5);
}

.stat-subtext {
  font-size: 0.75rem;
  color: rgba(232, 224, 25, 0.5);
}

/* Stat breakdown section with progress bars */
.stat-breakdown {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  animation: fadeInUp 0.6s ease-out 0.3s both;
}

.breakdown-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.breakdown-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.breakdown-label {
  font-size: 0.75rem;
  color: rgba(232, 224, 25, 0.7);
  min-width: 80px;
  text-align: left;
}

.breakdown-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-light);
  min-width: 50px;
  text-align: right;
}

.breakdown-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

/* Progress bar with shimmer animation */
.breakdown-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--slime-blue), var(--accent-cyan));
  border-radius: 2px;
  transition: width 0.8s ease-out;
  position: relative;
}

.breakdown-fill::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shimmer 2s ease-in-out infinite;
}

.stat-card.gold .breakdown-fill {
  background: linear-gradient(90deg, var(--accent-gold), #ffed4e);
}

.stat-card.crimson .breakdown-fill {
  background: linear-gradient(90deg, var(--accent-crimson), #ff6b8a);
}

.stat-card.cyan .breakdown-fill {
  background: linear-gradient(90deg, var(--accent-cyan), #40d0ff);
}

.stat-card.purple .breakdown-fill {
  background: linear-gradient(90deg, var(--accent-purple), #d488ff);
}

.strategic-metrics {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.metric-label {
  font-size: 0.7rem;
  color: rgba(232, 224, 25, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-gold);
  text-shadow: 0 0 8px rgba(255, 165, 0, 0.3);
}

/* Performance optimizations and accessibility */
.stat-card {
  contain: layout style paint;
  will-change: transform;
}

.stat-card:active,
.state-card:active {
  transform: scale(0.98);
  transition: transform 0.1s ease;
}

/* Enhanced chart card with gradient border */
.chart-card {
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.8),
    rgba(21, 27, 61, 0.4)
  );
  backdrop-filter: blur(15px);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  padding: 2.5rem;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  animation: slideInFromLeft 0.8s ease-out 1s both;
  box-shadow:
    0 15px 35px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chart-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.chart-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--accent-gold),
    var(--slime-blue),
    var(--accent-crimson)
  );
  opacity: 0.6;
}

/* By the numbers section with statistical highlights */
.by-numbers-section {
  margin: 4rem 0;
  padding: 3rem;
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.7),
    rgba(77, 21, 22, 0.1)
  );
  border-radius: 32px;
  border: 1px solid rgba(77, 212, 255, 0.2);
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.by-numbers-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--slime-blue),
    var(--accent-cyan),
    var(--accent-gold),
    var(--accent-emerald)
  );
}

.section-subtitle {
  text-align: center;
  font-size: 1.1rem;
  color: rgba(232, 224, 25, 0.8);
  margin-bottom: 3rem;
  font-style: italic;
  text-shadow: 0 0 10px rgba(232, 224, 25, 0.3);
}

/* Numbers grid for statistical cards */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

/* Number cards with category-specific styling */
.number-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08),
    rgba(255, 255, 255, 0.02)
  );
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2rem;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.number-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.3s ease;
}

.number-card:hover {
  transform: translateY(-4px);
  border-color: rgba(77, 212, 255, 0.3);
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(77, 212, 255, 0.2);
}

.number-card:hover::before {
  left: 100%;
}

.anime-card:hover {
  border-color: var(--slime-blue);
  box-shadow:
    0 15px 40px rgba(77, 212, 255, 0.2),
    0 0 0 1px rgba(77, 212, 255, 0.2);
}

.novel-card:hover {
  border-color: var(--accent-emerald);
  box-shadow:
    0 15px 40px rgba(0, 255, 136, 0.2),
    0 0 0 1px rgba(0, 255, 136, 0.2);
}

.revenue-card:hover {
  border-color: var(--accent-gold);
  box-shadow:
    0 15px 40px rgba(255, 215, 0, 0.2),
    0 0 0 1px rgba(255, 215, 0, 0.2);
}

.number-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.number-icon {
  font-size: 2.5rem;
  filter: drop-shadow(0 0 10px currentColor);
  transition: all 0.3s ease;
}

.number-card:hover .number-icon {
  transform: scale(1.05);
  filter: drop-shadow(0 0 15px currentColor);
}

.number-category {
  font-family: "Cinzel", serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-light);
  text-shadow: 0 0 10px rgba(232, 224, 25, 0.3);
}

.number-stats {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.stat-item:hover {
  padding-left: 0.5rem;
  border-bottom-color: rgba(77, 212, 255, 0.3);
}

.stat-label {
  font-size: 0.9rem;
  color: rgba(232, 224, 25, 0.7);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stat-number {
  font-family: "Rajdhani", sans-serif;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-light);
  text-shadow: 0 0 15px rgba(232, 224, 25, 0.4);
  transition: all 0.3s ease;
}

.number-card:hover .stat-number {
  text-shadow: 0 0 20px rgba(232, 224, 25, 0.6);
}

.number-highlight {
  text-align: center;
  padding: 1rem;
  background: linear-gradient(
    135deg,
    rgba(77, 212, 255, 0.1),
    rgba(77, 212, 255, 0.05)
  );
  border-radius: 12px;
  border: 1px solid rgba(77, 212, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.highlight-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.anime-card .number-highlight {
  background: linear-gradient(
    135deg,
    rgba(77, 212, 255, 0.1),
    rgba(77, 212, 255, 0.05)
  );
  border-color: rgba(77, 212, 255, 0.2);
}

.anime-card .highlight-text {
  color: var(--slime-blue);
  text-shadow: 0 0 10px rgba(77, 212, 255, 0.4);
}

.novel-card .number-highlight {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 136, 0.1),
    rgba(0, 255, 136, 0.05)
  );
  border-color: rgba(0, 255, 136, 0.2);
}

.novel-card .highlight-text {
  color: var(--accent-emerald);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.4);
}

.revenue-card .number-highlight {
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.1),
    rgba(255, 215, 0, 0.05)
  );
  border-color: rgba(255, 215, 0, 0.2);
}

.revenue-card .highlight-text {
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

/* Performance optimizations for low-end devices */
.reduced-animations * {
  animation: none !important;
  transition: none !important;
}

.reduced-animations .stat-card:hover,
.reduced-animations .state-card:hover,
.reduced-animations .number-card:hover,
.reduced-animations .badge:hover {
  transform: none !important;
}

.mobile-optimized .stat-card,
.mobile-optimized .number-card {
  will-change: auto;
  contain: none;
}

/* Reduced motion accessibility preferences */
@media (prefers-reduced-motion: reduce) {
  .stat-card,
  .state-card,
  .badge,
  .number-card,
  .hero-welcome,
  .federation-emblem * {
    animation: none !important;
    transition: none !important;
  }

  .stat-card:hover,
  .state-card:hover,
  .badge:hover,
  .number-card:hover {
    transform: none !important;
  }
}

/* Focus states for keyboard navigation accessibility */
.stat-card:focus,
.state-card:focus,
.badge:focus,
.number-card:focus {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
}

/* ========== UTILITY CLASSES FOR MOBILE ========== */

/* Mobile-specific utility classes for responsive design */
.mobile-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mobile-full-width {
  width: 100%;
}

.mobile-center {
  text-align: center;
  align-items: center;
  justify-content: center;
}

.mobile-hide {
  display: none;
}

.mobile-show {
  display: block;
}

.mobile-animate {
  animation: mobileSlideUp 0.6s ease-out;
}

/* Mobile slide-up animation keyframes */
@keyframes mobileSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Apply mobile utilities only on mobile devices */
@media (max-width: 767px) {
  .mobile-stack {
    display: flex;
    flex-direction: column;
  }

  .mobile-full-width {
    width: 100% !important;
  }

  .mobile-center {
    text-align: center !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mobile-hide {
    display: none !important;
  }

  .mobile-show {
    display: block !important;
  }
}

/* Desktop-specific utility classes */
@media (min-width: 768px) {
  .desktop-hide {
    display: none !important;
  }

  .desktop-show {
    display: block !important;
  }

  .mobile-stack {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ========== MOBILE RESPONSIVE STYLES ========== */

/* Mobile phones responsive breakpoint (≤ 767px) */
@media (max-width: 767px) {
  .main-content {
    padding: 1.5rem 1rem;
    padding-top: 2rem;
  }

  /* Hero Welcome Section */
  .hero-welcome {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
  }

  .welcome-title {
    font-size: 2.2rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
  }

  .welcome-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }

  .welcome-badges {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .badge {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
    justify-content: center;
  }

  .federation-emblem {
    width: 200px;
    height: 200px;
    margin: 0 auto;
  }

  .emblem-core {
    width: 120px;
    height: 120px;
  }

  .emblem-image {
    width: 100px;
    height: 100px;
  }

  .ring.outer {
    width: 200px;
    height: 200px;
    top: 0;
    left: 0;
  }

  .ring.middle {
    width: 150px;
    height: 150px;
    top: 25px;
    left: 25px;
  }

  .ring.inner {
    width: 100px;
    height: 100px;
    top: 50px;
    left: 50px;
  }

  /* Section Titles */
  .section-title {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
  }

  .section-subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  /* State Summary */
  .state-summary {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .state-card {
    padding: 1.5rem;
  }

  .state-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .state-title {
    font-size: 1.1rem;
  }

  .state-description {
    font-size: 0.85rem;
    line-height: 1.5;
  }

  .state-highlights {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .highlight-item {
    font-size: 0.75rem;
    padding: 0.4rem;
  }

  .strength-category {
    padding: 0.75rem;
  }

  .strength-header {
    gap: 0.5rem;
    flex-wrap: wrap;
  }

  .strength-name {
    font-size: 0.85rem;
  }

  .strength-score {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
  }

  .strength-desc {
    font-size: 0.7rem;
    padding-left: 1.5rem;
  }

  /* Nation Grid */
  .nation-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }

  .stat-card {
    padding: 1.5rem;
    min-height: auto;
  }

  .stat-icon {
    font-size: 2rem;
  }

  .stat-label {
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
  }

  .stat-value {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    line-height: 1.1;
  }

  #economy-value,
  #technology-value {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .stat-subtext {
    font-size: 0.7rem;
  }

  .stat-breakdown {
    margin-top: 1rem;
    padding-top: 1rem;
  }

  .breakdown-title {
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
  }

  .breakdown-items {
    gap: 0.5rem;
  }

  .breakdown-item {
    gap: 0.75rem;
  }

  .breakdown-label {
    font-size: 0.7rem;
    min-width: 60px;
  }

  .breakdown-value {
    font-size: 0.7rem;
    min-width: 40px;
  }

  .strategic-metrics {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    gap: 0.4rem;
  }

  .metric-label {
    font-size: 0.65rem;
  }

  .metric-value {
    font-size: 0.7rem;
  }

  /* By the Numbers Section */
  .by-numbers-section {
    margin: 2rem 0;
    padding: 2rem 1.5rem;
  }

  .numbers-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .number-card {
    padding: 1.5rem;
  }

  .number-header {
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .number-icon {
    font-size: 2rem;
  }

  .number-category {
    font-size: 1.1rem;
  }

  .number-stats {
    gap: 1rem;
    margin-bottom: 1.5rem;
  }

  .stat-item {
    padding: 0.5rem 0;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .stat-number {
    font-size: 1.4rem;
  }

  .number-highlight {
    padding: 0.75rem;
  }

  .highlight-text {
    font-size: 0.8rem;
  }

  /* Floating orbs - hide on mobile for performance */
  .floating-orb {
    display: none;
  }

  /* Disable heavy visuals for performance */
  .magic-circle,
  .particles,
  .starfield {
    display: none !important;
  }

  /* Smooth mobile scrolling */
  body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
}

/* Small phones responsive breakpoint (≤ 479px) */
@media (max-width: 479px) {
  .main-content {
    padding: 1rem 0.75rem;
    padding-top: 1.5rem;
  }

  .hero-welcome {
    padding: 1.5rem 1rem;
    margin-bottom: 1.5rem;
  }

  .welcome-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }

  .welcome-description {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .badge {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }

  .federation-emblem {
    width: 160px;
    height: 160px;
  }

  .emblem-core {
    width: 100px;
    height: 100px;
  }

  .emblem-image {
    width: 80px;
    height: 80px;
  }

  .section-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
  }

  .section-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .state-card {
    padding: 1.25rem;
  }

  .state-title {
    font-size: 1rem;
  }

  .stat-card {
    padding: 1.25rem;
  }

  .stat-value {
    font-size: 1.8rem;
  }

  #economy-value,
  #technology-value {
    font-size: 1.5rem;
  }

  .by-numbers-section {
    padding: 1.5rem 1rem;
  }

  .number-card {
    padding: 1.25rem;
  }

  .number-category {
    font-size: 1rem;
  }

  .stat-number {
    font-size: 1.2rem;
  }
}

/* Tablets responsive breakpoint (≥ 768px) */
@media (min-width: 768px) {
  .main-content {
    padding: 2rem;
    padding-top: 2rem;
  }

  .hero-welcome {
    grid-template-columns: 2fr 1fr;
    text-align: left;
  }

  .welcome-badges {
    grid-template-columns: repeat(2, 1fr);
  }

  .state-summary {
    grid-template-columns: 1fr 1fr;
  }

  .nation-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .numbers-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Laptops responsive breakpoint (≥ 1024px) */
@media (min-width: 1024px) {
  .main-content {
    max-width: 1400px;
    padding: 2rem 3rem;
    padding-top: 2rem;
  }

  .nation-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .numbers-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Large screens responsive breakpoint (≥ 1280px) */
@media (min-width: 1280px) {
  .main-content {
    max-width: 1600px;
  }
}

/* Touch device interaction improvements */
@media (max-width: 767px) {
  /* Improve touch targets */
  .stat-card,
  .state-card,
  .badge,
  .number-card {
    min-height: 44px;
    touch-action: manipulation;
  }

  /* Reduce hover effects on touch devices */
  .stat-card:hover,
  .state-card:hover,
  .badge:hover,
  .number-card:hover {
    transform: none;
  }

  /* Enhanced mobile touch feedback */
  .stat-card:active,
  .state-card:active,
  .pillar-card:active,
  .key-figure-card:active,
  .number-card:active,
  .badge:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
}

/* ================= FEDERATION PILLARS ================= */

.federation-pillars {
  margin: 5rem auto;
  max-width: 1200px;
  text-align: center;
  position: relative;
  z-index: 5;
}

.pillars-title {
  font-family: "Cinzel", serif;
  font-size: 2.4rem;
  color: var(--primary-blue);
  margin-bottom: 0.5rem;
  text-shadow: 0 0 20px var(--glow-blue);
}

.pillars-subtitle {
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 3rem;
  font-size: 1.05rem;
}

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.8rem;
  padding: 0 1rem;
}

.pillar-card {
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.8),
    rgba(21, 27, 61, 0.5)
  );
  border: 2px solid rgba(77, 212, 255, 0.25);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: var(--text-light);
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.pillar-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    120deg,
    transparent,
    rgba(77, 212, 255, 0.12),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pillar-card:hover::before {
  opacity: 1;
}

.pillar-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-blue);
  box-shadow:
    0 15px 35px rgba(77, 212, 255, 0.35),
    0 0 25px rgba(77, 212, 255, 0.25);
}

.pillar-icon {
  font-size: 2.6rem;
  display: block;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px var(--glow-blue));
}

.pillar-card h3 {
  font-family: "Cinzel", serif;
  font-size: 1.25rem;
  color: var(--primary-blue);
  margin-bottom: 0.6rem;
}

.pillar-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Mobile spacing */
@media (max-width: 768px) {
  .federation-pillars {
    margin: 4rem auto;
  }
}

/* ================= KEY FIGURES AT A GLANCE ================= */

.key-figures-section {
  margin: 5rem auto;
  max-width: 1200px;
  text-align: center;
  position: relative;
  z-index: 5;
}

.key-figures-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.key-figure-card {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.8rem;
  border-radius: 18px;
  text-decoration: none;
  color: var(--text-light);
  background: linear-gradient(
    135deg,
    rgba(21, 27, 61, 0.85),
    rgba(21, 27, 61, 0.6)
  );
  border: 2px solid rgba(77, 212, 255, 0.25);
  backdrop-filter: blur(14px);
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}

.key-figure-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.08),
    transparent 60%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.key-figure-card:hover::before {
  opacity: 1;
}

.key-figure-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border-color: var(--primary-blue);
}

.figure-icon {
  font-size: 2.8rem;
  filter: drop-shadow(0 0 12px var(--glow-blue));
}

.figure-info h3 {
  margin: 0;
  font-family: "Cinzel", serif;
  font-size: 1.2rem;
  color: var(--primary-blue);
}

.figure-role {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* Role Accents */
.key-figure-card.supreme {
  border-color: rgba(255, 215, 0, 0.4);
}

.key-figure-card.military {
  border-color: rgba(255, 87, 87, 0.4);
}

.key-figure-card.enforcement {
  border-color: rgba(170, 85, 255, 0.4);
}

.key-figure-card.diplomacy {
  border-color: rgba(0, 255, 136, 0.4);
}

/* ================= ENHANCED VISUAL EFFECTS ================= */

/* Enhanced loading animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Enhanced shimmer effect */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* Particle effect for enhanced visual appeal */
.enhanced-particles {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.enhanced-particles::before,
.enhanced-particles::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary-blue);
  border-radius: 50%;
  animation: particleFloat 8s ease-in-out infinite;
}

.enhanced-particles::before {
  top: 20%;
  left: 10%;
  animation-delay: 0s;
}

.enhanced-particles::after {
  top: 60%;
  right: 15%;
  animation-delay: 4s;
  background: var(--accent-gold);
}

@keyframes particleFloat {
  0%,
  100% {
    transform: translateY(0px) scale(1);
    opacity: 0.6;
  }
  50% {
    transform: translateY(-20px) scale(1.2);
    opacity: 1;
  }
}

/* Enhanced focus states for better accessibility */
.stat-card:focus-visible,
.pillar-card:focus-visible,
.key-figure-card:focus-visible,
.number-card:focus-visible,
.badge:focus-visible {
  outline: 3px solid var(--accent-cyan);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(77, 212, 255, 0.2);
}

/* Improved text selection styling */
::selection {
  background: rgba(77, 212, 255, 0.3);
  color: var(--text-light);
}

::-moz-selection {
  background: rgba(77, 212, 255, 0.3);
  color: var(--text-light);
}

/* Enhanced scrollbar styling for webkit browsers */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(21, 27, 61, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--primary-blue), var(--accent-cyan));
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--accent-cyan), var(--primary-blue));
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .stat-card,
  .pillar-card,
  .key-figure-card,
  .number-card,
  .badge {
    border-width: 3px;
    border-color: var(--text-light);
  }

  .welcome-title,
  .section-title,
  .pillars-title {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  }
}

/* Print styles for better document printing */
@media print {
  .floating-orb,
  .magic-circle,
  .particles,
  .starfield,
  .enhanced-particles {
    display: none !important;
  }

  .hero-welcome,
  .stat-card,
  .pillar-card,
  .key-figure-card,
  .number-card {
    break-inside: avoid;
    box-shadow: none !important;
    border: 2px solid #333 !important;
  }

  .main-content {
    padding: 1rem !important;
  }
}

/* Enhanced dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --text-light: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --border-subtle: rgba(255, 255, 255, 0.1);
  }
}

/* Reduced data usage for slow connections */
@media (prefers-reduced-data: reduce) {
  .floating-orb,
  .magic-circle,
  .particles,
  .enhanced-particles {
    display: none !important;
  }

  .hero-welcome::before,
  .stat-card::before,
  .pillar-card::before {
    display: none !important;
  }
}
