:root {
    --primary-color: #7C4DFF;
    --secondary-color: #FF4081;
    --background-dark: #0a0818;
    --card-bg: rgba(18, 18, 35, 0.98);
    --text-primary: #ffffff;
    --text-secondary: #b4b4c8;
    --success-color: #00E676;
}

body {
    margin: 0;
    padding: 0;
    background: var(--background-dark);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

.loading-card {
    position: relative;
    z-index: 2;
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    color: var(--text-primary);
    backdrop-filter: blur(20px);
    max-width: 440px;
    width: 90%;
    margin: 0 auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    box-shadow: 0 12px 45px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    contain: content;
}

.loading-card:hover {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 15px 55px rgba(124, 77, 255, 0.2);
}

.logo {
    position: relative;
    margin-bottom: 2rem;
}

.rocket {
    font-size: 4rem;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 0 15px rgba(124, 77, 255, 0.4));
    animation: float 4s ease-in-out infinite;
}

.circle-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(124, 77, 255, 0.4) 0%, transparent 70%);
    opacity: 0.5;
    animation: ripple 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

h1 {
    font-size: 1.8rem;
    margin: 0 0 2rem 0;
    background: linear-gradient(45deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-content {
    position: relative;
}

.progress-bar {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin: 1.5rem 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s ease-out;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 1rem 0;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: dots 1.4s ease-in-out infinite;
}

.waiting-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.status-icon {
    animation: pulse 1s ease-in-out infinite;
}

.test-result {
    display: flex;
    justify-content: space-between;
    padding: 1.2rem;
    margin: 1rem 0;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.test-result:hover {
    background: rgba(255, 255, 255, 0.1);
}

.test-result.testing {
    animation: pulse 1.5s ease-in-out infinite;
}

.test-result.success {
    border-color: var(--primary-color);
    background: rgba(124, 77, 255, 0.1);
    border: 1px solid rgba(124, 77, 255, 0.3);
}

.test-result.failed {
    border-color: var(--secondary-color);
    background: rgba(255, 64, 129, 0.1);
    border: 1px solid rgba(255, 64, 129, 0.3);
}

.pulse-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.testing .pulse-dot {
    animation: pulse 1s ease-in-out infinite;
}

.success .pulse-dot {
    background-color: var(--primary-color);
}

.failed .pulse-dot {
    background-color: var(--secondary-color);
}

.error {
    color: var(--secondary-color);
}

#retry-btn {
    margin-left: 1rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--primary-color), #9669FF);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

#retry-btn:hover {
    background: #5b52ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

#stop-btn {
    margin-left: 1rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--primary-color), #9669FF);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.3);
}

#stop-btn:hover {
    background: #5b52ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.4);
}

.status-success {
    color: var(--primary-color);
}

.status-error {
    color: var(--secondary-color);
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.gradient-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(124, 77, 255, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 90% 80%, rgba(255, 64, 129, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 230, 118, 0.1) 0%, transparent 50%);
    animation: backgroundShift 15s ease-in-out infinite;
}

.pattern-layer {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.1;
    background-image: 
        linear-gradient(45deg, #ffffff 25%, transparent 25%),
        linear-gradient(-45deg, #ffffff 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #ffffff 75%),
        linear-gradient(-45deg, transparent 75%, #ffffff 75%);
    background-size: 20px 20px;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes ripple {
    0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

@keyframes dots {
    0%, 100% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 100%; }
    100% { width: 100%; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes glow {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

@keyframes backgroundShift {
    0%, 100% { 
        transform: scale(1) translateZ(0);
    }
    50% { 
        transform: scale(1.1) translateZ(0);
    }
}

@media (max-width: 480px) {
    .loading-card {
        padding: 1.5rem;
        width: 85%;
        max-width: 320px;
        border-radius: 16px;
        max-width: 340px;
        width: 95%;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .rocket {
        font-size: 3rem;
    }

    .logo {
        margin-bottom: 1.5rem;
    }

    .circle-ripple {
        width: 80px;
        height: 80px;
    }

    .test-result {
        padding: 0.8rem;
        margin: 0.8rem 0;
        font-size: 0.9rem;
    }

    .waiting-text {
        font-size: 0.8rem;
    }

    #retry-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    #stop-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .progress-bar {
        margin: 1rem 0;
    }
}

@media (max-width: 768px) {
    .loading-card {
        padding: 2rem;
        width: 80%;
        max-width: 400px;
        margin: 0 auto;
    }

    h1 {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }

    .rocket {
        font-size: 3.5rem;
    }

    .test-result {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 360px) {
    .loading-card {
        padding: 1.2rem;
        width: 88%;
        max-width: 280px;
    }

    h1 {
        font-size: 1.2rem;
    }

    .test-result {
        padding: 0.7rem;
        font-size: 0.8rem;
    }

    .waiting-text {
        flex-direction: column;
        gap: 5px;
    }

    #retry-btn {
        margin-top: 0.5rem;
        margin-left: 0;
    }

    #stop-btn {
        margin-top: 0.5rem;
        margin-left: 0;
    }
}