* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        sans-serif;
    background-color: #f7f7f7;
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    color: #718096;
    margin-bottom: 2rem;
}

/* Main speed display card */
.speed-display {
    background: white;
    border-radius: 12px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 15px rgba(0, 0, 0, 0.1);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    border: 1px solid #e2e8f0;
}

.speed-value {
    font-size: 4.5rem;
    font-weight: 700;
    color: #2d3748;
    line-height: 1;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.speed-unit {
    font-size: 1.5rem;
    color: #718096;
    font-weight: 500;
}

/* Test controls */
.test-controls {
    text-align: center;
    margin-bottom: 2rem;
}

.test-button {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    border: none;
    border-radius: 8px;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(66, 153, 225, 0.2);
    position: relative;
    overflow: hidden;
    min-width: 180px;
}

.test-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(66, 153, 225, 0.3);
}

.test-button:active {
    transform: translateY(0);
}

.test-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-text {
    display: inline-block;
    transition: opacity 0.3s ease;
}

.loading-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.test-button.loading .button-text {
    opacity: 0;
}

.test-button.loading .loading-spinner {
    display: block;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Status text */
.test-status {
    text-align: center;
    font-size: 1rem;
    color: #4a5568;
    margin-bottom: 2rem;
    min-height: 1.5rem;
    font-weight: 500;
}

/* Results section */
.results-section {
    background: white;
    border-radius: 12px;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 15px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.result-item {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
}

.result-label {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.result-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #2d3748;
}

/* Color coding for performance */
.result-item.download .result-value {
    color: #68d391; /* Green for download */
}

.result-item.upload .result-value {
    color: #fc8181; /* Red for upload */
}

.result-item.ping .result-value {
    color: #4299e1; /* Blue for ping */
}

/* Progress bar */
.progress-bar {
    background: #e2e8f0;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    background: linear-gradient(90deg, #68d391 0%, #4299e1 50%, #fc8181 100%);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Performance indicators */
.performance-good {
    color: #68d391 !important;
    background-color: rgba(104, 211, 145, 0.1) !important;
    border-color: rgba(104, 211, 145, 0.2) !important;
}

.performance-moderate {
    color: #f6e05e !important;
    background-color: rgba(246, 224, 94, 0.1) !important;
    border-color: rgba(246, 224, 94, 0.2) !important;
}

.performance-poor {
    color: #fc8181 !important;
    background-color: rgba(252, 129, 129, 0.1) !important;
    border-color: rgba(252, 129, 129, 0.2) !important;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    color: #718096;
    font-size: 0.875rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    header h1 {
        font-size: 2rem;
    }

    .speed-value {
        font-size: 3.5rem;
    }

    .speed-display {
        padding: 2rem 1rem;
    }

    .results-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .result-item {
        padding: 0.75rem;
    }

    .result-value {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .speed-value {
        font-size: 3rem;
    }

    .test-button {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
}
.hide {
    display: none;
}

.loading {
    border: 16px solid #f3f3f3; /* Light grey */
    border-top: 16px solid #3498db; /* Blue */
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.download-speed {
    color: #1f9d55;
}

.upload-speed {
    color: #f56565;
}

.section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f7f7f7;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.section:not(:last-child) {
    margin-bottom: 2rem;
}

.rounded {
    border-radius: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.shadow {
    box-shadow:
        0 1px 3px 0 rgba(0, 0, 0, 0.1),
        0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

.bg-green-300 {
    background-color: #68d391;
}

.bg-yellow-300 {
    background-color: #f6e05e;
}

.bg-green-500 {
    background-color: #68d391;
}

.bg-yellow-500 {
    background-color: #f6e05e;
}

.bg-red-500 {
    background-color: #fc8181;
}

.bg-red-300 {
    background-color: #fc8181;
}
.text-green-500 {
    color: #68d391;
}

.text-yellow-500 {
    color: #f6e05e;
}

.text-red-500 {
    color: #fc8181;
}
