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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(180deg, #1a1d2e 0%, #0f1118 100%);
    color: #ffffff;
    min-height: 100vh;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
}

.logo svg {
    width: 24px;
    height: 24px;
}

nav {
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    color: #ffffff;
    text-decoration: none;
    font-size: 14px;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.7;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
    justify-content: center;
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Results Section */
.results-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

/* Speed Gauge */
.speed-gauge {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-svg {
    position: absolute;
    width: 100%;
    height: 100%;
}

#progressCircle {
    transition: stroke-dashoffset 0.3s ease-out;
}

.gauge-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    pointer-events: none;
}

.speed-value {
    font-size: 72px;
    font-weight: 700;
    line-height: 1;
    color: #00d4ff;
}

.speed-unit {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

.test-phase {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 12px;
}

.go-button {
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00d4ff 0%, #0088cc 100%);
    border: none;
    color: #ffffff;
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 8px 32px rgba(0, 212, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.go-button:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.6);
}

.go-button:active {
    transform: scale(0.98);
}

.go-button.testing {
    display: none;
}

.go-button.retest {
    font-size: 72px;
    letter-spacing: 0;
    font-weight: 400;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin: 20px 0;
}

.result-item {
    text-align: center;
}

.result-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.result-value {
    font-size: 48px;
    font-weight: 700;
    color: #00d4ff;
    line-height: 1;
}

.result-unit {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 4px;
}

/* Connection Info */
.connection-info {
    text-align: center;
    margin-top: 20px;
}

.isp-name {
    font-size: 18px;
    margin-bottom: 5px;
    font-weight: 500;
}

.ip-address {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
}

.change-server {
    color: #00d4ff;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s;
    display: inline-block;
    line-height: 1.5;
}

.change-server:hover {
    opacity: 0.8;
}

/* Connection Type Toggle */
.connection-type {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.connection-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.connection-option:hover {
    background: rgba(255, 255, 255, 0.05);
}

.connection-option.active {
    color: #ffffff;
    background: rgba(0, 212, 255, 0.1);
    border-color: rgba(0, 212, 255, 0.3);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    color: #ffffff;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn:active {
    transform: scale(0.98);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin: 60px 0;
    max-width: 900px;
    width: 100%;
}

.feature-card {
    text-align: center;
    padding: 20px;
    transition: transform 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon svg {
    width: 100%;
    height: 100%;
}

.feature-title {
    font-size: 14px;
    color: #00d4ff;
    margin-top: 15px;
}

/* Footer Links */
.footer-links {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin: 60px 0 40px;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-section h4 {
    font-size: 14px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #00d4ff;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.footer-section ul li a:hover {
    color: #ffffff;
}

.footer-bottom {
    text-align: center;
    padding: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
}

.footer-bottom a {
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.2s;
}

.footer-bottom a:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: linear-gradient(180deg, #1a1d2e 0%, #0f1118 100%);
    padding: 40px;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #00d4ff;
}

.close {
    color: rgba(255, 255, 255, 0.6);
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close:hover {
    color: #ffffff;
}

.history-list {
    margin: 20px 0;
}

.history-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.history-item-results {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.history-result {
    text-align: center;
}

.history-result-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 4px;
}

.history-result-value {
    font-size: 24px;
    font-weight: 600;
    color: #00d4ff;
}

.history-result-unit {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
        padding: 20px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .speed-gauge {
        width: 240px;
        height: 240px;
    }

    .speed-value {
        font-size: 56px;
    }

    .go-button {
        width: 100px;
        height: 100px;
        font-size: 36px;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-links {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 30px;
    }

    .modal-content {
        padding: 20px;
        width: 95%;
    }

    .history-item-results {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* Loading Animation */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.testing .gauge-svg {
    animation: rotate 2s linear infinite;
}
