/* Variables CSS */
:root {
  --lens-size: 120px;
  --veil-opacity: 0.7;
}

/* Preloader GAFA */
.gafa-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: #000000;
  z-index: 9999;
  overflow: hidden;
  font-family: 'Arial', sans-serif;
}

.preload-container {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Container d'image */
.image-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: none;
}

.image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#blurred {
  filter: blur(20px);
  transform: scale(1.05);
}

#clear {
  clip-path: circle(0px at 0 0);
  transition: clip-path 0.05s linear; /* Plus rapide et smooth */
  cursor: none;
}

/* Voile vertical */
.vertical-veil {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(0, 0, 0, var(--veil-opacity)) 15%,
    rgba(0, 0, 0, var(--veil-opacity)) 85%,
    transparent 100%
  );
  z-index: 2;
  transform: translateX(-100%);
}

/* LOUPE CORRIGÉE */
.lens-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

.interactive-lens {
  position: absolute;
  width: var(--lens-size);
  height: var(--lens-size);
  border: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(2px);
  box-shadow: 
    0 0 0 9999px rgba(0, 0, 0, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.2),
    0 0 30px rgba(71, 98, 91, 0.5);
  transform: translate(-50%, -50%);
  transition: transform 0.1s ease-out;
  display: block; /* TOUJOURS VISIBLE */
  pointer-events: none;
  z-index: 4;
}

.interactive-lens.active {
  border-color: rgba(71, 98, 91, 1);
  box-shadow: 
    0 0 0 9999px rgba(0, 0, 0, 0.4),
    inset 0 0 30px rgba(255, 255, 255, 0.3),
    0 0 40px rgba(71, 98, 91, 0.7);
}

/* Contenu du preloader */
.preloader-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #ffffff;
  z-index: 5;
  pointer-events: none;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #ffffff;
  animation: spin 1.5s ease-in-out infinite;
  margin: 0 auto 20px;
}

.loading-text {
  font-size: 24px;
  letter-spacing: 8px;
  font-weight: 300;
  text-transform: uppercase;
  margin-bottom: 15px;
  animation: pulse 2s ease-in-out infinite;
}

.phase-indicator {
  font-size: 14px;
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.5);
  padding: 8px 15px;
  border-radius: 20px;
  margin-top: 10px;
}

/* Panneau de contrôle */
.control-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.85);
  padding: 20px;
  border-radius: 10px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  z-index: 10;
  min-width: 280px;
  color: white;
  font-size: 12px;
}

.filter-controls {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.85);
  padding: 15px;
  border-radius: 10px;
  z-index: 10;
}

.filter-presets {
  display: flex;
  gap: 10px;
}

.filter-btn {
  padding: 8px 12px;
  border: 1px solid #47625b;
  background: transparent;
  color: white;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
}

.filter-btn.active {
  background: #47625b;
}

.control-group {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.control-group label {
  flex: 1;
  margin-right: 10px;
}

.control-group input[type="range"] {
  flex: 2;
  margin-right: 10px;
}

.control-group span {
  flex: 0.5;
  text-align: right;
  font-weight: bold;
  color: #47625b;
}

.control-buttons {
  display: flex;
  gap: 8px;
  margin-top: 15px;
}

.control-buttons button {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.3s ease;
}

#apply-settings {
  background: #47625b;
  color: white;
}

#skip-animation {
  background: #8B4513;
  color: white;
}

#reset-settings {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.control-buttons button:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}

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

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

/* Responsive */
@media (max-width: 768px) {
  .control-panel, .filter-controls {
    top: 10px;
    right: 10px;
    left: 10px;
    min-width: auto;
  }
  
  .loading-spinner {
    width: 60px;
    height: 60px;
  }
  
  .loading-text {
    font-size: 18px;
    letter-spacing: 4px;
  }
  
  :root {
    --lens-size: 80px;
  }
}
