
/* Modern Components CSS - Crunevo 2.0 */

/* ============================================
   MODERN CARDS & LAYOUTS
   ============================================ */

.modern-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  position: relative;
}

.modern-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.modern-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

[data-bs-theme="dark"] .modern-card {
  background: rgba(30, 30, 46, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* ============================================
   MODERN BUTTONS
   ============================================ */

.btn-modern {
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  border: none;
  text-transform: none;
  letter-spacing: 0.025em;
}

.btn-modern::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.btn-modern:hover::before {
  left: 100%;
}

.btn-modern:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.btn-modern:active {
  transform: translateY(0);
}

.btn-modern-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-modern-primary:hover {
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  color: white;
}

.btn-modern-secondary {
  background: linear-gradient(135deg, #6b73ff 0%, #9c88ff 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(107, 115, 255, 0.3);
}

.btn-modern-outline {
  background: transparent;
  border: 2px solid #667eea;
  color: #667eea;
}

.btn-modern-outline:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

/* ============================================
   MODERN FORMS
   ============================================ */

.form-modern {
  position: relative;
}

.form-modern .form-control {
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  padding: 1rem 1.25rem;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-modern .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 0.25rem rgba(102, 126, 234, 0.15);
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

[data-bs-theme="dark"] .form-modern .form-control {
  background: rgba(30, 30, 46, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
  color: #f8f9fa;
}

[data-bs-theme="dark"] .form-modern .form-control:focus {
  background: rgba(30, 30, 46, 0.9);
  border-color: #667eea;
}

/* Floating labels modern style */
.form-floating-modern {
  position: relative;
}

.form-floating-modern .form-control {
  height: 3.5rem;
  padding: 1rem 1.25rem 0.5rem;
}

.form-floating-modern label {
  position: absolute;
  top: 0;
  left: 1.25rem;
  height: 100%;
  padding: 1rem 0;
  pointer-events: none;
  border: none;
  transform-origin: 0 0;
  transition: all 0.2s ease-in-out;
  color: #6c757d;
  font-weight: 500;
}

.form-floating-modern .form-control:focus ~ label,
.form-floating-modern .form-control:not(:placeholder-shown) ~ label {
  opacity: 0.85;
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
  color: #667eea;
}

/* ============================================
   MODERN AVATARS & PROFILES
   ============================================ */

.avatar-modern {
  position: relative;
  display: inline-block;
}

.avatar-modern img {
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.avatar-modern:hover img {
  border-color: #667eea;
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.avatar-modern .status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 1rem;
  height: 1rem;
  background: #10b981;
  border: 2px solid white;
  border-radius: 50%;
}

[data-bs-theme="dark"] .avatar-modern .status-indicator {
  border-color: #1e1e2e;
}

/* ============================================
   MODERN BADGES & TAGS
   ============================================ */

.badge-modern {
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.5rem 0.75rem;
  letter-spacing: 0.025em;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.badge-modern-success {
  background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
}

.badge-modern-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.badge-modern-danger {
  background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
}

/* ============================================
   MODERN NAVIGATION TABS
   ============================================ */

.nav-modern {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 0.5rem;
  gap: 0.25rem;
}

.nav-modern .nav-link {
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: all 0.3s ease;
  border: none;
  background: transparent;
}

.nav-modern .nav-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.nav-modern .nav-link.active {
  color: white;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

[data-bs-theme="dark"] .nav-modern {
  background: rgba(30, 30, 46, 0.5);
}

/* ============================================
   MODERN PROGRESS BARS
   ============================================ */

.progress-modern {
  height: 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.progress-modern .progress-bar {
  border-radius: 20px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  position: relative;
  overflow: hidden;
}

.progress-modern .progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, .2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, .2) 50%,
    rgba(255, 255, 255, .2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 1rem 1rem;
  animation: progress-animation 1s linear infinite;
}

@keyframes progress-animation {
  0% {
    background-position: 1rem 0;
  }
  100% {
    background-position: 0 0;
  }
}

/* ============================================
   MODERN TOOLTIPS & POPOVERS
   ============================================ */

.tooltip-modern .tooltip-inner {
  background: rgba(30, 30, 46, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.tooltip-modern .tooltip-arrow::before {
  border-top-color: rgba(30, 30, 46, 0.95);
}

/* ============================================
   MODERN ALERTS
   ============================================ */

.alert-modern {
  border-radius: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  padding: 1.25rem 1.5rem;
}

[data-bs-theme="dark"] .alert-modern {
  background: rgba(30, 30, 46, 0.9);
}

.alert-modern-primary {
  border-left: 4px solid #667eea;
  color: #667eea;
}

.alert-modern-success {
  border-left: 4px solid #10b981;
  color: #10b981;
}

.alert-modern-warning {
  border-left: 4px solid #f59e0b;
  color: #f59e0b;
}

.alert-modern-danger {
  border-left: 4px solid #ef4444;
  color: #ef4444;
}

/* ============================================
   MODERN LOADING STATES
   ============================================ */

.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

[data-bs-theme="dark"] .loading-shimmer {
  background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
  background-size: 200% 100%;
}

.spinner-modern {
  width: 2rem;
  height: 2rem;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-radius: 50%;
  border-top-color: #8B5CF6;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   MISSION COMPLETION ANIMATIONS
   ============================================ */

.mission-complete-animation {
  position: relative;
  overflow: hidden;
}

.confetti-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 100;
}

.confetti-piece {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #8B5CF6;
  animation: confettiFall 3s linear infinite;
}

.confetti-piece:nth-child(odd) {
  background: #F59E0B;
  animation-delay: 0.5s;
}

.confetti-piece:nth-child(3n) {
  background: #10B981;
  animation-delay: 1s;
}

.confetti-piece:nth-child(4n) {
  background: #EF4444;
  animation-delay: 1.5s;
}

@keyframes confettiFall {
  0% {
    transform: translateY(-100vh) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

.reward-claim-btn {
  background: linear-gradient(135deg, #10B981, #059669);
  color: white;
  border: none;
  border-radius: 16px;
  padding: 12px 24px;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.reward-claim-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.3s ease;
}

.reward-claim-btn:hover::before {
  width: 300px;
  height: 300px;
}

.reward-claim-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.reward-claim-btn:active {
  transform: translateY(0);
}

.reward-claim-btn.claimed {
  background: var(--crunevo-gray-400);
  cursor: not-allowed;
}

.reward-claim-btn.claimed:hover {
  transform: none;
  box-shadow: none;
}

/* ============================================
   ENHANCED TOOLTIPS
   ============================================ */

.tooltip-enhanced {
  position: relative;
  cursor: help;
}

.tooltip-enhanced::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(17, 24, 39, 0.95);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.tooltip-enhanced::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  border: 6px solid transparent;
  border-top-color: rgba(17, 24, 39, 0.95);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tooltip-enhanced:hover::before,
.tooltip-enhanced:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px);
}

/* ============================================
   SCROLL TO TOP BUTTON
   ============================================ */

.scroll-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #8B5CF6, #9F7AEA);
  color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  z-index: 1055;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.scroll-to-top:active {
  transform: translateY(0);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 90px;
  }
}

/* ============================================
   ENHANCED NOTIFICATION TOASTS
   ============================================ */

.toast-notification {
  background: white;
  border: none;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px);
  border-left: 4px solid var(--crunevo-primary);
  overflow: hidden;
  position: relative;
}

.toast-notification::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #8B5CF6, #9F7AEA);
  animation: toastProgress 5s linear;
}

@keyframes toastProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.toast-notification.success {
  border-left-color: #10B981;
}

.toast-notification.success::before {
  background: linear-gradient(90deg, #10B981, #059669);
}

.toast-notification.warning {
  border-left-color: #F59E0B;
}

.toast-notification.warning::before {
  background: linear-gradient(90deg, #F59E0B, #EAB308);
}

.toast-notification.error {
  border-left-color: #EF4444;
}

.toast-notification.error::before {
  background: linear-gradient(90deg, #EF4444, #DC2626);
}

[data-bs-theme="dark"] .toast-notification {
  background: rgba(30, 30, 46, 0.95);
  color: #f8f9fa;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
  .modern-card {
    border-radius: 16px;
    margin-bottom: 1rem;
  }
  
  .btn-modern {
    font-size: 0.9rem;
    padding: 0.65rem 1.25rem;
  }
  
  .form-modern .form-control {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  
  .nav-modern {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .nav-modern::-webkit-scrollbar {
    display: none;
  }
}

/* ============================================
   ACCESSIBILITY ENHANCEMENTS
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .modern-card,
  .btn-modern,
  .form-modern .form-control,
  .avatar-modern img,
  .nav-modern .nav-link {
    transition: none;
  }
  
  .progress-modern .progress-bar::after {
    animation: none;
  }
  
  .loading-shimmer {
    animation: none;
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
