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

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #f9fafb;
    --card-bg: #ffffff;
    --border: #e5e7eb;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--text);
}

.container {
    max-width: 500px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Network Info - Kompakt */
.network-info {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.info-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.info-label {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.info-value {
    font-size: 0.75rem;
    color: var(--text);
    font-weight: 600;
    text-align: center;
}

/* Test Area */
.test-area {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Gauge */
.gauge-container {
    position: relative;
    width: 100%;
    max-width: 280px;
    margin: 0 auto 20px;
}

.gauge {
    width: 100%;
    height: auto;
}

.gauge-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 12;
    stroke-linecap: round;
}

.gauge-progress {
    fill: none;
    stroke: url(#gaugeGradient);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.3s ease;
}

.gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -30%);
    text-align: center;
}

.speed-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.speed-unit {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 2px;
}

.test-status {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 6px;
}

/* Results Table - KOMPAKT */
.results-table {
    background: var(--bg);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 16px;
}

.result-row {
    display: grid;
    grid-template-columns: 32px 1fr auto auto;
    align-items: center;
    gap: 8px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border);
}

.result-row:last-child {
    border-bottom: none;
}

.result-icon {
    font-size: 1.2rem;
    text-align: center;
}

.result-label {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 500;
}

.result-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    text-align: right;
}

.result-unit {
    font-size: 0.75rem;
    color: var(--text-light);
    width: 40px;
}

/* Data Badge - Kompakt */
.data-badge {
    background: var(--bg);
    border-radius: 20px;
    padding: 8px 16px;
    text-align: center;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    justify-content: center;
}

.badge-icon {
    font-size: 1rem;
}

/* Test Button */
.test-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.test-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

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

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

/* Progress */
.progress-container {
    margin-top: 16px;
}

.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
}

/* Footer */
footer {
    text-align: center;
    color: white;
    margin-top: 20px;
    padding: 12px;
    opacity: 0.8;
    font-size: 0.85rem;
}

/* Quality Colors */
.quality-excellent { color: var(--success) !important; }
.quality-good { color: #3b82f6 !important; }
.quality-fair { color: var(--warning) !important; }
.quality-poor { color: var(--danger) !important; }

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.testing {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Responsive */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.75rem;
    }
    
    .test-area {
        padding: 20px;
    }
    
    .speed-value {
        font-size: 2rem;
    }
    
    .info-value {
        font-size: 0.7rem;
    }
}
