/**
 * Travel-Themed Loading Animations
 * Clean modal design for loading states
 */

/* Modal Backdrop */
.travel-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.travel-loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Clean Modal Container */
.travel-loader-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.travel-loader-overlay.active .travel-loader-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header Accent */
.travel-loader-modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #5BA3E8 0%, #B8D4E3 100%);
}

/* Travel Animation Container */
.travel-animation-container {
    position: relative;
    width: 200px;
    height: 100px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Simple Spinner Animation */
.travel-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #5BA3E8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Simple Pulse Animation */
.travel-pulse {
    width: 50px;
    height: 50px;
    background: #5BA3E8;
    border-radius: 50%;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Simple Dots Animation */
.travel-dots-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.travel-dot {
    width: 12px;
    height: 12px;
    background: #5BA3E8;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.travel-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.travel-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.travel-dot:nth-child(3) {
    animation-delay: 0s;
}

/* Simple Animation for Page Loader */
.page-loader .travel-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #5BA3E8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Loading Text */
.travel-loader-text {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 12px 0;
    text-align: center;
    line-height: 1.5;
}

.travel-loader-subtext {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
    text-align: center;
    line-height: 1.5;
}

/* Dots Animation */
.travel-loader-dots {
    display: inline-block;
    margin-left: 4px;
}

.travel-loader-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #5BA3E8;
    margin: 0 2px;
    animation: dotBounce 1.4s ease-in-out infinite both;
}

.travel-loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.travel-loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.travel-loader-dots span:nth-child(3) {
    animation-delay: 0s;
}

/* Button Travel Loader (Inline) */
.btn-travel-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.btn-travel-loader .travel-icon {
    font-size: 16px;
    animation: travelPulse 1.5s ease-in-out infinite;
}

/* Small Travel Loader (for buttons) */
.travel-loader-small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.travel-loader-small .travel-icon-small {
    font-size: 14px;
    animation: travelBounce 1s ease-in-out infinite;
}

/* Page Transition Loader - Use same modal style as overlay */
.page-loader {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
}

.page-loader.active {
    opacity: 1 !important;
    visibility: visible !important;
}

.page-loader .travel-loader-modal {
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    padding: 40px !important;
    max-width: 400px !important;
    width: 90% !important;
    text-align: center !important;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
    position: relative !important;
    margin: 0 auto !important;
}

.page-loader.active .travel-loader-modal {
    transform: scale(1) translateY(0) !important;
}

.page-loader .travel-animation-container {
    width: 200px;
    height: 120px;
    margin: 0 auto 30px;
}

/* Form Loading State */
.form-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Keyframe Animations */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes compassSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@keyframes travelPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

@keyframes travelBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

@keyframes dotBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .travel-loader-modal {
        padding: 32px 24px;
        max-width: 90%;
    }
    
    .travel-animation-container {
        width: 180px;
        height: 100px;
        margin-bottom: 24px;
    }
    
    .travel-spinner,
    .travel-pulse {
        width: 40px;
        height: 40px;
    }
    
    .travel-dot {
        width: 10px;
        height: 10px;
    }
    
    .travel-compass {
        font-size: 40px;
    }
    
    .travel-loader-text {
        font-size: 16px;
    }
    
    .travel-loader-subtext {
        font-size: 13px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .travel-loader-modal {
        background: #1f2937;
        color: #f3f4f6;
    }
    
    .travel-loader-text {
        color: #f3f4f6;
    }
    
    .travel-loader-subtext {
        color: #9ca3af;
    }
}

