/* ==========================================
   HOMESTAGING PRO - STYLES PRINCIPAUX
   ========================================== */

/* Variables CSS */
:root {
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #7c3aed;
  --accent-color: #f59e0b;
  --success-color: #10b981;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* Reset et base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--gray-700);
  background-color: var(--gray-50);
}

/* Utilitaires */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ==========================================
   NAVIGATION
   ========================================== */

.nav-btn {
  display: flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  color: var(--gray-600);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: var(--primary-color);
  background-color: var(--gray-100);
}

.nav-btn.active {
  color: var(--primary-color);
  background-color: var(--gray-100);
  font-weight: 600;
}

.mobile-nav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1rem;
  color: var(--gray-600);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-nav-btn:hover,
.mobile-nav-btn.active {
  color: var(--primary-color);
  background-color: var(--gray-100);
}

.mobile-menu {
  transition: all 0.3s ease;
}

/* ==========================================
   SECTIONS
   ========================================== */

.section-content {
  display: none;
}

.section-content.active {
  display: block;
  animation: fadeIn 0.5s ease;
}

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

/* ==========================================
   COMPARAISONS AVANT/APRÈS
   ========================================== */

.comparison-container {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  cursor: col-resize;
}

@media (min-width: 768px) {
  .comparison-container {
    height: 500px;
  }
}

