/* ============================================
   UNIFIED METRIC CARDS
   Consistent styling for all metric cards across Overview, Money, and Tenders
   ============================================ */

/* Base Card Styling */
.quick-stat-card,
.money-metric-card,
.tender-metric-card {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease;
  width: 100%;
}

.quick-stat-card:hover,
.money-metric-card:hover,
.tender-metric-card:hover {
  transform: translateY(-2px);
}

.quick-stat-card:active,
.money-metric-card:active,
.tender-metric-card:active {
  transform: translateY(0);
}

/* Card Content Container */
.stat-content,
.metric-content {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Header with Icon and Drill Indicator */
.stat-header,
.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.stat-icon,
.metric-icon {
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
}

.drill-indicator {
  font-size: 18px;
  color: rgba(0, 158, 217, 0.6);
  font-weight: 300;
  opacity: 0.7;
}

.quick-stat-card:hover .drill-indicator,
.money-metric-card:hover .drill-indicator,
.tender-metric-card:hover .drill-indicator {
  opacity: 1;
}

/* Value - Large, Bold, Prominent */
.stat-value,
.metric-value {
  font-size: 36px !important;
  font-weight: 700 !important;
  color: var(--brokerly-text-primary) !important;
  margin: 0 !important;
  line-height: 1.1 !important;
  position: relative;
  z-index: 1;
  letter-spacing: -0.02em;
}

/* Dark Mode - Flat Backgrounds with Neon Borders */
@media (prefers-color-scheme: dark) {

  :root:not([data-theme="light"]) .stat-content[style*="rgba(255, 236, 179"],
  :root:not([data-theme="light"]) .stat-content[style*="255, 236, 179"] {
    background: rgba(251, 191, 36, 0.05) !important;
    border: 1px solid rgba(251, 191, 36, 0.5) !important;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.1) !important;
  }

  :root:not([data-theme="light"]) .stat-content[style*="rgba(255, 235, 235"],
  :root:not([data-theme="light"]) .stat-content[style*="255, 235, 235"] {
    background: rgba(248, 113, 113, 0.05) !important;
    border: 1px solid rgba(248, 113, 113, 0.5) !important;
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.1) !important;
  }

  :root:not([data-theme="light"]) .stat-content[style*="rgba(220, 252, 231"],
  :root:not([data-theme="light"]) .stat-content[style*="220, 252, 231"] {
    background: rgba(52, 211, 153, 0.05) !important;
    border: 1px solid rgba(52, 211, 153, 0.5) !important;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.1) !important;
  }

  :root:not([data-theme="light"]) .stat-content[style*="rgba(224, 242, 254"],
  :root:not([data-theme="light"]) .stat-content[style*="224, 242, 254"] {
    background: rgba(59, 130, 246, 0.05) !important;
    border: 1px solid rgba(59, 130, 246, 0.5) !important;
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.1) !important;
  }

  :root:not([data-theme="light"]) .stat-content[style*="rgba(147, 51, 234"],
  :root:not([data-theme="light"]) .stat-content[style*="147, 51, 234"] {
    background: rgba(168, 85, 247, 0.05) !important;
    border: 1px solid rgba(168, 85, 247, 0.5) !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.1) !important;
  }

  :root:not([data-theme="light"]) .stat-content[style*="rgba(100, 116, 139"],
  :root:not([data-theme="light"]) .stat-content[style*="100, 116, 139"] {
    background: rgba(148, 163, 184, 0.05) !important;
    border: 1px solid rgba(148, 163, 184, 0.5) !important;
    box-shadow: 0 0 12px rgba(148, 163, 184, 0.1) !important;
  }

  /* Tender Overview Cards */
  :root:not([data-theme="light"]) .stat-content[style*="rgba(153, 102, 230"],
  :root:not([data-theme="light"]) .metric-content[style*="rgba(153, 102, 230"] {
    background: rgba(168, 85, 247, 0.05) !important;
    border: 1px solid rgba(168, 85, 247, 0.5) !important;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.1) !important;
  }

  :root:not([data-theme="light"]) .stat-content[style*="rgba(51, 179, 230"],
  :root:not([data-theme="light"]) .metric-content[style*="rgba(51, 179, 230"] {
    background: rgba(56, 189, 248, 0.05) !important;
    border: 1px solid rgba(56, 189, 248, 0.5) !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.1) !important;
  }

  :root:not([data-theme="light"]) .stat-content[style*="rgba(230, 128, 51"],
  :root:not([data-theme="light"]) .metric-content[style*="rgba(230, 128, 51"] {
    background: rgba(251, 146, 60, 0.05) !important;
    border: 1px solid rgba(251, 146, 60, 0.5) !important;
    box-shadow: 0 0 12px rgba(251, 146, 60, 0.1) !important;
  }

  :root:not([data-theme="light"]) .stat-content[style*="rgba(26, 204, 153"],
  :root:not([data-theme="light"]) .metric-content[style*="rgba(26, 204, 153"] {
    background: rgba(52, 211, 153, 0.05) !important;
    border: 1px solid rgba(52, 211, 153, 0.5) !important;
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.1) !important;
  }
}

