/* Enhanced loading spinner overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(25, 25, 35, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.4s ease-out;
    backdrop-filter: blur(5px); /* Added for better glass effect */
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden; /* Prevents layout shifts */
}

/* Optional but helpful - make sure spinner is visible when active */
.loading-overlay:not(.hidden) .spinner-container,
.loading-overlay:not(.hidden) .loading-text {
    visibility: visible;
}

/* Enhanced glassmorphism spinner container with improved performance */
.spinner-container {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 50%;
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.3),
        inset 0 4px 6px rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

/* Enhanced spinner with better performance */
.spinner {
    position: absolute;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #3b82f6; /* blue-500 */
    animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    transform-origin: center;
}

.spinner::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #10b981; /* emerald-500 */
    animation: spinReverse 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    transform-origin: center;
}

.spinner::after {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    border: 4px solid transparent;
    border-top-color: #f97316; /* orange-500 */
    animation: spinReverse 1.2s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    transform-origin: center;
    transform: rotateZ(-45deg);
}

/* Optimized animations with better performance */
@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

@keyframes spinReverse {
    to { 
        transform: rotate(-360deg); 
    }
}

/* Enhanced loading text */
.loading-text {
    position: absolute;
    bottom: -45px;
    font-size: 18px;
    font-weight: 500;
    letter-spacing: 1px;
    text-align: center;
    width: 100%;
    color: rgba(255, 255, 255, 0.9);
    animation: pulseText 1.5s infinite alternate; /* Added subtle pulsing */
}

@keyframes pulseText {
    from { opacity: 0.7; }
    to { opacity: 1; }
}

/* Enhanced visual effects for better aesthetics */
.spinner-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: linear-gradient(45deg, 
        #3b82f6, /* blue-500 */
        #10b981, /* emerald-500 */
        #f97316, /* orange-500 */
        #3b82f6);
    z-index: -1;
    animation: rotate 4s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .spinner-container {
        width: 100px;
        height: 100px;
    }
    
    .spinner {
        width: 70px;
        height: 70px;
        border-width: 3.5px;
    }
    
    .spinner::before,
    .spinner::after {
        top: -3.5px;
        left: -3.5px;
        right: -3.5px;
        bottom: -3.5px;
        border-width: 3.5px;
    }
    
    .loading-text {
        font-size: 16px;
        bottom: -40px;
    }
}

@media (max-width: 480px) {
    .spinner-container {
        width: 90px;
        height: 90px;
    }
    
    .spinner {
        width: 65px;
        height: 65px;
        border-width: 3px;
    }
    
    .spinner::before,
    .spinner::after {
        top: -3px;
        left: -3px;
        right: -3px;
        bottom: -3px;
        border-width: 3px;
    }
    
    .loading-text {
        font-size: 14px;
        bottom: -35px;
    }
}

@media (max-width: 360px) {
    .spinner-container {
        width: 80px;
        height: 80px;
    }
    
    .spinner {
        width: 55px;
        height: 55px;
        border-width: 2.5px;
    }
    
    .spinner::before,
    .spinner::after {
        top: -2.5px;
        left: -2.5px;
        right: -2.5px;
        bottom: -2.5px;
        border-width: 2.5px;
    }
}

/* Page content styling */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a202c, #2d3748);
    color: white;
    min-height: 100vh;
    margin: 0;
    padding: 2rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(to right, #3b82f6, #10b981);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    margin: 0.5rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.features {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

/* Base: flexible cards, can grow wider */
.feature-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 1.5rem;
    flex: 1 1 260px;     /* minimum “target” width */
    max-width: 100%;     /* allow full width of the row */
    backdrop-filter: blur(5px);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.1);
}

/* Tablet: one per row (nice and wide) */
@media (max-width: 768px) {
    .features {
        justify-content: center;
    }

    .feature-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Phone: already full-width, keep it simple */
@media (max-width: 480px) {
    .feature-card {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
}