/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: white;
    min-height: 100vh;
    padding: 10px;
    overflow-x: hidden;
}

.speedtest-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px;
}

/* Glowing Title */
.main-header {
    text-align: center;
    margin-bottom: 5px;
    padding: 10px;
}

.glowing-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: linear-gradient(90deg, #00F0FF, #00FF85, #FF9100, #00FFF0, #FFD700, #FF1744);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: glow 15s ease-in-out infinite alternate, gradientShift 20s linear infinite;
    text-shadow: 0 0 20px rgba(0, 219, 222, 0.5);
}

.glowing-title .fas {
    font-size: 3rem;
    animation: boltPulse 2s ease-in-out infinite;
}

.title-main {
    font-weight: 800;
    letter-spacing: 1px;
}

.title-sub {
    font-weight: 600;
    color: #94a3b8;
    font-size: 2.5rem;
}

.company-info {
    margin-top: 15px;
}

.company-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.company-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* IP Detection Section */
.detection-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    background: rgba(30, 41, 59, 0.7);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detection-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
}

.detection-icon {
    font-size: 2.5rem;
    color: #00dbde;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 219, 222, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(0, 219, 222, 0.3);
}

.detection-content {
    flex: 1;
}

.detection-label {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detection-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    font-family: 'Courier New', monospace;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Circular Meters Grid */
.meters-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.meter-card {
    background: rgba(30, 41, 59, 0.7);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.meter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.meter-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.meter-title-icon {
    font-size: 1.5rem;
    color: #00dbde;
}

.meter-title {
    font-size: 1.3rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.circular-progress {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
}

.circle-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: transparent;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 10;
}

.progress-ring-circle {
    fill: transparent;
    stroke: #00dbde;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease;
}

.ping-circle {
    stroke: #00dbde;
}

.jitter-circle {
    stroke: #fc00ff;
}

.download-circle {
    stroke: #00ff88;
}

.upload-circle {
    stroke: #ffaa00;
}

.circle-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.circle-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: white;
}

.circle-unit {
    font-size: 0.9rem;
    color: #94a3b8;
    margin-top: 5px;
}

.meter-footer {
    margin-top: 15px;
}

.meter-status {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.meter-description {
    font-size: 0.9rem;
    color: #94a3b8;
}

/* Control Buttons */
.control-section {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 40px;
}

.control-button {
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 200px;
    justify-content: center;
}

.start-button {
    background: linear-gradient(135deg, #00dbde 0%, #0099ff 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(0, 219, 222, 0.4);
}

.start-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 219, 222, 0.6);
}

.cancel-button {
    background: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    color: white;
    box-shadow: 0 10px 20px rgba(255, 65, 108, 0.4);
}

.cancel-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 65, 108, 0.6);
}

/* Results Section */
.results-section {
    background: rgba(30, 41, 59, 0.9);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideIn 0.5s ease;
}

.results-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 25px;
    color: #00dbde;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.result-label {
    font-size: 0.9rem;
    color: #94a3b8;
}

.result-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: white;
    font-family: 'Courier New', monospace;
}

.close-button {
    display: block;
    margin: 0 auto;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.close-button:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.4);
}

/* Footer */
.main-footer {
    text-align: center;
    padding: 10px;
    color: #94a3b8;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 20px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-powered {
    font-size: 0.8rem;
    color: #64748b;
}

/* Animations */
@keyframes glow {
    0%, 100% {
        text-shadow: 0 0 20px rgba(0, 240, 255, 0.5),
                     0 0 40px rgba(0, 240, 255, 0.3),
                     0 0 60px rgba(0, 240, 255, 0.2);
    }
    50% {
        text-shadow: 0 0 30px rgba(0, 255, 133, 0.8),
                     0 0 60px rgba(0, 255, 133, 0.5),
                     0 0 90px rgba(0, 255, 133, 0.3);
    }
    0%, 100% {
        text-shadow: 0 0 20px rgba(0, 219, 222, 0.5),
                     0 0 40px rgba(0, 219, 222, 0.3),
                     0 0 60px rgba(0, 219, 222, 0.2);
    }
    50% {
        text-shadow: 0 0 30px rgba(0, 219, 222, 0.8),
                     0 0 60px rgba(0, 219, 222, 0.5),
                     0 0 90px rgba(0, 219, 222, 0.3);
    }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

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

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

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .meters-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .glowing-title {
        font-size: 2.5rem;
        flex-direction: column;
        gap: 5px;
    }
    
    .meters-grid {
        grid-template-columns: 1fr;
    }
    
    .detection-section {
        grid-template-columns: 1fr;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .control-section {
        flex-direction: column;
        align-items: center;
    }
    
    .control-button {
        width: 100%;
        max-width: 300px;
    }
}

/* Meter Symbol Styling */
.meter-symbol {
    font-size: 3.5rem;
    color: #00F0FF;
    animation: meterGlow 8s ease-in-out infinite alternate, meterPulse 10s ease-in-out infinite;
    display: block;
    margin-bottom: 10px;
}

@keyframes meterGlow {
    0% {
        text-shadow: 0 0 10px rgba(0, 240, 255, 0.5),
                     0 0 20px rgba(0, 240, 255, 0.3);
        transform: scale(1);
    }
    100% {
        text-shadow: 0 0 20px rgba(0, 255, 133, 0.8),
                     0 0 40px rgba(0, 255, 133, 0.5),
                     0 0 60px rgba(0, 255, 133, 0.3);
        transform: scale(1.1);
    }
}

@keyframes meterPulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.title-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-main {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 1px;
}

.title-sub {
    font-size: 1.8rem;
    font-weight: 600;
    color: #94a3b8;
    margin-top: -5px;
}

/* Company Link Container */
.company-link-container {
    text-align: center;
    margin: 0 0 5px 0;
}

.company-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 50px;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 240, 255, 0.3);
}

.company-link:hover {
    background: rgba(0, 240, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 240, 255, 0.3);
}

.company-link i {
    color: #00F0FF;
}

/* Glowing Hyperlink */
.company-link {
    animation: linkGlow 6s ease-in-out infinite alternate;
    background: linear-gradient(90deg, rgba(0, 240, 255, 0.1), rgba(0, 255, 133, 0.1), rgba(224, 247, 250, 0.1));
    border: 1px solid rgba(0, 240, 255, 0.4);
}

@keyframes linkGlow {
    0% {
        box-shadow: 0 0 10px rgba(0, 240, 255, 0.3),
                    0 0 20px rgba(0, 240, 255, 0.2);
        border-color: rgba(0, 240, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 20px rgba(0, 255, 133, 0.5),
                    0 0 40px rgba(0, 255, 133, 0.3),
                    0 0 60px rgba(0, 255, 133, 0.2);
        border-color: rgba(0, 255, 133, 0.6);
    }
}

.company-link i {
    animation: iconColorShift 8s linear infinite;
}

@keyframes iconColorShift {
    0% { color: #00F0FF; }
    25% { color: #00FF85; }
    50% { color: #E0F7FA; }
    75% { color: #FF9100; }
    100% { color: #00F0FF; }
}
