/* Dashboard Modern Enhancements - Overlays on existing design */

/* Enhanced color variables */
:root {
  --modern-gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --modern-gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --modern-gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --modern-gradient-4: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
  --glow-effect: 0 0 30px rgba(102, 126, 234, 0.4);
  --float-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

/* Dark theme enhancements */
body.dashboard-page {
  background: #0f0f1e;
  position: relative;
}

body.dashboard-page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(102, 126, 234, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(79, 172, 254, 0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.dashboard-main {
  position: relative;
  z-index: 1;
}

/* Enhanced Hero Section */
.hero-section {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: slideInDown 0.8s ease-out;
  overflow: hidden;
  position: relative;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: var(--modern-gradient-1);
  opacity: 0.1;
  transform: rotate(-45deg);
  pointer-events: none;
}

.hero-content h1 {
  background: var(--modern-gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeInUp 0.8s ease-out;
}

.user-name {
  background: var(--modern-gradient-4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.generate-workout-btn {
  background: var(--modern-gradient-1);
  box-shadow: var(--glow-effect);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.generate-workout-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.generate-workout-btn:hover {
  transform: translateY(-3px);
  box-shadow: var(--glow-effect), 0 10px 40px rgba(102, 126, 234, 0.3);
}

.generate-workout-btn:hover::before {
  width: 300px;
  height: 300px;
}

/* Enhanced Stats Cards */
.stat-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  animation: fadeInUp 0.8s ease-out;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--modern-gradient-1);
  opacity: 0;
  transition: opacity 0.3s;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--float-shadow);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.stat-icon {
  position: relative;
}

.stat-icon.streak {
  background: var(--modern-gradient-1);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.4);
}

.stat-icon.workouts {
  background: var(--modern-gradient-2);
  box-shadow: 0 0 20px rgba(240, 147, 251, 0.4);
}

.stat-icon.time {
  background: var(--modern-gradient-3);
  box-shadow: 0 0 20px rgba(79, 172, 254, 0.4);
}

.stat-icon.points {
  background: var(--modern-gradient-4);
  box-shadow: 0 0 20px rgba(67, 233, 123, 0.4);
}

.stat-value {
  background: var(--modern-gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
  transition: transform 0.3s ease;
}

.stat-card:hover .stat-value {
  transform: scale(1.05);
}

/* Enhanced Progress Bars */
.progress-bar {
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  background: var(--modern-gradient-1);
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  animation: shimmer 2s infinite;
}

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

/* Enhanced Personality Prompt */
.personality-prompt-section {
  animation: slideIn 0.5s ease-out;
}

.personality-prompt-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.prompt-icon {
  background: var(--modern-gradient-3);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-primary {
  background: var(--modern-gradient-3);
  box-shadow: 0 0 20px rgba(79, 172, 254, 0.3);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(79, 172, 254, 0.4);
}

/* Enhanced Day Cards */
.day-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.day-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modern-gradient-1);
  opacity: 0;
  transition: opacity 0.3s;
}

.day-card:hover {
  transform: translateY(-5px);
  border-color: rgba(255, 255, 255, 0.2);
}

.day-card:hover::before {
  opacity: 0.05;
}

.today-badge {
  background: var(--modern-gradient-4);
  box-shadow: 0 4px 12px rgba(67, 233, 123, 0.4);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Enhanced Muscle Groups */
.muscle-visualization {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.muscle-group {
  transition: all 0.3s ease;
  cursor: pointer;
}

.muscle-group:hover {
  filter: brightness(1.3) drop-shadow(0 0 10px currentColor);
  transform: scale(1.05);
}

.muscle-label {
  fill: white !important;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Enhanced Legend */
.muscle-legend {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.legend-item {
  transition: all 0.3s ease;
  padding: 10px;
  border-radius: 10px;
}

.legend-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
}

.legend-text {
  color: white !important;
}

/* Enhanced Coach Cards */
.coach-content-wrapper {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.coach-content-wrapper::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: var(--modern-gradient-1);
  opacity: 0.05;
  transform: rotate(45deg);
  pointer-events: none;
}

.coach-content-wrapper:hover {
  transform: translateY(-5px);
  box-shadow: var(--float-shadow);
}

/* Enhanced Quick Links */
.link-card {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.link-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--modern-gradient-1);
  opacity: 0;
  transition: opacity 0.3s;
}

.link-card:hover {
  transform: translateY(-10px);
  border-color: rgba(255, 255, 255, 0.2);
}

.link-card:hover::before {
  opacity: 0.1;
}

.link-icon-wrapper.workout-history {
  background: var(--modern-gradient-1);
}

.link-icon-wrapper.challenges {
  background: var(--modern-gradient-2);
}

.link-icon-wrapper.leaderboard {
  background: var(--modern-gradient-4);
}

.link-button {
  background: var(--modern-gradient-1);
  transition: all 0.3s ease;
}

.link-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--glow-effect);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

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

/* Notification Styles */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 16px 24px;
  border-radius: 12px;
  color: white;
  font-weight: 500;
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 1000;
}

.notification.show {
  transform: translateX(0);
}

.notification.success {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.2);
}

.notification.error {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.2);
}

.notification.info {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.2);
}

/* Achievement Unlock Animation */
.achievement-unlock {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px 40px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(102, 126, 234, 0.4);
  text-align: center;
  animation: achievementPop 0.5s ease-out forwards;
  z-index: 1000;
}

.achievement-unlock.fade-out {
  animation: achievementFade 0.5s ease-out forwards;
}

@keyframes achievementPop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes achievementFade {
  to {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
}

.achievement-icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

/* Weather Widget */
.weather-widget {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 15px;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  animation: slideIn 0.8s ease-out;
}

.weather-icon {
  font-size: 2rem;
}

.weather-temp {
  font-size: 1.5rem;
  font-weight: 600;
}

.weather-condition {
  font-size: 0.9rem;
  opacity: 0.8;
}

.weather-tip {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-top: 5px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease-out;
}

.modal-content {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 30px;
  max-width: 500px;
  width: 90%;
  animation: slideInUp 0.3s ease-out;
}

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

.modal-header h3 {
  color: white;
  font-size: 1.5rem;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.modal-close:hover {
  transform: rotate(90deg);
}

/* Ripple Effect */
.ripple {
  position: fixed;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: rippleExpand 1s ease-out;
}

@keyframes rippleExpand {
  from {
    width: 0;
    height: 0;
    opacity: 1;
  }
  to {
    width: 500px;
    height: 500px;
    opacity: 0;
  }
}

/* Voice Status */
#voiceStatus {
  display: none;
  margin-left: 10px;
  color: #10b981;
  font-weight: 500;
  animation: pulse 1.5s infinite;
}

/* Mobile Enhancements */
@media (max-width: 768px) {
  .weather-widget {
    position: relative;
    top: auto;
    right: auto;
    margin-bottom: 20px;
  }
  
  .notification {
    right: 10px;
    left: 10px;
    transform: translateY(-100px);
  }
  
  .notification.show {
    transform: translateY(0);
  }
}

/* Add smooth transitions to existing elements */
* {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

/* Text color adjustments for dark theme */
h1, h2, h3, h4, h5, h6 {
  color: white;
}

p, span {
  color: rgba(255, 255, 255, 0.8);
}

.section-header h2 {
  color: white;
}

/* Save Schedule Button Enhancement */
.save-schedule-btn {
  background: var(--modern-gradient-1);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
  transition: all 0.3s ease;
}

.save-schedule-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(102, 126, 234, 0.4);
}

/* Edit Button Enhancements */
.edit-button {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.edit-button:hover {
  background: var(--modern-gradient-3);
  transform: rotate(90deg);
}

.edit-btn {
  background: var(--modern-gradient-3);
  transition: all 0.3s ease;
}

.edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}