.comparison-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.comparison-before,
.comparison-after {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.comparison-before img,
.comparison-after img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comparison-after {
  clip-path: inset(0 50% 0 0);
  transition: clip-path 0.1s ease;
}

.comparison-slider {
  position: absolute;
  top: 0;
  left: 50%;
  width: 4px;
  height: 100%;
  background-color: white;
  cursor: col-resize;
  z-index: 10;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

.comparison-slider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.comparison-slider::after {
  content: '↔';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--primary-color);
  font-weight: bold;
  font-size: 12px;
}

.comparison-labels {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  z-index: 5;
}

.comparison-label {
  padding: 0.5rem 1rem;
  background-color: rgba(0,0,0,0.8);
  color: white;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
}

/* ==========================================
   VISITE VIRTUELLE
   ========================================== */

.virtual-tour-main {
  position: relative;
  background-color: var(--gray-900);
}

.hotspot {
  position: absolute;
  width: 20px;
  height: 20px;
  cursor: pointer;
  z-index: 10;
}

.hotspot-pulse {
  width: 100%;
  height: 100%;
  background-color: var(--primary-color);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.hotspot-label {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.75rem;
  background-color: rgba(0,0,0,0.8);
  color: white;
  border-radius: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.hotspot:hover .hotspot-label {
  opacity: 1;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.room-nav-btn {
  padding: 0.75rem 1.5rem;
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.room-nav-btn:hover {
  background-color: var(--gray-200);
}

.room-nav-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-dark);
}

/* ==========================================
   PLANS D'APPARTEMENT
   ========================================== */

.plan-mode-btn {
  padding: 0.5rem 1rem;
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 2px solid transparent;
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.plan-mode-btn:hover {
  background-color: var(--gray-200);
}

.plan-mode-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-dark);
}

#floor-plan-canvas {
  border: 2px solid var(--gray-200);
  border-radius: 0.5rem;
  background: linear-gradient(45deg, #f8f9fa 25%, transparent 25%),
              linear-gradient(-45deg, #f8f9fa 25%, transparent 25%),
              linear-gradient(45deg, transparent 75%, #f8f9fa 75%),
              linear-gradient(-45deg, transparent 75%, #f8f9fa 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.control-btn {
  padding: 0.5rem 1rem;
  background-color: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.control-btn:hover {
  background-color: var(--gray-200);
  border-color: var(--gray-400);
}

/* ==========================================
   ÉLÉMENTS INTERACTIFS
   ========================================== */

/* Boutons */
button {
  transition: all 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

/* Cartes */
.bg-white {
  transition: box-shadow 0.2s ease;
}

.bg-white:hover {
  box-shadow: var(--shadow-xl);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Mobile First - Styles pour petits écrans */
@media (max-width: 768px) {
  .comparison-container {
    height: 300px;
  }
  
  .comparison-labels {
    bottom: 10px;
    left: 10px;
    right: 10px;
  }
  
  .comparison-label {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .hotspot {
    width: 30px;
    height: 30px;
  }
  
  .hotspot-label {
    font-size: 0.875rem;
    top: -45px;
  }
  
  .room-nav-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* Tablettes */
@media (min-width: 768px) and (max-width: 1024px) {
  .comparison-container {
    height: 450px;
  }
}

/* Desktop */
@media (min-width: 1024px) {
  .comparison-container {
    height: 500px;
  }
  
  .hotspot:hover {
    transform: scale(1.1);
  }
}

/* ==========================================
   ANIMATIONS AVANCÉES
   ========================================== */

/* Animation de chargement */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s infinite;
}

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

/* Transitions fluides */
.smooth-transition {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Effets de survol */
.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

/* ==========================================
   ÉTATS DE FOCUS (Accessibilité)
   ========================================== */

button:focus,
.nav-btn:focus,
.room-nav-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ==========================================
   UTILITAIRES PERSONNALISÉS
   ========================================== */

.text-gradient {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.backdrop-blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.glass-effect {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ==========================================
   MODE SOMBRE (Optionnel)
   ========================================== */

@media (prefers-color-scheme: dark) {
  :root {
    --gray-50: #1f2937;
    --gray-100: #374151;
    --gray-900: #f9fafb;
  }
}

/* ==========================================
   ANIMATIONS AVANCÉES
   ========================================== */

/* Animations d'entrée */
@keyframes slideInFromBottom {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Application des animations */
.animate-in {
  animation: slideInFromBottom 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-in-left {
  animation: slideInFromLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-in-right {
  animation: slideInFromRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-scale {
  animation: scaleIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Délais d'animation pour un effet en cascade */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* Animations de chargement */
@keyframes shimmer {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

.loading-shimmer {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* Effet de morphing pour les transitions */
@keyframes morphBackground {
  0%, 100% {
    border-radius: 0.5rem;
    transform: scale(1);
  }
  50% {
    border-radius: 2rem;
    transform: scale(1.02);
  }
}

.morph-animation:hover {
  animation: morphBackground 0.8s ease-in-out;
}

/* Animation de particules pour le hero */
@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

.floating-element {
  animation: float 3s ease-in-out infinite;
}

/* Effet de typing pour les titres */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

.typing-effect {
  overflow: hidden;
  border-right: 2px solid var(--primary-color);
  white-space: nowrap;
  animation: typing 2s steps(40, end), blink 0.75s step-end infinite;
}

@keyframes blink {
  from, to { border-color: transparent; }
  50% { border-color: var(--primary-color); }
}

/* Animations pour les boutons */
@keyframes buttonPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

.btn-pulse:hover {
  animation: buttonPulse 1.5s infinite;
}

/* Transitions fluides pour les états */
.smooth-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.smooth-hover:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Animation de révélation progressive */
@keyframes progressiveReveal {
  from {
    clip-path: inset(0 100% 0 0);
  }
  to {
    clip-path: inset(0 0% 0 0);
  }
}

.progressive-reveal {
  animation: progressiveReveal 1s ease-out forwards;
}

/* Effets de particules CSS */
.particle-background::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 1px, transparent 1px);
  background-size: 50px 50px;
  animation: particleMove 20s linear infinite;
}

@keyframes particleMove {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 50px 50px;
  }
}

/* Transitions de page */
.page-transition-enter {
  opacity: 0;
  transform: translateX(100%);
}

.page-transition-enter-active {
  opacity: 1;
  transform: translateX(0);
  transition: all 0.5s ease-in-out;
}

.page-transition-exit {
  opacity: 1;
  transform: translateX(0);
}

.page-transition-exit-active {
  opacity: 0;
  transform: translateX(-100%);
  transition: all 0.5s ease-in-out;
}

/* Micro-animations pour l'interactivité */
@keyframes wiggle {
  0%, 7% { transform: rotateZ(0); }
  15% { transform: rotateZ(-15deg); }
  20% { transform: rotateZ(10deg); }
  25% { transform: rotateZ(-10deg); }
  30% { transform: rotateZ(6deg); }
  35% { transform: rotateZ(-4deg); }
  40%, 100% { transform: rotateZ(0); }
}

.wiggle-animation:hover {
  animation: wiggle 1s ease-in-out;
}

/* Préférences d'animation réduites */
@media (prefers-reduced-motion: reduce) {
  .reduce-motion *,
  .reduce-motion *:before,
  .reduce-motion *:after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================
   LOADING STATES
   ========================================== */

.skeleton-loading {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

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

/* État de chargement pour les images */
.image-loading {
  position: relative;
  overflow: hidden;
}

.image-loading::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, 
    rgba(255,255,255,0) 0%, 
    rgba(255,255,255,0.2) 20%, 
    rgba(255,255,255,0.5) 60%, 
    rgba(255,255,255,0)
  );
  animation: shimmer 2s infinite;
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
  .nav, .mobile-menu, .hotspot, .control-btn {
    display: none !important;
  }
  
  .comparison-container {
    height: auto !important;
  }
  
  .comparison-before,
  .comparison-after {
    position: static !important;
    display: block !important;
    width: 48% !important;
    float: left !important;
    margin-right: 4% !important;
  }
  
  /* Désactiver les animations à l'impression */
  * {
    animation: none !important;
    transition: none !important;
  }
}