/* Custom Preloader with Company Logo */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1A685B 0%, #0d4a3f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
}

.preloader.hide {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

/* Logo Container with Animation */
.preloader-logo {
    position: relative;
    width: 180px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoFloat 3s ease-in-out infinite;
    background: #ffffff;
    border-radius: 24px;
    padding: 25px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.preloader-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: none;
    animation: logoPulse 2s ease-in-out infinite;
    display: block;
}

/* Floating Animation */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-15px) rotate(2deg);
    }
}

/* Pulse Animation */
@keyframes logoPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.95;
    }
}

/* Rotating Ring Around Logo */
.preloader-ring {
    position: absolute;
    width: 220px;
    height: 220px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top: 4px solid #ffffff;
    border-right: 4px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    top: -20px;
    left: -20px;
    z-index: 1;
}

.preloader-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    border: 3px solid transparent;
    border-bottom: 3px solid rgba(255, 255, 255, 0.3);
    border-left: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: spin 2s linear infinite reverse;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Loading Text */
.preloader-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    animation: textFade 2s ease-in-out infinite;
    margin-top: 0;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@keyframes textFade {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 1;
    }
}

/* Loading Dots */
.preloader-dots {
    display: flex;
    gap: 12px;
    margin-top: 0;
    align-items: center;
    justify-content: center;
}

.preloader-dots span {
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
    box-shadow: 0 2px 8px rgba(255, 255, 255, 0.4);
}

.preloader-dots span:nth-child(1) {
    animation-delay: 0s;
}

.preloader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.preloader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* Hide Default Loader */
.preloader .loader {
    display: none;
}

/* Cancel Button Styling */
.preloader .preloaderCls {
    position: absolute;
    top: 30px;
    left: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.preloader .preloaderCls:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .preloader-inner {
        gap: 20px;
        padding: 15px;
    }
    
    .preloader-logo {
        width: 140px;
        height: 140px;
        padding: 20px;
        border-radius: 20px;
    }
    
    .preloader-ring {
        width: 170px;
        height: 170px;
        top: -15px;
        left: -15px;
        border-width: 3px;
    }
    
    .preloader-text {
        font-size: 13px;
        letter-spacing: 2px;
    }
    
    .preloader-dots {
        gap: 10px;
    }
    
    .preloader-dots span {
        width: 8px;
        height: 8px;
    }
    
    .preloader .preloaderCls {
        top: 20px;
        left: 20px;
        padding: 8px 16px;
        font-size: 12px;
    }
}

