/* 2MGEN AI University - Custom Styles */

/* 2MGEN Brand Colors */
:root {
  --2mgen-blue: #1E3A8A;
  --2mgen-orange: #F97316;
  --2mgen-dark: #1F2937;
  --2mgen-gray: #6B7280;
}

/* Global Styles */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
}

/* Custom Animations */
@keyframes pulse-glow {
  0%, 100% { 
    box-shadow: 0 0 5px rgba(249, 115, 22, 0.5);
  }
  50% { 
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.8), 0 0 30px rgba(249, 115, 22, 0.3);
  }
}

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

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* Gamification Elements */
.level-badge {
  background: linear-gradient(135deg, var(--2mgen-orange), #fbbf24);
  animation: pulse-glow 2s infinite;
}

.skill-bar-container {
  position: relative;
  background: rgba(75, 85, 99, 0.3);
  border-radius: 10px;
  overflow: hidden;
  height: 8px;
}

.skill-bar {
  background: linear-gradient(90deg, var(--2mgen-orange), #fbbf24);
  height: 100%;
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.skill-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Module Cards */
.module-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.1), transparent);
  transition: left 0.5s;
}

.module-card:hover::before {
  left: 100%;
}

.module-card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 40px rgba(249, 115, 22, 0.3);
  border-color: rgba(249, 115, 22, 0.5);
}

.module-card.completed {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.5);
}

.module-card.locked {
  background: rgba(75, 85, 99, 0.1);
  border-color: rgba(75, 85, 99, 0.3);
  opacity: 0.6;
}

/* Achievement Badges */
.achievement-badge {
  background: linear-gradient(135deg, #fbbf24, var(--2mgen-orange));
  animation: float 3s ease-in-out infinite;
}

/* Caltrans Integration Styles */
.caltrans-standard {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  border-left: 4px solid #60a5fa;
  position: relative;
}

.caltrans-standard::before {
  content: '📋';
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 12px;
}

/* Safety Alert Styles */
.safety-alert {
  background: linear-gradient(135deg, #dc2626, #991b1b);
  border: 2px solid #f87171;
  animation: pulse 2s infinite;
}

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

/* Simulation Interface */
.simulation-container {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
  backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.utility-marker {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--2mgen-orange);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(249, 115, 22, 0.8);
  animation: pulse-glow 1.5s infinite;
}

/* Signal Strength Indicator */
.signal-bar {
  width: 8px;
  background: #374151;
  border-radius: 2px;
  transition: background-color 0.3s;
}

.signal-bar.active-1 { background: #dc2626; }
.signal-bar.active-2 { background: #ea580c; }
.signal-bar.active-3 { background: #d97706; }
.signal-bar.active-4 { background: #ca8a04; }
.signal-bar.active-5 { background: #65a30d; }

/* Google Workspace Integration Styles */
.google-signin-btn {
  background: #4285f4;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.3s;
  font-weight: 500;
}

.google-signin-btn:hover {
  background: #3367d6;
}

.google-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(249, 115, 22, 0.3);
}

/* Leaderboard Styles */
.leaderboard-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

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

.leaderboard-rank {
  background: linear-gradient(135deg, #fbbf24, var(--2mgen-orange));
  color: white;
  font-weight: bold;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.leaderboard-rank.top-3 {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  animation: pulse-glow 2s infinite;
}

/* Progress Indicators */
.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  stroke: rgba(75, 85, 99, 0.3);
  fill: transparent;
  stroke-width: 4;
  stroke-linecap: round;
}

.progress-ring-progress {
  stroke: var(--2mgen-orange);
  fill: transparent;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive Design */
@media (max-width: 768px) {
  .module-card {
    margin-bottom: 16px;
  }
  
  .skill-bar-container {
    height: 6px;
  }
  
  .simulation-container {
    padding: 16px;
  }
}

/* Dark Mode Enhancements */
@media (prefers-color-scheme: dark) {
  .module-card {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .leaderboard-item {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.05);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus indicators for keyboard navigation */
.module-card:focus,
.google-signin-btn:focus,
button:focus {
  outline: 2px solid var(--2mgen-orange);
  outline-offset: 2px;
}

/* Loading states */
.loading-spinner {
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top: 3px solid var(--2mgen-orange);
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

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

/* Notification styles */
.notification {
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 16px;
  border-radius: 8px;
  border-left: 4px solid var(--2mgen-orange);
  animation: slide-up 0.3s ease-out;
}

.notification.success {
  border-left-color: #10b981;
}

.notification.warning {
  border-left-color: #f59e0b;
}

.notification.error {
  border-left-color: #ef4444;
}