/* =============================================
   DASHBOARD MULTIMEDIA STYLES
   Estilos modernos para componentes de visualización
   ============================================= */

/* =============================================
   1. ANIMATED STATS CARDS
   ============================================= */
.stats-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.stats-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-color);
  opacity: 0.8;
}

.stats-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
  border-color: var(--card-color);
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.stats-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.stats-trend {
  font-size: 14px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stats-trend.trend-up {
  background: rgba(46, 213, 115, 0.15);
  color: #2ed573;
}

.stats-trend.trend-down {
  background: rgba(255, 71, 87, 0.15);
  color: #ff4757;
}

.stats-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stats-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stats-value {
  font-size: 36px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stats-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--card-color), var(--accent-2));
  border-radius: 4px;
  transition: width 0.3s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::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 infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.stats-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.stats-target {
  font-weight: 600;
  color: var(--text);
}

/* =============================================
   2. ACTIVITY FEED
   ============================================= */
.activity-feed {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.feed-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.feed-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.pulse-indicator {
  width: 12px;
  height: 12px;
  background: #2ed573;
  border-radius: 50%;
  position: relative;
  animation: pulse 2s infinite;
}

.pulse-indicator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  background: #2ed573;
  border-radius: 50%;
  animation: pulse-ring 2s infinite;
}

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

@keyframes pulse-ring {
  0% {
    width: 100%;
    height: 100%;
    opacity: 1;
  }
  100% {
    width: 200%;
    height: 200%;
    opacity: 0;
  }
}

.feed-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 400px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  border-left: 3px solid var(--item-color);
  transition: all 0.2s ease;
  animation: slideIn 0.3s ease;
}

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

.feed-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

.feed-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.feed-content {
  flex: 1;
  min-width: 0;
}

.feed-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.feed-description {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.feed-time {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* =============================================
   3. GAUGE CHART
   ============================================= */
.gauge-chart {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.gauge-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}

.gauge-svg {
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.gauge-value {
  transition: stroke-dashoffset 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.gauge-needle {
  transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.gauge-value-display {
  margin: 20px 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
}

.gauge-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gauge-unit {
  font-size: 20px;
  font-weight: 500;
  color: var(--muted);
}

.gauge-legend {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* =============================================
   4. TIMELINE CHART
   ============================================= */
.timeline-chart {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.timeline-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 24px 0;
}

.timeline-container {
  position: relative;
  padding-left: 40px;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 16px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent-1), var(--accent-2));
  opacity: 0.3;
}

.timeline-item {
  position: relative;
  padding-bottom: 32px;
  animation: fadeInUp 0.5s ease both;
}

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

.timeline-marker {
  position: absolute;
  left: -32px;
  top: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: 0 0 0 4px var(--card-bg);
  z-index: 1;
}

.timeline-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  transition: all 0.2s ease;
}

.timeline-content:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(4px);
}

.timeline-time {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}

.timeline-event-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.timeline-event-desc {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* =============================================
   5. HEATMAP CALENDAR
   ============================================= */
.heatmap-calendar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(10px);
}

.heatmap-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 20px 0;
}

.heatmap-grid {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 10px 0;
}

.heatmap-week {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.heatmap-day {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.heatmap-day:hover {
  transform: scale(1.5);
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.heatmap-day:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  margin-bottom: 8px;
  z-index: 100;
  pointer-events: none;
}

.heatmap-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 12px;
  color: var(--muted);
  justify-content: flex-end;
}

.legend-box {
  width: 12px;
  height: 12px;
  border-radius: 2px;
}

/* =============================================
   RESPONSIVE DESIGN
   ============================================= */
@media (max-width: 768px) {
  .stats-card {
    padding: 16px;
  }
  
  .stats-value {
    font-size: 28px;
  }
  
  .gauge-number {
    font-size: 36px;
  }
  
  .timeline-container {
    padding-left: 32px;
  }
  
  .timeline-marker {
    width: 24px;
    height: 24px;
    left: -28px;
    font-size: 12px;
  }
  
  .heatmap-day {
    width: 10px;
    height: 10px;
  }
}

/* =============================================
   DARK MODE ADJUSTMENTS
   ============================================= */
html.theme-dark .stats-card,
html.theme-dark .activity-feed,
html.theme-dark .gauge-chart,
html.theme-dark .timeline-chart,
html.theme-dark .heatmap-calendar {
  background: rgba(16, 18, 40, 0.8);
}

html.theme-dark .feed-item,
html.theme-dark .timeline-content {
  background: rgba(255, 255, 255, 0.05);
}

html.theme-dark .feed-item:hover,
html.theme-dark .timeline-content:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* =============================================
   ANIMATIONS & TRANSITIONS
   ============================================= */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(102, 126, 234, 0.6);
  }
}

.stats-card:hover::before {
  animation: glow 2s infinite;
}

/* Smooth scrollbar para feeds */
.feed-list::-webkit-scrollbar {
  width: 6px;
}

.feed-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

.feed-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.feed-list::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
