.preloader {
    position: fixed;
    top: 0;                
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #fff5e1 0%, #f5d6a3 100%);
    display: flex;
    justify-content: center; 
    align-items: center;    
    z-index: 9999;
    transition: opacity 0.8s ease;
}

.preloader.hidden {
    opacity: 0;
    pointer-events: none;
}

.preloader-content {
    text-align: center;
    position: relative;
    opacity: 0;
    animation: fadeInPreloader 1s ease-in-out forwards;
    display: flex;
    flex-direction: column;
    align-items: center;   
    gap: 20px;        
}

.pencil-writing {
    position: relative;
    width: 600px;
    height: 150px;
    display: flex;
    align-items: center;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.15));
}

.writing-line {
    position: relative;
    width: 100%;
    height: 4px;
    display: flex;
    align-items: center;
}

.line {
    position: absolute;
    left: 0;
    width: 0;
    height: 4px;
    background: linear-gradient(to right, #2c3e50 50%, transparent 100%);
    border-radius: 2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    animation: drawLine 3s ease-in-out forwards;
}

.text {
    position: absolute;
    left: 0;
    top: 30px;
    font-size: 2.5rem;
    font-family: 'Dancing Script', cursive;
    color: #2c3e50;
    opacity: 0;
    animation: fadeInText 3s ease-in-out forwards;
    animation-delay: 1.5s;
}

.text .highlight {
    font-size: 3rem;
    font-family: 'Playfair Display', serif;
    color: #d4a017; /* Gold color */
    font-weight: 900;
    text-shadow: 0 0 10px rgba(212, 160, 23, 0.8), 1px 1px 3px rgba(0, 0, 0, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

.pencil {
    position: absolute;
    font-size: 36px;
    color: #d4a017;
    z-index: 2;
    animation: write 3s ease-in-out forwards;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

.pencil img {
    transform: rotate(0deg);
    animation: pencilWiggle 0.4s ease-in-out infinite alternate;
}

.pencil::after {
    content: '';
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(212, 160, 23, 0.5);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: trail 3s ease-in-out forwards;
    opacity: 0;
}

.sparkles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
}

.sparkle {
    position: absolute;
    font-size: 18px;
    color: #f5a623;
    opacity: 0;
    animation: sparkleWrite 4s ease-in-out forwards;
    filter: drop-shadow(0 0 8px rgba(245, 166, 35, 0.9));
}

.sparkle:nth-child(1) { top: 10px; left: 0%; animation-delay: 1s; }
.sparkle:nth-child(2) { top: 0px; left: 10%; animation-delay: 1.2s; }
.sparkle:nth-child(3) { top: 15px; left: 20%; animation-delay: 1.4s; }
.sparkle:nth-child(4) { top: 5px; left: 30%; animation-delay: 1.6s; }
.sparkle:nth-child(5) { top: 20px; left: 40%; animation-delay: 1.8s; }
.sparkle:nth-child(6) { top: 10px; left: 50%; animation-delay: 2.0s; }
.sparkle:nth-child(7) { top: 0px; left: 60%; animation-delay: 2.2s; }
.sparkle:nth-child(8) { top: 15px; left: 70%; animation-delay: 2.4s; }
.sparkle:nth-child(9) { top: 5px; left: 80%; animation-delay: 2.6s; }
.sparkle:nth-child(10) { top: 20px; left: 90%; animation-delay: 2.8s; }

/* Button Styling */
.preloader-button {
    padding: 10px 20px;
    font-size: 1.2rem;
    background-color: #d4a017;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.preloader-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Animations */
@keyframes drawLine {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes fadeInText {
    0% { opacity: 0; transform: translateY(15px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes write {
    0% { left: 0; transform: translateY(0); }
    50% { transform: translateY(-10px); }
    100% { left: 100%; transform: translateY(0); }
}

@keyframes pencilWiggle {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(0deg); }
}

@keyframes trail {
    0% { opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { opacity: 0; }
}

@keyframes sparkleWrite {
    0% { opacity: 0; transform: scale(0) translateY(0); }
    20% { opacity: 1; transform: scale(1.5) translateY(-10px); }
    40% { transform: scale(1.2) translateY(0); }
    60% { transform: scale(1.5) translateY(-5px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes glow {
    0% { text-shadow: 0 0 10px rgba(212, 160, 23, 0.8), 1px 1px 3px rgba(0, 0, 0, 0.3); }
    100% { text-shadow: 0 0 20px rgba(212, 160, 23, 1), 1px 1px 5px rgba(0, 0, 0, 0.5); }
}

@keyframes fadeInPreloader {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

body.loading {
    overflow: hidden;
}

body.loaded .hero-fleets {
    animation: fadeIn 1s ease-in-out;
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}


@media (max-width: 768px) {
.sparkle:nth-child(1) { top: 10px; right: -56%; animation-delay: 1s; }
.sparkle:nth-child(2) { top: 0px; right: -67%; animation-delay: 1.2s; }
.sparkle:nth-child(3) { top: 15px; left: 20%; animation-delay: 1.4s; }
.sparkle:nth-child(4) { top: 5px; left: 27%; animation-delay: 1.6s; }
.sparkle:nth-child(5) { top: 20px; left: 34%; animation-delay: 1.8s; }
.sparkle:nth-child(6) { top: 10px; left: 41%; animation-delay: 2.0s; }
.sparkle:nth-child(7) { top: 0px; left: 48%; animation-delay: 2.2s; }
.sparkle:nth-child(8) { top: 15px; left: 55%; animation-delay: 2.4s; }
.sparkle:nth-child(9) { top: 5px; left: 62%; animation-delay: 2.6s; }
.sparkle:nth-child(10) { top: 20px; left: 69%; animation-delay: 2.8s; }
}