* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --hover-color: #2563eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.header {
    text-align: center;
    margin-bottom: 60px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}

.icon-logo {
    width: 100px;
    height: auto;
}

.text-logo {
    height: 60px;
    width: auto;
}

.subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    font-weight: 300;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.status-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.metric-card {
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    min-height: 120px;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.metric-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
}

.progress-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--hover-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.server-info {
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid var(--border-color);
}

.info-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.info-value {
    font-size: 14px;
    font-weight: 500;
}

.status-online {
    color: var(--success-color);
}

.status-offline {
    color: #ef4444;
}

.connection-section {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.connection-card {
    padding: 16px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.connection-tip {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.connection-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-label {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 80px;
}

.detail-value {
    position: relative;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    background: var(--card-bg);
    padding: 8px 16px;
    padding-right: 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    color: #000000;
    display: inline-block;
    max-width: 100%;
}

.protocol-selector {
    position: relative;
    display: inline-block;
}

.protocol-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    background: rgba(175, 184, 193, 0.2);
    color: #57606a;
    border: 1px solid rgba(31, 35, 40, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.protocol-toggle:hover {
    background: rgba(175, 184, 193, 0.4);
    color: #24292f;
}

.protocol-toggle .chevron {
    transition: transform 0.2s ease;
    fill: currentColor;
}

.protocol-selector.open .chevron {
    transform: rotate(180deg);
}

.protocol-menu {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 4px;
    background: var(--card-bg);
    border: 1px solid rgba(31, 35, 40, 0.15);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
    min-width: 100%;
}

.protocol-selector.open .protocol-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.protocol-option {
    padding: 8px 16px;
    font-size: 13px;
    color: #57606a;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.protocol-option:hover {
    background: rgba(175, 184, 193, 0.2);
    color: #24292f;
}

.protocol-option.active {
    background: var(--primary-color);
    color: white;
}

.address-center {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 4px;
    flex-wrap: wrap;
    gap: 12px;
}

.copy-button {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    font-size: 12px;
    background: rgba(175, 184, 193, 0.2);
    color: #57606a;
    border: 1px solid rgba(31, 35, 40, 0.15);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 26px;
    min-height: 26px;
}

.copy-button:hover {
    background: rgba(175, 184, 193, 0.4);
    color: #24292f;
}

.copy-button:active {
    transform: translateY(-50%) scale(0.95);
}

.copy-icon,
.check-icon {
    fill: currentColor;
    flex-shrink: 0;
}

#latency-value {
    display: flex;
    align-items: center;
    gap: 10px;
}

.latency-text {
    font-size: 20px;
}

.location-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-color);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.location-icon {
    fill: var(--primary-color);
    flex-shrink: 0;
}

.location-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.latency-test-btn {
    padding: 4px 12px;
    font-size: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.latency-test-btn:hover {
    background: var(--hover-color);
}

.latency-test-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.latency-good {
    color: var(--success-color);
}

.latency-medium {
    color: #f59e0b;
}

.latency-bad {
    color: #ef4444;
}

.connection-section h2 {
    margin-bottom: 16px;
}

.footer {
    margin-top: 60px;
    text-align: center;
    padding: 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

@media (max-width: 640px) {
    .container {
        padding: 20px 16px;
    }

    .logo-container {
        flex-direction: column;
        gap: 12px;
    }

    .icon-logo {
        width: 80px;
    }

    .text-logo {
        height: 60px;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .status-section,
    .connection-section {
        padding: 24px;
    }

    .address-center {
        flex-direction: column;
        gap: 12px;
    }

    .detail-value {
        width: 100%;
        font-size: 13px;
        word-break: break-all;
    }

    .protocol-selector {
        width: 100%;
    }

    .protocol-toggle {
        width: 100%;
        justify-content: center;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}