:root[data-theme="dark"] .stat-content[style*="rgba(255, 236, 179"],
:root[data-theme="dark"] .stat-content[style*="255, 236, 179"],
.dark-mode .stat-content[style*="rgba(255, 236, 179"],
.dark-mode .stat-content[style*="255, 236, 179"] {
  background: rgba(251, 191, 36, 0.05) !important;
  border: 1px solid rgba(251, 191, 36, 0.5) !important;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.1) !important;
}

:root[data-theme="dark"] .stat-content[style*="rgba(255, 235, 235"],
:root[data-theme="dark"] .stat-content[style*="255, 235, 235"],
.dark-mode .stat-content[style*="rgba(255, 235, 235"],
.dark-mode .stat-content[style*="255, 235, 235"] {
  background: rgba(248, 113, 113, 0.05) !important;
  border: 1px solid rgba(248, 113, 113, 0.5) !important;
  box-shadow: 0 0 12px rgba(248, 113, 113, 0.1) !important;
}

:root[data-theme="dark"] .stat-content[style*="rgba(220, 252, 231"],
:root[data-theme="dark"] .stat-content[style*="220, 252, 231"],
.dark-mode .stat-content[style*="rgba(220, 252, 231"],
.dark-mode .stat-content[style*="220, 252, 231"] {
  background: rgba(52, 211, 153, 0.05) !important;
  border: 1px solid rgba(52, 211, 153, 0.5) !important;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.1) !important;
}

:root[data-theme="dark"] .stat-content[style*="rgba(224, 242, 254"],
:root[data-theme="dark"] .stat-content[style*="224, 242, 254"],
.dark-mode .stat-content[style*="rgba(224, 242, 254"],
.dark-mode .stat-content[style*="224, 242, 254"] {
  background: rgba(59, 130, 246, 0.05) !important;
  border: 1px solid rgba(59, 130, 246, 0.5) !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.1) !important;
}

:root[data-theme="dark"] .stat-content[style*="rgba(147, 51, 234"],
:root[data-theme="dark"] .stat-content[style*="147, 51, 234"],
.dark-mode .stat-content[style*="rgba(147, 51, 234"],
.dark-mode .stat-content[style*="147, 51, 234"] {
  background: rgba(168, 85, 247, 0.05) !important;
  border: 1px solid rgba(168, 85, 247, 0.5) !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.1) !important;
}

:root[data-theme="dark"] .stat-content[style*="rgba(100, 116, 139"],
:root[data-theme="dark"] .stat-content[style*="100, 116, 139"],
.dark-mode .stat-content[style*="rgba(100, 116, 139"],
.dark-mode .stat-content[style*="100, 116, 139"] {
  background: rgba(148, 163, 184, 0.05) !important;
  border: 1px solid rgba(148, 163, 184, 0.5) !important;
  box-shadow: 0 0 12px rgba(148, 163, 184, 0.1) !important;
}

/* Tender Overview Cards */
:root[data-theme="dark"] .stat-content[style*="rgba(153, 102, 230"],
:root[data-theme="dark"] .metric-content[style*="rgba(153, 102, 230"],
.dark-mode .stat-content[style*="rgba(153, 102, 230"],
.dark-mode .metric-content[style*="rgba(153, 102, 230"] {
  background: rgba(168, 85, 247, 0.05) !important;
  border: 1px solid rgba(168, 85, 247, 0.5) !important;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.1) !important;
}

