/* ============================================
   ArtForever - Preloader Styles
   ============================================ */

.preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #fefefe 0%, #f8f9fa 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  overflow: hidden;
  transition: opacity 0.5s ease-out;
}

.preloader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* Canvas Background Texture */
.canvas-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.1) 1px, transparent 1px),
    radial-gradient(circle at 75% 75%, rgba(0, 0, 0, 0.02) 1px, transparent 1px);
  background-size: 20px 20px, 15px 15px;
  opacity: 0.3;
}

/* Paint Strokes */
.paint-strokes {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stroke {
  position: absolute;
  border-radius: 50px;
  transform-origin: left center;
  opacity: 0;
}

.stroke-1 {
  width: 200px;
  height: 8px;
  background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
  top: 20%;
  left: 10%;
  transform: rotate(-15deg);
  animation: paintStroke 1s ease-out 0.5s forwards, strokeGlow 2s ease-in-out 1.5s infinite alternate;
}

.stroke-2 {
  width: 180px;
  height: 12px;
  background: linear-gradient(90deg, #4ecdc4, #45b7b8);
  top: 20%;
  right: 15%;
  transform: rotate(25deg);
  animation: paintStroke 1.2s ease-out 1s forwards, strokeGlow 2s ease-in-out 2.2s infinite alternate;
}

.stroke-3 {
  width: 180px;
  height: 6px;
  background: linear-gradient(90deg, #ffe66d, #ffcc02);
  top: 40%;
  left: 5%;
  transform: rotate(45deg);
  animation: paintStroke 0.8s ease-out 1.5s forwards, strokeGlow 2s ease-in-out 2.3s infinite alternate;
}

.stroke-4 {
  width: 120px;
  height: 10px;
  background: linear-gradient(90deg, #a8e6cf, #7fcdcd);
  bottom: 30%;
  right: 20%;
  transform: rotate(-30deg);
  animation: paintStroke 1s ease-out 2s forwards, strokeGlow 2s ease-in-out 3s infinite alternate;
}

.stroke-5 {
  width: 160px;
  height: 14px;
  background: linear-gradient(90deg, #ff8b94, #ffaaa5);
  top: 60%;
  left: 20%;
  transform: rotate(10deg);
  animation: paintStroke 1.1s ease-out 2.5s forwards, strokeGlow 2s ease-in-out 3.6s infinite alternate;
}

@keyframes paintStroke {
  0% {
    opacity: 0;
    transform: scaleX(0);
  }
  50% {
    opacity: 0.8;
  }
  100% {
    opacity: 1;
    transform: scaleX(1);
  }
}

@keyframes strokeGlow {
  0% {
    filter: brightness(1) drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
  }
  100% {
    filter: brightness(1.2) drop-shadow(0 0 15px rgba(255, 255, 255, 0.6));
  }
}

/* Paint Splatters */
.paint-splatters {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.splatter {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
}

.splatter-1 {
  width: 12px;
  height: 12px;
  background: #ff6b6b;
  top: 25%;
  left: 80%;
  animation: splatterAppear 0.3s ease-out 1.8s forwards, splatterFloat 3s ease-in-out 2.1s infinite;
}

.splatter-2 {
  width: 8px;
  height: 8px;
  background: #4ecdc4;
  top: 45%;
  right: 25%;
  animation: splatterAppear 0.3s ease-out 2.2s forwards, splatterFloat 3s ease-in-out 2.5s infinite;
}

.splatter-3 {
  width: 15px;
  height: 15px;
  background: #ffe66d;
  bottom: 40%;
  left: 40%;
  animation: splatterAppear 0.3s ease-out 2.6s forwards, splatterFloat 3s ease-in-out 2.9s infinite;
}

.splatter-4 {
  width: 6px;
  height: 6px;
  background: #a8e6cf;
  top: 35%;
  left: 60%;
  animation: splatterAppear 0.3s ease-out 3s forwards, splatterFloat 3s ease-in-out 3.3s infinite;
}

.splatter-5 {
  width: 10px;
  height: 10px;
  background: #ff8b94;
  bottom: 25%;
  right: 35%;
  animation: splatterAppear 0.3s ease-out 3.4s forwards, splatterFloat 3s ease-in-out 3.7s infinite;
}

.splatter-6 {
  width: 14px;
  height: 14px;
  background: #dda0dd;
  top: 55%;
  left: 15%;
  animation: splatterAppear 0.3s ease-out 3.8s forwards, splatterFloat 3s ease-in-out 4.1s infinite;
}

@keyframes splatterAppear {
  0% {
    opacity: 0;
    transform: scale(0);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.3);
  }
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
}

@keyframes splatterFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.1);
  }
}

/* Logo Container */
.logo-container {
  position: relative;
  text-align: center;
  z-index: 100;
}

.logo-text {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
  font-family: 'Inter', sans-serif;
}

/* Letter animations */
.letter {
  display: inline-block;
  opacity: 0;
  animation: letterPaint 0.6s ease-out forwards;
}

.letter:nth-child(1) { animation-delay: 0.5s; }
.letter:nth-child(2) { animation-delay: 0.6s; }
.letter:nth-child(3) { animation-delay: 0.7s; }
.letter:nth-child(5) { animation-delay: 0.9s; }
.letter:nth-child(6) { animation-delay: 1.0s; }
.letter:nth-child(7) { animation-delay: 1.1s; }
.letter:nth-child(8) { animation-delay: 1.2s; }
.letter:nth-child(9) { animation-delay: 1.3s; }
.letter:nth-child(10) { animation-delay: 1.4s; }
.letter:nth-child(11) { animation-delay: 1.5s; }

@keyframes letterPaint {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
    filter: blur(2px);
  }
  50% {
    opacity: 0.7;
    transform: translateY(10px) scale(1.1);
    filter: blur(1px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

.tagline {
  font-size: 1.2rem;
  color: #6b7280;
  font-weight: 500;
  opacity: 0;
  animation: taglineAppear 1s ease-out 0.5s forwards;
}

@keyframes taglineAppear {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Brush Cursor */
.brush-cursor {
  position: absolute;
  width: 20px;
  height: 20px;
  background: radial-gradient(circle, #16a34a 30%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  animation: brushMove 5s ease-in-out 0.5s forwards;
  z-index: 50;
}

@keyframes brushMove {
  0% { opacity: 0; left: 5%; top: 20%; }
  10% { opacity: 0.8; left: 15%; top: 18%; }
  25% { left: 85%; top: 70%; }
  50% { left: 10%; top: 45%; }
  75% { left: 80%; top: 35%; }
  90% { left: 25%; top: 65%; }
  100% { opacity: 0; left: 50%; top: 50%; }
}

/* Progress Bar */
.progress-container {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 4px;
  background: rgba(22, 163, 74, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  border-radius: 2px;
  width: 0;
  animation: progressFill 5.5s ease-out forwards;
}

@keyframes progressFill {
  0% { width: 0%; }
  100% { width: 100%; }
}

/* Mobile Responsiveness for Preloader */
@media (max-width: 768px) {
  .logo-text {
    font-size: 2.2rem;
    white-space: nowrap;
  }

  .tagline {
    font-size: 1rem;
    text-align: center;
  }

  .progress-container {
    width: 140px;
    bottom: 25px;
  }

  .stroke {
    width: 60% !important;
    height: 6px !important;
  }

  .brush-cursor {
    width: 12px;
    height: 12px;
  }

  .splatter {
    transform: scale(0.7);
  }
}

@media (max-width: 480px) {
  .logo-text {
    font-size: 2rem;
  }
  
  .tagline {
    font-size: 0.9rem;
  }
  
  .stroke {
    width: 50% !important;
    height: 6px !important;
  }
  
  .progress-container {
    width: 120px;
  }
}
