/* 
    Shared Dashboard Styles - Centralized CSS for all dashboards
    
    This file contains all common styling that's shared across:
    - dashboard-overview.njk
    - dashboard-contributions.njk
    - dashboard-activity.njk
    - Any future dashboard implementations
    
    Moved from individual dashboard files to eliminate duplication.
*/

/* ========================================
   Typography & Basic Layout
   ======================================== */

.dashboard-enhanced {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

.dashboard-enhanced h2 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}

/* ========================================
   Card Animations & Transforms
   ======================================== */

/* Base card transitions */
.card {
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--color-rosie-pink-border-hover) !important;
  transition: border-color 0.3s ease;
}

/* Dashboard link card hover effects */
.dashboard-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.dashboard-link .card-body {
  min-height: 120px;
}

/* Rate cards and status cards */
.rate-card,
.border-secondary,
.border-success {
  transition: all 0.3s ease;
}

.rate-card:hover,
.border-secondary:hover,
.border-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* ========================================
   Data Update Animations
   ======================================== */

/* Loading state animation for data updates */
.data-updating {
  opacity: 0.7;
  transform: scale(0.98);
  transition: all 0.2s ease;
}

/* Data refresh completion animation */
.data-updated {
  animation: dataRefresh 0.4s ease;
}

@keyframes dataRefresh {
  0% {
    opacity: 0.7;
    transform: scale(0.98);
  }
  50% {
    opacity: 1;
    transform: scale(1.02);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* KPI value highlight animation (from dashboard.css) */
@keyframes highlight-change {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

.highlight-change {
  animation: highlight-change 0.6s ease-in-out;
}

/* ========================================
   Leaderboard & Container Fixes
   ======================================== */

/* Leaderboard container fixes - minimal approach */
/* Ensure leaderboard stays properly contained without affecting other cards */
.card-body div[style*="overflow-y: auto"] {
  /* Use isolation instead of high z-index to prevent stacking issues */
  isolation: isolate;
}

/* ========================================
   Chart & Mini Chart Styling
   ======================================== */

/* Mini chart container */
.mini-chart-container {
  position: relative;
  height: 80px;
  margin: 10px 0;
}

/* Small chart container */
.small-chart-container {
  position: relative;
  height: 120px;
  margin: 15px 0;
}

/* Medium chart container */
.medium-chart-container {
  position: relative;
  height: 180px;
  margin: 20px 0;
}

#miniContribChart,
#miniActivityChart,
#miniLicensingChart,
#activityPageMiniChart {
  max-width: 100%;
  height: auto !important;
}

/* Canvas styling for responsive charts */
.mini-chart-container canvas,
.small-chart-container canvas,
.medium-chart-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

/* ========================================
   Status & Message Styling
   ======================================== */

/* User status message styling */
.user-status-message {
  border-radius: 8px;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Account balance progress styling */
.balance-progress-container {
  position: relative;
  margin: 10px 0;
}

/* ========================================
   KPI Specific Animations & Effects
   ======================================== */

/* KPI value transition effects to highlight changes */
.card-body .fw-bold {
  transition: all 0.3s ease-in-out;
}

.card-body .fw-bold:hover {
  text-shadow: 0 0 1px currentColor;
}

/* ========================================
   Rosie Hover Effects - Centralized
   ======================================== */

/* Primary rosie hover effects for main cards */
.mini-chart-contributions:hover,
.card.border-primary:hover,
.card.border-warning:hover {
  border-color: var(--color-rosie-pink-border-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(231, 84, 128, 0.15);
}

/* Ensure smooth transitions for all cards */
.card,
.kpi-contributions,
.kpi-rank,
.kpi-roc,
.kpi-section-card,
.mini-chart-contributions {
  transition: all 0.3s ease !important;
}

/* Table row hover effects with rosie accents */
.contributions-table tbody tr:hover,
.leaderboard-table tbody tr:hover {
  transform: translateX(2px);
  transition: all 0.2s ease;
}

/* Button and interactive element rosie hover effects */
.btn:hover {
  border-color: var(--color-rosie-pink-border-hover) !important;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background-color: var(--color-rosie-pink-hover) !important;
  border-color: var(--color-rosie-pink-border-hover) !important;
  color: white !important;
}

/* Moved from dashboard.css */
.ribbon {
  width: 120px;
  height: 120px;
  overflow: hidden;
  position: absolute;
  top: -10px;
  right: -10px;
  pointer-events: none;
}
.ribbon span {
  position: absolute;
  display: block;
  width: 160px;
  padding: 8px 0;
  background: rgba(255, 193, 7, 0.85);
  color: #000;
  text-align: center;
  font-weight: bold;
  transform: rotate(45deg);
  top: 20px;
  right: -40px;
  font-size: 0.9rem;
}

/* Dashboard Rosie Hover Effects */
.card a:hover {
  color: var(--color-rosie-pink-hover) !important;
  transition: color 0.3s ease;
}