:root[data-theme="dark"] .stat-content[style*="rgba(51, 179, 230"],
:root[data-theme="dark"] .metric-content[style*="rgba(51, 179, 230"],
.dark-mode .stat-content[style*="rgba(51, 179, 230"],
.dark-mode .metric-content[style*="rgba(51, 179, 230"] {
  background: rgba(56, 189, 248, 0.05) !important;
  border: 1px solid rgba(56, 189, 248, 0.5) !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.1) !important;
}

:root[data-theme="dark"] .stat-content[style*="rgba(230, 128, 51"],
:root[data-theme="dark"] .metric-content[style*="rgba(230, 128, 51"],
.dark-mode .stat-content[style*="rgba(230, 128, 51"],
.dark-mode .metric-content[style*="rgba(230, 128, 51"] {
  background: rgba(251, 146, 60, 0.05) !important;
  border: 1px solid rgba(251, 146, 60, 0.5) !important;
  box-shadow: 0 0 12px rgba(251, 146, 60, 0.1) !important;
}

:root[data-theme="dark"] .stat-content[style*="rgba(26, 204, 153"],
:root[data-theme="dark"] .metric-content[style*="rgba(26, 204, 153"],
.dark-mode .stat-content[style*="rgba(26, 204, 153"],
.dark-mode .metric-content[style*="rgba(26, 204, 153"] {
  background: rgba(52, 211, 153, 0.05) !important;
  border: 1px solid rgba(52, 211, 153, 0.5) !important;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.1) !important;
}

/* Label - Small, Medium Weight, Secondary Color */
.stat-label,
.metric-label {
  font-size: 14px !important;
  font-weight: 500 !important;
  color: var(--brokerly-text-secondary) !important;
  position: relative;
  z-index: 1;
  margin-top: 6px !important;
  line-height: 1.2 !important;
  text-transform: none !important;
}

/* Color-Specific Backgrounds (matching the image) */
/* Total Income - Warm Yellow/Gold */
.stat-content[style*="rgba(255, 215, 0"],
.metric-content.income-bg {
  background: linear-gradient(135deg,
      rgba(255, 236, 179, 0.4) 0%,
      rgba(255, 236, 179, 0.15) 100%) !important;
}

/* Total Spend - Soft Red/Coral */
.stat-content[style*="rgba(255, 111, 97"],
.metric-content.spend-bg {
  background: linear-gradient(135deg,
      rgba(255, 235, 235, 0.5) 0%,
      rgba(255, 235, 235, 0.2) 100%) !important;
}

/* Potential Savings - Soft Green/Emerald */
.stat-content[style*="rgba(80, 200, 120"],
.metric-content.savings-bg {
  background: linear-gradient(135deg,
      rgba(220, 252, 231, 0.5) 0%,
      rgba(220, 252, 231, 0.2) 100%) !important;
}

/* Combined Balance - Soft Blue/Cerulean */
.stat-content[style*="rgba(0, 158, 217"],
.metric-content.balance-bg {
  background: linear-gradient(135deg,
      rgba(224, 242, 254, 0.5) 0%,
      rgba(224, 242, 254, 0.2) 100%) !important;
}

/* Icon Colors (stronger, more saturated) */
.stat-icon[style*="#FFD700"],
.metric-icon.income-icon {
  color: #F59E0B !important;
  /* Stronger gold/amber */
}

.stat-icon[style*="#FF6F61"],
.metric-icon.spend-icon {
  color: #EF4444 !important;
  /* Stronger red */
}

.stat-icon[style*="#50C878"],
.metric-icon.savings-icon {
  color: #10B981 !important;
  /* Stronger green */
}

.stat-icon[style*="#009ED9"],
.metric-icon.balance-icon {
  color: #3B82F6 !important;
  /* Stronger blue */
}

/* Remove any gradient overlays */
.stat-content::before,
.metric-content::before {
  display: none !important;
}

/* Ensure proper spacing and alignment */
.stat-content,
.metric-content {
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.08),
    0 1px 2px rgba(0, 0, 0, 0.06) !important;
}

/* Responsive adjustments */
@media (max-width: 767px) {

  .stat-value,
  .metric-value {
    font-size: 32px !important;
  }

  .stat-label,
  .metric-label {
    font-size: 13px !important;
  }
}

@media (min-width: 1440px) {

  .stat-value,
  .metric-value {
    font-size: 40px !important;
  }

  .stat-label,
  .metric-label {
    font-size: 15px !important;
  }
}