@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes morphIcon {
    0% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    50% { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
    100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
}

@keyframes astRotateBgRed {
    100% { transform: rotate(360deg); }
}

.speedtest-section {
    padding: 0 0 60px 0;
    background-color: #ffffff;
}

.speedtest-banner {
    background: linear-gradient(135deg, #e60000 0%, #990000 50%, #ff1a1a 100%);
    background-size: 300% 300%;
    animation: gradientMove 6s ease infinite;
    border-radius: 20px;
    padding: 40px 50px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 15px 35px rgba(230, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.speedtest-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 60%);
    animation: astRotateBgRed 15s linear infinite;
    pointer-events: none;
}

.speedtest-banner h2 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    position: relative;
    z-index: 1;
}

.speedtest-banner p {
    font-size: 1.1rem;
    margin-bottom: 25px;
    color: #ffe6e6;
    position: relative;
    z-index: 1;
}

.btn-speedtest-trigger {
    background: #ffffff;
    color: #cc0000;
    border: none;
    padding: 15px 40px;
    font-size: 1.05rem;
    font-weight: 800;
    border-radius: 50px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 2;
}

.btn-speedtest-trigger:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.25);
    color: #e60000;
}

.modal-speed-test {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-speed-test.active {
    opacity: 1;
    visibility: visible;
}

.speed-modal-content {
    background: #ffffff;
    width: 90vw;
    max-width: 1100px;
    height: auto;
    max-height: 85vh;
    border-radius: 24px;
    position: relative;
    padding: 50px;
    transform: scale(0.95);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0,0,0,0.4);
}

.modal-speed-test.active .speed-modal-content {
    transform: scale(1);
}

.close-speed-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 2.8rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
    z-index: 10;
}

.close-speed-modal:hover {
    color: #e60000;
}

.speed-modal-header {
    text-align: center;
    margin-bottom: 40px;
}

.speed-modal-header h2 {
    color: #e60000;
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.speed-modal-header p {
    font-size: 1.15rem;
    color: #666;
    max-width: 700px;
    margin: 0 auto;
}

.speed-steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.speed-step {
    background: #f8f9fa;
    padding: 30px 20px;
    border-radius: 20px;
    text-align: center;
    border: 1px solid #eaeaea;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.step-icon {
    width: 75px;
    height: 75px;
    background: linear-gradient(135deg, #ffe6e6 0%, #ffcccc 100%);
    color: #e60000;
    font-size: 2.2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    margin: 0 auto 20px;
    box-shadow: 0 8px 15px rgba(230,0,0,0.1);
    transition: all 0.4s ease;
}

.speed-step:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(230,0,0,0.12);
    border-color: #ffcccc;
}

.speed-step:hover .step-icon {
    animation: morphIcon 3s ease-in-out infinite;
    background: linear-gradient(135deg, #e60000 0%, #ff4d4d 100%);
    color: #ffffff;
    transform: scale(1.1);
    box-shadow: 0 10px 25px rgba(230,0,0,0.3);
}

.speed-step h3 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.3;
}

.speed-step p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.speed-modal-footer {
    text-align: center;
    margin-top: auto;
}

.btn-speedtest-start {
    display: inline-block;
    background: linear-gradient(135deg, #e60000 0%, #990000 50%, #ff1a1a 100%);
    background-size: 300% 300%;
    animation: gradientMove 6s ease infinite;
    color: #ffffff;
    text-decoration: none;
    padding: 18px 50px;
    font-size: 1.2rem;
    font-weight: 800;
    border-radius: 50px;
    text-transform: uppercase;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 25px rgba(230, 0, 0, 0.3);
    letter-spacing: 0.5px;
}

.btn-speedtest-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(230, 0, 0, 0.4);
}

@media (max-width: 1024px) {
    .speed-steps-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .speedtest-banner {
        padding: 30px 20px;
    }
    
    .speedtest-banner h2 {
        font-size: 1.8rem;
    }
    
    .speed-modal-content {
        padding: 40px 20px 30px;
        width: 95vw;
    }
    
    .speed-modal-header h2 {
        font-size: 1.6rem;
    }
    
    .speed-steps-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .speed-step {
        padding: 25px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .step-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
        margin-bottom: 15px;
    }
    
    .btn-speedtest-start {
        width: 100%;
        padding: 15px 20px;
    }
}