* {
    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(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.status-message {
    text-align: center;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

.status-message.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-message.warning {
    background: #fff3e0;
    color: #f57c00;
}

.progress-bar {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.summary {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.summary-item {
    flex: 1;
    min-width: 120px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: center;
    border: 2px solid transparent;
}

.summary-item.success {
    background: #e8f5e9;
    border-color: #4caf50;
}

.summary-item.failed {
    background: #ffebee;
    border-color: #f44336;
}

.summary-item.testing {
    background: #e3f2fd;
    border-color: #2196f3;
}

.summary-item .label {
    display: block;
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.summary-item .value {
    display: block;
    font-size: 2em;
    font-weight: bold;
    color: #333;
}

.results-container {
    margin: 30px 0;
}

.result-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    gap: 15px;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border-left: 4px solid #ccc;
    background: #fafafa;
    align-items: center;
}

.result-item.testing {
    border-left-color: #2196f3;
    background: #e3f2fd;
}

.result-item.success {
    border-left-color: #4caf50;
    background: #e8f5e9;
}

.result-item.failed {
    border-left-color: #f44336;
    background: #ffebee;
}

.result-item.timeout {
    border-left-color: #ff9800;
    background: #fff3e0;
}

.result-item.partial {
    border-left-color: #ffc107;
    background: #fffde7;
}

.result-url {
    font-weight: 500;
    word-break: break-all;
}

.result-port {
    font-size: 0.9em;
    color: #666;
    white-space: nowrap;
}

.result-status {
    font-weight: 600;
    white-space: nowrap;
}

.result-duration {
    font-size: 0.9em;
    color: #666;
    white-space: nowrap;
}

.device-info {
    margin: 40px 0 20px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.device-info h3 {
    color: #667eea;
    margin-bottom: 15px;
}

.info-item {
    padding: 8px 0;
    border-bottom: 1px solid #ddd;
}

.info-item:last-child {
    border-bottom: none;
}

.retest-button {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.retest-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

/* Dashboard specific styles */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.refresh-button {
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.refresh-button:hover {
    background: #5568d3;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: center;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    color: #666;
    margin-top: 5px;
}

.test-results {
    margin-top: 30px;
}

.test-card {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
}

.test-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.test-timestamp {
    color: #666;
    font-size: 0.9em;
}

.test-device {
    margin: 10px 0;
    padding: 10px;
    background: white;
    border-radius: 4px;
    font-size: 0.9em;
}

.url-results {
    display: grid;
    gap: 5px;
    margin-top: 15px;
}

.url-result-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 10px;
    padding: 8px;
    background: white;
    border-radius: 4px;
    font-size: 0.9em;
}

.url-status-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 0.85em;
}

.url-status-badge.success {
    background: #4caf50;
    color: white;
}

.url-status-badge.failed {
    background: #f44336;
    color: white;
}

.url-status-badge.timeout {
    background: #ff9800;
    color: white;
}

.url-status-badge.partial {
    background: #ffc107;
    color: black;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .result-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .summary {
        flex-direction: column;
    }
}
