/* Hide all possible default Flutter loader elements */
#flutter-loader,
.flutter-loader,
#splash-screen,
.splash-screen,
#loading,
.loading,
#progress,
.progress {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
}

body {
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Roboto', sans-serif;
    transition: background-color 0.3s ease;
}

.loading-container {
    text-align: center;
    position: relative;
}

.logo {
    font-size: 48px;
    font-weight: bold;
    color: #0553B1;
    margin-bottom: 24px;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
}

.logo::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    background: radial-gradient(circle, rgba(5, 83, 177, 0.2) 0%, rgba(5, 83, 177, 0) 70%);
    animation: pulse 2s ease-in-out infinite;
    border-radius: 50%;
    z-index: -1;
    transition: background 0.3s ease;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }

    100% {
        transform: scale(0.95);
        opacity: 0.5;
    }
}

.loading-ring {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
}

.loading-ring div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 51px;
    height: 51px;
    margin: 6px;
    border: 6px solid #0553B1;
    border-radius: 50%;
    animation: loading-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: #0553B1 transparent transparent transparent;
    transition: border-color 0.3s ease;
}

.loading-ring div:nth-child(1) {
    animation-delay: -0.45s;
}

.loading-ring div:nth-child(2) {
    animation-delay: -0.3s;
}

.loading-ring div:nth-child(3) {
    animation-delay: -0.15s;
}

@keyframes loading-ring {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    color: #666666;
    font-size: 16px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: color 0.3s ease;
}

.dot {
    width: 4px;
    height: 4px;
    background-color: #666666;
    border-radius: 50%;
    display: inline-block;
    animation: dot-fade 1.4s ease-in-out infinite;
    transition: background-color 0.3s ease;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-fade {

    0%,
    100% {
        opacity: 0.2;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-progress {
    position: relative;
    height: 4px;
    width: 200px;
    background-color: rgba(5, 83, 177, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin: 20px auto;
    transition: background-color 0.3s ease;
}

.progress-bar {
    position: absolute;
    width: 40%;
    height: 100%;
    background-color: #0553B1;
    border-radius: 4px;
    animation: progress 1.5s ease-in-out infinite;
    transition: background-color 0.3s ease;
}

@keyframes progress {
    0% {
        left: -40%;
        transform: translateX(0) scaleX(1);
    }

    49.99% {
        transform: translateX(100%) scaleX(1);
    }

    50% {
        transform: translateX(100%) scaleX(-1);
    }

    100% {
        left: 100%;
        transform: translateX(-100%) scaleX(-1);
    }
}

/* Dark mode styles */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #121212;
    }

    .logo {
        color: #4D8EE6;
    }

    .logo::after {
        background: radial-gradient(circle, rgba(77, 142, 230, 0.4) 0%, rgba(77, 142, 230, 0) 70%);
    }

    .loading-ring div {
        border-color: #4D8EE6 transparent transparent transparent;
    }

    .loading-text {
        color: #E0E0E0;
    }

    .dot {
        background-color: #E0E0E0;
    }

    .loading-progress {
        background-color: rgba(77, 142, 230, 0.1);
    }

    .progress-bar {
        background-color: #4D8EE6;
    }
}

/* Theme class-based styles for manual theme switching */
body.dark-theme {
    background-color: #121212;
}

body.dark-theme .logo {
    color: #4D8EE6;
}

body.dark-theme .logo::after {
    background: radial-gradient(circle, rgba(77, 142, 230, 0.4) 0%, rgba(77, 142, 230, 0) 70%);
}

body.dark-theme .loading-ring div {
    border-color: #4D8EE6 transparent transparent transparent;
}

body.dark-theme .loading-text {
    color: #E0E0E0;
}

body.dark-theme .dot {
    background-color: #E0E0E0;
}

body.dark-theme .loading-progress {
    background-color: rgba(77, 142, 230, 0.1);
}

body.dark-theme .progress-bar {
    background-color: #4D8EE6;
}