/* Ping Tool Styles */
.ping-container {
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #374151;
}

/* Header */
.ping-header {
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.ping-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    min-height: 4rem;
}

.ping-title-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ping-icon {
    width: 2.5rem;
    height: 2.5rem;
    background: #3b82f6;
    color: white;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ping-title-section h1 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.ping-title-section p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.ping-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Buttons */
.ping-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.ping-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #d1d5db !important;
    color: #9ca3af !important;
    border-color: #d1d5db !important;
    box-shadow: none !important;
}

.ping-btn-primary {
    background: #059669;
    color: white;
    border-color: #059669;
    box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.ping-btn-primary:hover:not(:disabled) {
    background: #047857;
    border-color: #047857;
    box-shadow: 0 4px 8px rgba(5, 150, 105, 0.3);
    transform: translateY(-1px);
}

.ping-btn-ghost {
    background: transparent;
    color: #6b7280;
    border-color: transparent;
}

.ping-btn-ghost:hover {
    background: #f3f4f6;
    color: #374151;
}

.ping-btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Layout */
.ping-main {
    padding: 0 1rem;
}

.ping-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 1024px) {
    .ping-grid {
        grid-template-columns: 1fr;
    }
}

/* Cards */
.ping-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.ping-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #f3f4f6;
}

.ping-card-header h2,
.ping-card h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.ping-card h3 {
    padding: 1.5rem 1.5rem 1rem;
    margin-bottom: 0;
    border-bottom: 1px solid #f3f4f6;
}

.ping-test-time {
    font-size: 0.875rem;
    color: #6b7280;
    background: #f9fafb;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* Help Panel */
.ping-help,
.ping-guide {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.ping-help h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    padding: 0;
    border: none;
}

.ping-help ul {
    margin: 0 0 1rem 0;
    padding-left: 1.5rem;
}

.ping-help li {
    margin-bottom: 0.5rem;
}

.ping-tip {
    padding: 0.75rem;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    color: #1e40af;
}

/* Input Area */
.ping-input-area {
    padding: 1.5rem;
}

.ping-url-input {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

#ping-url-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: #fafafa;
}

#ping-url-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ping-input-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.ping-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.ping-status-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #f59e0b;
}

.ping-status-dot.waiting {
    background: #f59e0b;
}

.ping-status-dot.ready {
    background: #10b981;
}

.ping-status-dot.testing {
    background: #3b82f6;
    animation: ping-pulse 1.5s infinite;
}

/* Stats Grid */
.ping-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1.5rem;
}

.ping-stat {
    text-align: center;
}

.ping-stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.ping-stat-label {
    font-size: 0.75rem;
    color: #6b7280;
}

.ping-stat-primary {
    color: #3b82f6;
}

.ping-stat-green {
    color: #10b981;
}

.ping-stat-yellow {
    color: #f59e0b;
}

.ping-stat-red {
    color: #ef4444;
}

/* Waiting State */
.ping-waiting {
    padding: 3rem 1.5rem;
}

.ping-waiting-content {
    text-align: center;
}

.ping-waiting-content svg {
    color: #9ca3af;
    margin-bottom: 1rem;
}

.ping-waiting-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: #111827;
    padding: 0;
    border: none;
}

.ping-waiting-content p {
    margin: 0;
    color: #6b7280;
}

/* Loading State */
.ping-loading-content {
    padding: 2rem;
    text-align: center;
}

.ping-loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: ping-spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.ping-progress {
    width: 100%;
    height: 0.5rem;
    background: #e5e7eb;
    border-radius: 0.25rem;
    overflow: hidden;
    margin-top: 1rem;
}

.ping-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #10b981);
    width: 0;
    border-radius: 0.25rem;
}

/* Results Table */
.ping-table-container {
    overflow-x: auto;
}

.ping-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.ping-results-table th,
.ping-results-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.ping-results-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ping-results-table tbody tr:hover {
    background: #f9fafb;
}

