/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 40px 0;
    text-align: center;
}

.header-content .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.header-content .logo i {
    font-size: 2.5rem;
    color: white;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 50%;
    backdrop-filter: blur(10px);
}

.header-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.header-content p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 600px;
    margin: 0 auto;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Test card */
.test-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 500px;
    margin: 0 auto;
}

.test-info {
    margin-bottom: 30px;
}

.test-info h2 {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 10px;
}

.test-info p {
    color: #4a5568;
    font-size: 1.1rem;
}

.server-count {
    font-weight: 600;
    color: #667eea;
}

/* Buttons */
.test-btn, .stop-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.test-btn:hover, .stop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.test-btn:active, .stop-btn:active {
    transform: translateY(0);
}

.stop-btn {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
    display: none;
}

.stop-btn:hover {
    box-shadow: 0 6px 20px rgba(229, 62, 62, 0.6);
}

/* Progress bar */
.progress-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}

.progress-text {
    font-size: 1.2rem;
    color: #2d3748;
    margin-bottom: 20px;
    font-weight: 500;
}

.progress-container {
    background: #e2e8f0;
    border-radius: 10px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 10px;
}

/* Results section */
.results-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}

.results-header h2 {
    font-size: 1.8rem;
    color: #2d3748;
    margin-bottom: 15px;
}

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

.summary-item {
    background: rgba(79, 172, 254, 0.1);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-item .label {
    font-weight: 500;
    color: #4a5568;
}

.summary-item .value {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

/* Results table */
.results-table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.table-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.table-row {
    display: grid;
    grid-template-columns: 60px 1fr 1fr 100px 100px;
    gap: 15px;
    padding: 15px 20px;
    align-items: center;
}

.table-cell {
    font-weight: 500;
}

.table-header .table-cell {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.table-body .table-row {
    border-bottom: 1px solid #e2e8f0;
    transition: background-color 0.2s ease;
}

.table-body .table-row:hover {
    background-color: #f7fafc;
}

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

.rank {
    text-align: center;
    font-weight: 600;
}

.location {
    display: flex;
    align-items: center;
    gap: 8px;
}

.country-flag {
    width: 20px;
    height: 15px;
    border-radius: 2px;
}

.latency {
    text-align: center;
    font-weight: 600;
}

.latency.excellent { color: #38a169; }
.latency.good { color: #3182ce; }
.latency.fair { color: #d69e2e; }
.latency.poor { color: #e53e3e; }

.status {
    text-align: center;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.status-badge.success {
    background: #c6f6d5;
    color: #22543d;
}

.status-badge.error {
    background: #fed7d7;
    color: #742a2a;
}

.status-badge.timeout {
    background: #feebc8;
    color: #7b341e;
}

/* Footer */
.footer {
    padding: 20px 0;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

/* Mobile card layout - hidden by default, shown on mobile */
.mobile-results {
    display: none;
}

.mobile-result-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #667eea;
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.mobile-card-rank {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 6px 12px;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 45px;
    text-align: center;
}

.mobile-card-status {
    flex-shrink: 0;
}

.mobile-card-location {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.mobile-card-location .country-flag {
    font-size: 1.2rem;
    width: auto;
    height: auto;
}

.mobile-card-location-text {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
}

.mobile-card-server {
    color: #4a5568;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.mobile-card-latency {
    text-align: center;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-block;
}

.mobile-card-latency.excellent {
    background: #c6f6d5;
    color: #22543d;
}

.mobile-card-latency.good {
    background: #bee3f8;
    color: #2c5282;
}

.mobile-card-latency.fair {
    background: #faf089;
    color: #744210;
}

.mobile-card-latency.poor {
    background: #fed7d7;
    color: #742a2a;
}

/* Responsive design */
@media (max-width: 968px) {
    .container {
        padding: 0 15px;
    }
    
    .test-card {
        min-width: auto;
        padding: 30px 20px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 30px 0;
    }
    
    .header-content h1 {
        font-size: 2.2rem;
    }
    
    .header-content p {
        font-size: 1.1rem;
    }
    
    .test-card {
        padding: 25px 20px;
        margin: 0;
    }
    
    .test-info h2 {
        font-size: 1.5rem;
    }
    
    .test-info p {
        font-size: 1rem;
    }
    
    .test-btn, .stop-btn {
        padding: 14px 25px;
        font-size: 1rem;
    }
    
    .progress-bar, .results-section {
        padding: 25px 20px;
    }
    
    .results-header h2 {
        font-size: 1.5rem;
    }
    
    /* Hide desktop table on mobile */
    .results-table {
        display: none;
    }
    
    /* Show mobile card layout */
    .mobile-results {
        display: block;
    }
    
    .results-summary {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .summary-item {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .summary-item .label {
        font-size: 0.9rem;
    }
    
    .summary-item .value {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .header-content .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .header-content .logo i {
        font-size: 2rem;
        padding: 12px;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .header-content p {
        font-size: 1rem;
    }
    
    .test-btn, .stop-btn {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
    
    .test-card, .progress-bar, .results-section {
        padding: 20px 15px;
    }
    
    .mobile-result-card {
        padding: 15px;
        margin-bottom: 12px;
    }
    
    .mobile-card-location-text {
        font-size: 1rem;
    }
    
    .mobile-card-latency {
        padding: 6px 12px;
        font-size: 1rem;
    }
    
    .results-summary {
        grid-template-columns: 1fr;
    }
} 