/* =====================================================
   INNOVATIVE ECONOMIC WIDGETS - PROFESSIONAL STYLING
   Enhanced for Canadian Market Data
   FIXED LAYOUT - NO HORIZONTAL MOVEMENT
   ===================================================== */

/* =====================================================
   FIXED WIDGET LAYOUT SYSTEM - PREVENTS MOVEMENT
   ===================================================== */

.widget-responsive-section {
  padding: 3rem 0;
  background: linear-gradient(135deg, rgba(35, 140, 140, 0.05) 0%, rgba(31, 184, 205, 0.05) 100%);
  position: relative;
}

.widget-section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--economics-primary, #238C8C);
  margin-bottom: 3rem;
  position: relative;
}

.widget-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  /* FIXED: Prevent horizontal reordering */
  grid-auto-flow: row;
  place-items: stretch;
  /* FIXED: Stable positioning */
  position: relative;
  width: 100%;
  box-sizing: border-box;
}

.widget-card {
  /* FIXED: Static positioning prevents drift */
  position: static;
  display: flex;
  flex-direction: column;
  background: var(--economics-bg, rgba(255, 255, 255, 0.95));
  border-radius: 16px;
  padding: 1.5rem;
  border: 1px solid rgba(35, 140, 140, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  /* FIXED: Controlled transforms - vertical only */
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  transform-origin: center center;
  /* FIXED: Prevent width changes */
  min-height: 200px;
  width: 100%;
  box-sizing: border-box;
  /* FIXED: No horizontal transforms */
  will-change: transform;
}

.widget-card:hover {
  /* FIXED: Only vertical movement allowed */
  transform: translateY(-8px);
  box-shadow: 0 8px 30px rgba(35, 140, 140, 0.15);
  /* NO horizontal transforms */
}

.widget-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  /* FIXED: Prevent content from affecting layout */
  overflow: hidden;
}

.widget-card-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  display: block;
  text-align: center;
  /* FIXED: Prevent icon movement */
  position: static;
}

.widget-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--economics-text, #333);
  margin-bottom: 1rem;
  text-align: center;
  /* FIXED: Prevent text reflow issues */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* =====================================================
   RESPONSIVE BREAKPOINTS - FIXED LAYOUT
   ===================================================== */

/* Large Desktop */
@media (min-width: 1200px) {
  .widget-cards-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
  }
}

/* Desktop */
@media (min-width: 992px) and (max-width: 1199px) {
  .widget-cards-row {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
  .widget-cards-row {
    /* FIXED: 2 columns, no reordering */
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    /* Maintain order */
    grid-auto-flow: row;
  }
  
  .widget-card {
    min-height: 180px;
  }
  
  .widget-card-title {
    font-size: 1rem;
    /* Allow wrapping on smaller screens */
    white-space: normal;
  }
}

/* Mobile */
@media (max-width: 767px) {
  .widget-cards-row {
    /* FIXED: Single column stack, no horizontal movement */
    grid-template-columns: 1fr;
    gap: 1rem;
    /* Ensure vertical stacking only */
    grid-auto-flow: row;
  }
  
  .widget-card {
    min-height: 160px;
    padding: 1.25rem;
    /* FIXED: Prevent mobile sliding */
    transform: none !important;
  }
  
  .widget-card:hover {
    /* FIXED: Minimal movement on mobile */
    transform: translateY(-4px);
  }
  
  .widget-section-title {
    font-size: 2rem;
  }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
  .widget-responsive-section {
    padding: 2rem 0;
  }
  
  .widget-cards-row {
    gap: 0.75rem;
  }
  
  .widget-card {
    padding: 1rem;
    min-height: 140px;
  }
  
  .widget-card-title {
    font-size: 0.9rem;
  }
}

/* =====================================================
   ENHANCED BITCOIN WIDGET - CANADIAN FOCUS
   ===================================================== */

.widget-crypto .widget-crypto-main {
  margin: 12px 0;
  text-align: center;
}

.widget-crypto .widget-crypto-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--economics-primary, #238C8C);
  line-height: 1.2;
  display: block;
  margin-bottom: 0.5rem;
}

