/* Welcome Loading Animation */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Remove the circular loading icon from main.css */
#preloader:before {
  content: none !important;
  display: none !important;
}

.welcome-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.welcome-text {
  font-size: 80px;
  font-weight: 700;
  font-style: italic;
  letter-spacing: 8px;
  position: relative;
  display: inline-block;
}

/* Individual letter styling */
.welcome-text span {
  display: inline-block;
  opacity: 0;
  transform: translateY(20px);
  font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
  position: relative;
}

/* Colorful gradient for each letter */
.welcome-text span:nth-child(1) { 
  color: #ff6b6b;
  animation: writeIn 0.6s ease forwards;
  animation-delay: 0.3s;
}

.welcome-text span:nth-child(2) { 
  color: #ee5a6f;
  animation: writeIn 0.6s ease forwards;
  animation-delay: 0.8s;
}

.welcome-text span:nth-child(3) { 
  color: #f06292;
  animation: writeIn 0.6s ease forwards;
  animation-delay: 1.3s;
}

.welcome-text span:nth-child(4) { 
  color: #ba68c8;
  animation: writeIn 0.6s ease forwards;
  animation-delay: 1.8s;
}

.welcome-text span:nth-child(5) { 
  color: #9575cd;
  animation: writeIn 0.6s ease forwards;
  animation-delay: 2.3s;
}

.welcome-text span:nth-child(6) { 
  color: #7986cb;
  animation: writeIn 0.6s ease forwards;
  animation-delay: 2.8s;
}

.welcome-text span:nth-child(7) { 
  color: #4fc3f7;
  animation: writeIn 0.6s ease forwards;
  animation-delay: 3.3s;
}

/* Pen writing animation */
@keyframes writeIn {
  0% {
    opacity: 0;
    transform: translateY(20px) rotate(-5deg) scale(0.8);
  }
  50% {
    transform: translateY(-5px) rotate(2deg) scale(1.1);
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotate(0deg) scale(1);
  }
}

/* Underline drawing effect */
.welcome-text::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, 
    #ff6b6b 0%, 
    #ee5a6f 15%, 
    #f06292 30%, 
    #ba68c8 45%, 
    #9575cd 60%, 
    #7986cb 80%, 
    #4fc3f7 100%
  );
  border-radius: 2px;
  animation: drawLine 2s ease forwards;
  animation-delay: 1s;
}

@keyframes drawLine {
  to {
    width: 100%;
  }
}

/* Fade out animation for entire preloader */
#preloader.fade-out {
  animation: fadeOut 0.8s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .welcome-text {
    font-size: 50px;
    letter-spacing: 4px;
  }
}

@media (max-width: 480px) {
  .welcome-text {
    font-size: 36px;
    letter-spacing: 2px;
  }
  
  .welcome-text::after {
    height: 3px;
    bottom: -8px;
  }
}

/* Ink drop effect */
.ink-drop {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}

.ink-drop.active {
  animation: inkDrop 0.6s ease-out forwards;
}

@keyframes inkDrop {
  0% {
    opacity: 0.8;
    transform: scale(0);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.5);
  }
  100% {
    opacity: 0;
    transform: scale(2) translateY(10px);
  }
}

/* Cursor pen effect */
.pen-cursor {
  position: absolute;
  width: 4px;
  height: 40px;
  background: white;
  transform: rotate(45deg);
  opacity: 0;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  animation: penMove 4s ease-in-out;
}

@keyframes penMove {
  0% {
    opacity: 0;
    left: -50px;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    left: calc(100% + 50px);
  }
}
