/* ==========================================================================
   UI/UX Improvements - SmartPC
   Améliorations esthétiques et expérience utilisateur
   ========================================================================== */

/* 1. Scroll Progress Indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #3B82F6, #8B5CF6, #EC4899);
  z-index: 99999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* 2. Ripple Effect on Buttons */
.ripple {
  position: relative;
  overflow: hidden;
}

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

.ripple:active::before {
  width: 300px;
  height: 300px;
}

/* 3. Enhanced Focus States for Accessibility */
*:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
  border-radius: 4px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 3px;
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #3B82F6;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* 4. Smooth Scroll Behavior */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

/* 5. Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 6. Toast Notifications */
.toast-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 400px;
}

.toast {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: toastSlideIn 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
}

.toast.success {
  background: rgba(34, 197, 94, 0.95);
  color: white;
}

.toast.error {
  background: rgba(239, 68, 68, 0.95);
  color: white;
}

.toast.info {
  background: rgba(59, 130, 246, 0.95);
  color: white;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.fade-out {
  animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(400px);
    opacity: 0;
  }
}

/* 7. Enhanced Card Hover Effects */
.enhanced-card {
  position: relative;
  overflow: hidden;
}

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

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

/* 8. Floating Action Button (FAB) for Mobile */
.fab {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
  z-index: 9999;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: none;
}

.fab:hover {
  transform: scale(1.1) translateY(-4px);
  box-shadow: 0 12px 28px rgba(59, 130, 246, 0.5);
}

.fab:active {
  transform: scale(0.95);
}

@media (min-width: 768px) {
  .fab {
    display: none;
  }
}

/* 9. Skeleton Loading */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
}

.dark .skeleton {
  background: linear-gradient(90deg, #2a2a2a 25%, #1a1a1a 50%, #2a2a2a 75%);
  background-size: 200% 100%;
}

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

/* 10. Enhanced Input Fields with Floating Labels */
.input-group {
  position: relative;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label,
.input-group textarea:focus + label,
.input-group textarea:not(:placeholder-shown) + label {
  transform: translateY(-1.5rem) scale(0.85);
  color: #3B82F6;
}

.input-group label {
  position: absolute;
  left: 1.25rem;
  top: 1rem;
  color: #6b7280;
  pointer-events: none;
  transition: all 0.2s ease;
  background: white;
  padding: 0 0.25rem;
}

.dark .input-group label {
  background: #1A1A1A;
  color: #9ca3af;
}

/* 11. Pulse Animation for Important Elements */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
  }
  50% {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.8);
  }
}

/* 12. Smooth Page Transitions */
.page-transition {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-transition.loaded {
  opacity: 1;
  transform: translateY(0);
}

/* 13. Enhanced Service Cards */
.service-card-enhanced {
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-card-enhanced::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.service-card-enhanced:hover::after {
  opacity: 1;
}

/* 14. Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #8B5CF6);
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  z-index: 9998;
  cursor: pointer;
  transition: all 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
}

.back-to-top.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
}

@media (max-width: 767px) {
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
}

/* 15. Enhanced Navigation Active State */
nav a.active {
  position: relative;
  color: #3B82F6;
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3B82F6, #8B5CF6);
  border-radius: 2px;
}

/* 16. Smooth Image Loading */
img {
  opacity: 0;
  transition: opacity 0.3s ease;
}

img.loaded {
  opacity: 1;
}

/* 17. Enhanced Form Validation States */
.input-error {
  border-color: #EF4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.input-success {
  border-color: #22C55E !important;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1) !important;
}

.input-error + .error-message {
  display: block;
  color: #EF4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.error-message {
  display: none;
}

/* 18. Parallax Effect for Hero Section */
.parallax-container {
  position: relative;
  overflow: hidden;
}

.parallax-element {
  transition: transform 0.3s ease-out;
}

/* 19. Enhanced Button States */
.btn-enhanced {
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.btn-enhanced:active {
  transform: scale(0.98);
}

/* 20. Smooth Section Transitions */
.section-transition {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.section-transition.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 21. Enhanced Mobile Menu Animation */
.mobile-menu-enhanced {
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-enhanced.open {
  transform: translateX(0);
}

/* 22. Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.loading-overlay.active {
  display: flex;
}

/* 23. Enhanced Tooltips */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* 24. Enhanced Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3B82F6, #8B5CF6);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #2563EB, #7C3AED);
}

.dark ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #60A5FA, #A78BFA);
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #3B82F6, #8B5CF6);
}

/* 25. Enhanced Contact Cards Hover */
.contact-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: inherit;
}

.contact-card:hover {
  transform: translateY(-8px) scale(1.02);
  text-decoration: none;
}

.contact-card:active {
  transform: translateY(-4px) scale(0.98);
}

.contact-card.no-underline,
.contact-card.no-underline:hover,
.contact-card.no-underline:active,
.contact-card.no-underline:focus {
  text-decoration: none !important;
}

/* 26. Smooth Number Counter Animation */
.counter {
  transition: all 0.3s ease;
}

/* 27. Enhanced Newsletter Form */
.newsletter-form-enhanced input:focus {
  transform: scale(1.02);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* 28. Gradient Text Animation */
.gradient-text-animated {
  background: linear-gradient(90deg, #3B82F6, #8B5CF6, #EC4899, #3B82F6);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 3s ease infinite;
}

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

/* 29. Enhanced Service Navigation Buttons */
.services-nav-btn-enhanced {
  position: relative;
  overflow: hidden;
}

.services-nav-btn-enhanced::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 ease;
}

.services-nav-btn-enhanced:hover::before {
  left: 100%;
}

/* 30. Enhanced Modal/Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
}

.modal-content {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.dark .modal-content {
  background: #1A1A1A;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