.widget-crypto .widget-crypto-change {
  margin-top: 6px;
  font-size: 0.9rem;
  font-weight: 600;
}

.widget-crypto .crypto-positive {
  color: #27ae60;
}

.widget-crypto .crypto-negative {
  color: #e74c3c;
}

.widget-crypto .crypto-neutral {
  color: #f39c12;
}

/* Loading state for crypto widget */
.widget-crypto.loading .widget-crypto-price::after {
  content: '...';
  animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
  0%, 20% { opacity: 0; }
  40% { opacity: 1; }
  100% { opacity: 0; }
}

/* =====================================================
   ECONOMIC CALENDAR WIDGET - CANADIAN EVENTS
   ===================================================== */

.widget-economic-calendar .widget-calendar-events {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.widget-economic-calendar .widget-calendar-events::-webkit-scrollbar {
  width: 3px;
}

.widget-economic-calendar .widget-calendar-events::-webkit-scrollbar-track {
  background: transparent;
}

.widget-economic-calendar .widget-calendar-events::-webkit-scrollbar-thumb {
  background: var(--economics-primary, #238C8C);
  border-radius: 2px;
}

.widget-economic-calendar .event-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--economics-hover, #f8f9fa);
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  /* FIXED: Prevent horizontal sliding */
  transform: none;
}

.widget-economic-calendar .event-item:hover {
  /* FIXED: Minimal movement only */
  background: var(--economics-bg, #ffffff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  /* NO horizontal transforms */
}

.widget-economic-calendar .event-item.high-impact {
  border-left-color: #e74c3c;
  background: rgba(231, 76, 60, 0.05);
}

.widget-economic-calendar .event-item.medium-impact {
  border-left-color: #f39c12;
  background: rgba(243, 156, 18, 0.05);
}

.widget-economic-calendar .event-item.low-impact {
  border-left-color: #27ae60;
  background: rgba(39, 174, 96, 0.05);
}

.widget-economic-calendar .event-time {
  font-size: 10px;
  font-weight: 600;
  color: var(--economics-text, #333);
  min-width: 35px;
  background: rgba(255, 255, 255, 0.8);
  padding: 2px 4px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.widget-economic-calendar .event-title {
  flex: 1;
  margin: 0 6px;
  font-size: 9px;
  font-weight: 500;
  color: var(--economics-text, #333);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.widget-economic-calendar .event-impact {
  font-size: 12px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.widget-economic-calendar .event-value {
  font-size: 9px;
  font-weight: 600;
  color: var(--economics-primary, #238C8C);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px 4px;
  border-radius: 3px;
  margin-left: 4px;
}

/* =====================================================
   MARKET SENTIMENT WIDGET - ENHANCED
   ===================================================== */

.widget-market-sentiment .sentiment-gauge {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
  position: relative;
}

.widget-market-sentiment .gauge-container {
  position: relative;
  width: 100px;
  height: 50px;
  overflow: hidden;
  border-radius: 50px 50px 0 0;
  background: linear-gradient(90deg, #e74c3c 0%, #f39c12 50%, #27ae60 100%);
  padding: 2px;
}

.widget-market-sentiment .gauge-container::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  bottom: -2px;
  background: var(--economics-bg, #ffffff);
  border-radius: 48px 48px 0 0;
}

.widget-market-sentiment .gauge-fill {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 30px;
  background: #333;
  transform-origin: bottom center;
  transform: translate(-50%, -100%) rotate(-90deg);
  transition: transform 0.6s cubic-bezier(0.4, 0.0, 0.2, 1);
  z-index: 10;
  border-radius: 2px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.3);
}

.widget-market-sentiment .gauge-center {
  position: absolute;
  top: 35px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 5;
}

.widget-market-sentiment .sentiment-value {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--economics-primary, #238C8C);
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.widget-market-sentiment .sentiment-label {
  display: block;
  font-size: 8px;
  font-weight: 600;
  color: var(--economics-text, #333);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.widget-market-sentiment .sentiment-label.bullish {
  color: #27ae60;
}

.widget-market-sentiment .sentiment-label.bearish {
  color: #e74c3c;
}

.widget-market-sentiment .sentiment-label.neutral {
  color: #f39c12;
}

.widget-market-sentiment .sentiment-indicators {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 10px;
}

.widget-market-sentiment .indicator {
  flex: 1;
  text-align: center;
  padding: 4px 2px;
  background: var(--economics-hover, #f8f9fa);
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.widget-market-sentiment .indicator:hover {
  background: var(--economics-bg, #ffffff);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  /* FIXED: No horizontal movement */
}

.widget-market-sentiment .indicator-label {
  display: block;
  font-size: 7px;
  color: #666;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.widget-market-sentiment .indicator-value {
  display: block;
  font-size: 10px;
  font-weight: 700;
}

.widget-market-sentiment .indicator-value.bullish {
  color: #27ae60;
}

.widget-market-sentiment .indicator-value.bearish {
  color: #e74c3c;
}

.widget-market-sentiment .indicator-value.neutral {
  color: #f39c12;
}

/* =====================================================
   CENTRAL BANK RATES WIDGET - ENHANCED
   ===================================================== */

.widget-interest-rates .rates-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
  max-height: 160px;
  overflow-y: auto;
}

.widget-interest-rates .rates-list::-webkit-scrollbar {
  width: 3px;
}

.widget-interest-rates .rates-list::-webkit-scrollbar-thumb {
  background: var(--economics-primary, #238C8C);
  border-radius: 2px;
}

.widget-interest-rates .rate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: var(--economics-hover, #f8f9fa);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  position: relative;
}

.widget-interest-rates .rate-item:hover {
  background: var(--economics-bg, #ffffff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  /* FIXED: No horizontal movement */
}

.widget-interest-rates .country-flag {
  font-size: 14px;
  margin-right: 6px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.widget-interest-rates .rate-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.widget-interest-rates .rate-country {
  font-size: 9px;
  font-weight: 600;
  color: var(--economics-text, #333);
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.widget-interest-rates .rate-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--economics-primary, #238C8C);
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.widget-interest-rates .rate-change {
  font-size: 12px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

.widget-interest-rates .rate-change.up {
  color: #27ae60;
}

.widget-interest-rates .rate-change.down {
  color: #e74c3c;
}

.widget-interest-rates .rate-change.unchanged {
  color: #95a5a6;
}

/* =====================================================
   ECONOMIC INDICATORS WIDGET - ENHANCED
   ===================================================== */

.widget-economic-indicators .indicators-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 12px 0;
}

.widget-economic-indicators .indicator-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 6px;
  background: var(--economics-hover, #f8f9fa);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.widget-economic-indicators .indicator-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--economics-primary, #238C8C), transparent);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.widget-economic-indicators .indicator-item:hover::before {
  transform: translateX(0);
}

.widget-economic-indicators .indicator-item:hover {
  background: var(--economics-bg, #ffffff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  /* FIXED: No horizontal movement */
}

.widget-economic-indicators .indicator-name {
  font-size: 8px;
  font-weight: 600;
  color: #666;
  margin-bottom: 4px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.widget-economic-indicators .indicator-value {
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.widget-economic-indicators .indicator-value.positive {
  color: #27ae60;
}

.widget-economic-indicators .indicator-value.negative {
  color: #e74c3c;
}

.widget-economic-indicators .indicator-value.neutral {
  color: #f39c12;
}

/* =====================================================
   TIME AND WEATHER WIDGETS - FIXED
   ===================================================== */

.widget-time .widget-time-main,
.widget-weather .widget-weather-main,
.widget-quote .widget-quote-main {
  text-align: center;
  margin: 12px 0;
}

.widget-time .widget-time-main {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--economics-primary, #238C8C);
  font-family: 'Courier New', monospace;
}

.widget-weather .widget-weather-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.widget-weather .widget-weather-icon {
  font-size: 1.5rem;
}

.widget-weather .widget-weather-temp {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--economics-primary, #238C8C);
}

.widget-weather .widget-weather-desc {
  font-size: 0.9rem;
  color: #666;
  margin-top: 4px;
}

.widget-quote .widget-quote-main {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--economics-text, #333);
  line-height: 1.4;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
}

.widget-card-secondary {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
  margin-top: 8px;
}

.widget-card-caption {
  font-size: 0.75rem;
  color: #888;
  text-align: center;
  margin-top: 6px;
  font-style: italic;
}

/* =====================================================
   REAL-TIME UPDATE ANIMATIONS - FIXED
   ===================================================== */

.widget-card.updating {
  position: relative;
  overflow: hidden;
}

.widget-card.updating::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--economics-accent, #00ff88), transparent);
  animation: updateProgress 2s ease-in-out;
}

@keyframes updateProgress {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Success flash animation */
.widget-card.updated {
  animation: flashSuccess 0.5s ease;
}

@keyframes flashSuccess {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(39, 174, 96, 0.1); }
}

/* Error state */
.widget-card.error {
  border: 1px solid rgba(231, 76, 60, 0.3);
  background: rgba(231, 76, 60, 0.05);
}

/* =====================================================
   DARK MODE SUPPORT - ENHANCED
   ===================================================== */

[data-color-scheme="dark"] .widget-card {
  background: rgba(45, 45, 45, 0.95);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

[data-color-scheme="dark"] .widget-economic-calendar .event-item,
[data-color-scheme="dark"] .widget-interest-rates .rate-item,
[data-color-scheme="dark"] .widget-economic-indicators .indicator-item,
[data-color-scheme="dark"] .widget-market-sentiment .indicator {
  background: #3d3d3d;
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

[data-color-scheme="dark"] .widget-economic-calendar .event-item.high-impact {
  background: rgba(231, 76, 60, 0.15);
}

[data-color-scheme="dark"] .widget-economic-calendar .event-item.medium-impact {
  background: rgba(243, 156, 18, 0.15);
}

[data-color-scheme="dark"] .widget-economic-calendar .event-item.low-impact {
  background: rgba(39, 174, 96, 0.15);
}

[data-color-scheme="dark"] .widget-card-title,
[data-color-scheme="dark"] .widget-economic-calendar .event-time,
[data-color-scheme="dark"] .widget-economic-calendar .event-title,
[data-color-scheme="dark"] .widget-interest-rates .rate-country,
[data-color-scheme="dark"] .widget-market-sentiment .sentiment-label {
  color: #ffffff;
}

[data-color-scheme="dark"] .widget-economic-calendar .event-time,
[data-color-scheme="dark"] .widget-economic-calendar .event-value {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.2);
}

[data-color-scheme="dark"] .widget-market-sentiment .indicator-label,
[data-color-scheme="dark"] .widget-economic-indicators .indicator-name,
[data-color-scheme="dark"] .widget-card-secondary,
[data-color-scheme="dark"] .widget-card-caption {
  color: #cccccc;
}

[data-color-scheme="dark"] .widget-market-sentiment .gauge-container::before {
  background: #3d3d3d;
}

/* =====================================================
   ANIMATION ENHANCEMENTS - CONTROLLED
   ===================================================== */

.widget-economic-calendar .event-item,
.widget-interest-rates .rate-item,
.widget-economic-indicators .indicator-item {
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
}

.widget-economic-calendar .event-item:nth-child(1) { animation-delay: 0.1s; }
.widget-economic-calendar .event-item:nth-child(2) { animation-delay: 0.2s; }
.widget-economic-calendar .event-item:nth-child(3) { animation-delay: 0.3s; }
.widget-economic-calendar .event-item:nth-child(4) { animation-delay: 0.4s; }
.widget-economic-calendar .event-item:nth-child(5) { animation-delay: 0.5s; }

.widget-interest-rates .rate-item:nth-child(1) { animation-delay: 0.1s; }
.widget-interest-rates .rate-item:nth-child(2) { animation-delay: 0.2s; }
.widget-interest-rates .rate-item:nth-child(3) { animation-delay: 0.3s; }
.widget-interest-rates .rate-item:nth-child(4) { animation-delay: 0.4s; }
.widget-interest-rates .rate-item:nth-child(5) { animation-delay: 0.5s; }

.widget-economic-indicators .indicator-item:nth-child(1) { animation-delay: 0.1s; }
.widget-economic-indicators .indicator-item:nth-child(2) { animation-delay: 0.2s; }
.widget-economic-indicators .indicator-item:nth-child(3) { animation-delay: 0.3s; }
.widget-economic-indicators .indicator-item:nth-child(4) { animation-delay: 0.4s; }

.widget-market-sentiment .sentiment-gauge {
  animation: fadeIn 0.6s ease forwards;
}

.widget-crypto .widget-crypto-main {
  animation: slideIn 0.5s ease forwards;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =====================================================
   ACCESSIBILITY ENHANCEMENTS
   ===================================================== */

.widget-economic-calendar .event-item,
.widget-interest-rates .rate-item,
.widget-economic-indicators .indicator-item,
.widget-market-sentiment .indicator {
  outline: none;
  transition: all 0.2s ease;
}

.widget-economic-calendar .event-item:focus,
.widget-interest-rates .rate-item:focus,
.widget-economic-indicators .indicator-item:focus {
  box-shadow: 0 0 0 2px var(--economics-accent, #00ff88);
  outline: 2px solid transparent;
}

/* Screen reader support */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .widget-card,
  .widget-economic-calendar .event-item,
  .widget-interest-rates .rate-item,
  .widget-economic-indicators .indicator-item {
    border: 2px solid var(--economics-primary, #238C8C);
  }
  
  .widget-market-sentiment .gauge-container {
    border: 2px solid var(--economics-primary, #238C8C);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .widget-card,
  .widget-economic-calendar .event-item,
  .widget-interest-rates .rate-item,
  .widget-economic-indicators .indicator-item,
  .widget-market-sentiment .sentiment-gauge,
  .widget-market-sentiment .gauge-fill,
  .widget-crypto .widget-crypto-main {
    animation: none;
    transition: none;
  }
  
  .widget-card:hover {
    transform: none;
  }
  
  .widget-card.updating::after {
    animation: none;
  }
}

/* =====================================================
   LOADING STATES
   ===================================================== */

.widget-card .loading-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

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

.widget-card .loading-text {
  height: 12px;
  margin: 4px 0;
}

.widget-card .loading-number {
  height: 16px;
  width: 60px;
  margin: 2px 0;
}

/* =====================================================
   WIDGET STATUS INDICATORS
   ===================================================== */

.widget-card-status {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  z-index: 10;
}

.widget-card-status.online {
  background: #27ae60;
  box-shadow: 0 0 4px rgba(39, 174, 96, 0.5);
}

.widget-card-status.offline {
  background: #e74c3c;
  box-shadow: 0 0 4px rgba(231, 76, 60, 0.5);
}

.widget-card-status.loading {
  background: #f39c12;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* =====================================================
   CONTAINER STABILITY - PREVENT LAYOUT SHIFT
   ===================================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  /* FIXED: Stable width calculations */
  box-sizing: border-box;
  /* FIXED: Prevent container shifting */
  position: relative;
}

/* FIXED: Ensure no transform inheritance */
* {
  box-sizing: border-box;
}

/* FIXED: Prevent any unintended horizontal scrolling */
body {
  overflow-x: hidden;
}