/* =========================================
   QUICK STATS DASHBOARD WIDGET
   ========================================= */

.quick-stats-widget {
  box-sizing: border-box;
  width: 92%;
  background: var(--panel-bg);
  border: var(--panel-border);
  border-radius: 16px;
  padding: 25px;
  margin: 20px auto 100px;
  max-width: 1200px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  animation: slideUpFade 0.8s ease-out 0.2s both;
}

@media (max-width: 480px) {
  .quick-stats-widget {
    padding: 15px; /* Reduced from 25px */
    margin: 15px 10px; /* Adds a small gap on the left/right of the widget */
    border-radius: 12px;
  }
}

/* Glowing border effect */
.quick-stats-widget::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-green));
  background-size: 200% 100%;
  animation: gradientShift 3s ease infinite;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.widget-title {
  font-family: var(--font-hud);
  font-size: 1.5rem;
  color: var(--neon-cyan);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.widget-title i {
  font-size: 1.3rem;
  animation: pulse 2s infinite;
}

.widget-refresh {
  background: rgba(0, 170, 255, 0.1);
  border: 1px solid var(--neon-cyan);
  color: var(--neon-cyan);
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-refresh:hover {
  background: rgba(0, 170, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 170, 255, 0.2);
}

.widget-refresh i.spinning {
  animation: spin 1s linear infinite;
}

.widget-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-card:hover {
  transform: translateY(-5px);
  border-color: var(--neon-cyan);
  box-shadow: 0 8px 25px rgba(0, 170, 255, 0.15);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.02), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.stat-icon {
  width: 50px;
  height: 50px;
  background: rgba(0, 170, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 15px;
  font-size: 1.5rem;
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 170, 255, 0.2);
}

.stat-card:nth-child(2) .stat-icon {
  color: var(--neon-green);
  background: rgba(10, 255, 96, 0.1);
  border-color: rgba(10, 255, 96, 0.2);
}

.stat-card:nth-child(3) .stat-icon {
  color: var(--neon-purple);
  background: rgba(188, 19, 254, 0.1);
  border-color: rgba(188, 19, 254, 0.2);
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  font-family: var(--font-hud);
  color: var(--text-main);
  margin: 0 0 5px 0;
  line-height: 1;
  text-shadow: 0 0 10px rgba(0, 170, 255, 0.3);
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-trend {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  margin-top: 10px;
}

.trend-up {
  color: var(--neon-green);
}

.trend-down {
  color: var(--neon-red);
}

.trend-neutral {
  color: var(--text-dim);
}

/* Recent Activity Section */
.recent-activity {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
}

.activity-title {
  font-size: 1.1rem;
  color: var(--text-main);
  margin: 0 0 15px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.activity-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.activity-item:hover {
  background: rgba(0, 170, 255, 0.05);
  padding-left: 15px;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 35px;
  height: 35px;
  background: rgba(0, 170, 255, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--neon-cyan);
  flex-shrink: 0;
}

.activity-content {
  flex: 1;
}

.activity-content p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-main);
}

.activity-time {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 3px;
}

.no-activity {
  text-align: center;
  color: var(--text-dim);
  font-style: italic;
  padding: 20px;
  font-size: 0.9rem;
}

/* Empty state animation */
.stat-card.empty {
  animation: pulse-empty 2s infinite;
}

@keyframes pulse-empty {
  0%,
  100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* Loading animation */
.loading-shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 25%,
    rgba(255, 255, 255, 0.08) 50%,
    rgba(255, 255, 255, 0.03) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

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

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive Design */
@media (max-width: 768px) {
  .quick-stats-widget {
    margin: 20px;
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

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

  .widget-title {
    font-size: 1.3rem;
  }
}

@media (max-width: 480px) {
  .widget-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .widget-refresh {
    align-self: stretch;
    justify-content: center;
  }
}
