body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    color: #000000;
    padding: 0;
    margin: 0;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background-color: #f9f9f9;
}

.header.dark-mode {
    background-color: #222222;
}

body.dark-mode {
    background-color: #222222;
    color: #f9f9f9;
}

.buttons-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 10px;
    gap: 10px;
}

#endpointContainer {
    display: none;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    color: #000000;
}

#endpointContainer.dark-mode {
    background-color: #333333;
    color: #f9f9f9;
}

button {
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #007BFF;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s;
}

button.dark-mode {
    background-color: #f9f9f9;
    color: #222222;
}

button:hover {
    background-color: #0056b3;
}

button.dark-mode:hover {
    background-color: #dddddd;
}

.material-icons {
    cursor: pointer;
    font-size: 30px;
    transition: color 0.3s;
}

.material-icons.dark-mode {
    color: #f9f9f9;
}

.material-icons:hover {
    color: #0056b3;
}

.material-icons.dark-mode:hover {
    color: #dddddd;
}

.continent-header {
    font-weight: bold;
    font-size: 18px;
    margin-top: 15px;
    padding: 5px;
    border-bottom: 1px solid #ddd;
}

.continent-header.dark-mode {
    border-bottom-color: #555;
}

#regionContainer .region {
    font-size: 18px;
    color: #333;
    background-color: #f9f9f9;
    padding: 10px;
    margin: 5px 0;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
}

.region.dark-mode {
    background-color: #444;
    color: #f9f9f9;
}

.region-name {
    flex: 1;
    padding-right: 15px; /* Add space between name and ping time */
}

.ping-time {
    font-weight: bold;
    min-width: 90px; /* Set minimum width for consistent alignment */
    text-align: right; /* Right align the ping times */
    cursor: help; /* Show help cursor when hovering over multi-run results */
}

/* Add tooltip styling */
.ping-time[title] {
    position: relative;
    border-bottom: 1px dotted #999;
}

/* Add a pinging animation style */
.region .ping-time:contains("Pinging") {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #007BFF;
    animation: spin 1s linear infinite;
}

.dark-mode .spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: #f9f9f9;
}

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

.hidden {
    display: none !important;
}

#summaryContainer {
    max-width: 800px;
    margin: 20px auto;
    padding: 15px;
    background-color: #ffffff;
    box-shadow: 0px 0px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    text-align: center;
    color: #000000; /* Explicitly set text color for light mode */
}

#summaryContainer.dark-mode {
    background-color: #333333;
    color: #f9f9f9; /* Light text for dark mode */
    box-shadow: 0px 0px 10px rgba(255,255,255,0.1);
}

.error {
    color: #e74c3c;
    font-style: italic;
}

/* Progress indicator in summary */
.progress-bar {
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    margin-top: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: #007BFF;
    border-radius: 5px;
    transition: width 0.3s ease;
}

.dark-mode .progress-bar {
    background-color: #444;
}

.dark-mode .progress-bar-fill {
    background-color: #4da6ff;
}

/* Add a run indicator style */
.run-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    background-color: #ccc;
}

.run-indicator.active {
    background-color: #007BFF;
}

.dark-mode .run-indicator.active {
    background-color: #4da6ff;
}

.note {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-top: 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.dark-mode .note {
    color: #aaa;
}