/* Table Cell Styles */
.ping-location {
    font-weight: 500;
    min-width: 140px;
}

.ping-ip {
    font-family: monospace;
    color: #6b7280;
    font-size: 0.75rem;
}

.ping-status {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.ping-status.success {
    background: #dcfce7;
    color: #166534;
}

.ping-status.failed {
    background: #fef2f2;
    color: #dc2626;
}

.ping-packet-loss {
    text-align: center;
    font-weight: 600;
}

.ping-packet-loss.no-loss {
    color: #10b981;
}

.ping-packet-loss.medium-loss {
    color: #f59e0b;
}

.ping-packet-loss.high-loss {
    color: #ef4444;
}

.ping-rtt {
    text-align: center;
    font-family: monospace;
    color: #6b7280;
}

.ping-response-time {
    text-align: center;
    font-weight: 600;
    font-family: monospace;
}

.ping-response-time.fast {
    color: #10b981;
}

.ping-response-time.medium {
    color: #f59e0b;
}

.ping-response-time.slow {
    color: #ef4444;
}

/* Table Footer */
.ping-table-footer {
    padding: 1rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.ping-legend {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.ping-legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.ping-legend-dot {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
}

.ping-legend-dot.fast {
    background: #10b981;
}

.ping-legend-dot.medium {
    background: #f59e0b;
}

.ping-legend-dot.slow {
    background: #ef4444;
}

/* Error State */
.ping-error-content {
    padding: 3rem 1.5rem;
    text-align: center;
}

.ping-error-icon {
    color: #ef4444;
    margin-bottom: 1rem;
}

.ping-error-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: #111827;
    padding: 0;
    border: none;
}

.ping-error-content p {
    margin: 0 0 1.5rem 0;
    color: #6b7280;
}

/* Loading Animation */
.ping-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: ping-spin 1s linear infinite;
}

@keyframes ping-spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes ping-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes ping-progress {
    0% {
        width: 0%;
    }
    100% {
        width: 100%;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ping-header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .ping-url-input {
        flex-direction: column;
    }
    
    .ping-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ping-results-table {
        font-size: 0.75rem;
    }
    
    .ping-results-table th,
    .ping-results-table td {
        padding: 0.5rem;
    }
    
    .ping-legend {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
}

/* Utilities */
.ping-text-center {
    text-align: center;
}

.ping-text-sm {
    font-size: 0.875rem;
}

.ping-text-xs {
    font-size: 0.75rem;
}

.ping-font-mono {
    font-family: monospace;
}

.ping-font-bold {
    font-weight: 700;
}

.ping-mb-4 {
    margin-bottom: 1rem;
}

.ping-mt-4 {
    margin-top: 1rem;
}

.ping-hidden {
    display: none;
}

/* Results Guide */
.ping-guide h4 {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
}

.ping-guide-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.ping-guide-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.ping-performance-guide {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.ping-performance-guide span {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.ping-perf-excellent {
    background: #dcfce7;
    color: #166534;
}

.ping-perf-good {
    background: #fef3c7;
    color: #92400e;
}

.ping-perf-fair {
    background: #fed7aa;
    color: #9a3412;
}

.ping-perf-slow {
    background: #fecaca;
    color: #991b1b;
}

.ping-loss-guide {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.ping-loss-guide span {
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.ping-loss-good {
    background: #dcfce7;
    color: #166534;
}

.ping-loss-fair {
    background: #fef3c7;
    color: #92400e;
}

.ping-loss-bad {
    background: #fecaca;
    color: #991b1b;
}

.ping-benchmark {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 0.375rem;
}

.ping-benchmark h5 {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e40af;
}

.ping-benchmark ul {
    margin: 0;
    padding-left: 1.25rem;
}

.ping-benchmark li {
    margin-bottom: 0.375rem;
    font-size: 0.75rem;
    color: #1e40af;
}