.server-stats-dashboard {
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #f0f0f0;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.controls-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 12px;
}

.time-range-selector {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.time-range-btn {
    background: rgba(106, 27, 154, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(106, 27, 154, 0.5);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.time-range-btn:hover {
    background: rgba(106, 27, 154, 0.3);
}

.time-range-btn.active {
    background: rgba(106, 27, 154, 0.7);
    color: white;
    border-color: rgba(106, 27, 154, 1);
}

.last-updated {
    font-size: 0.85rem;
    opacity: 0.8;
}

.realtime-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 30, 40, 0.6);
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 12px;
}

.server-info-container {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.server-icon {
    width: 64px;
    height: 64px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.server-icon-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.server-status-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex-grow: 1;
}

.server-ip-box {
    position: relative;
    display: flex;
    align-items: center;
}

.server-ip {
    background: rgba(20, 20, 30, 0.6);
    border: 1px solid rgba(106, 27, 154, 0.5);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.3px;
    cursor: pointer;
    width: auto;
}

.server-ip:focus {
    outline: none;
    border-color: rgba(106, 27, 154, 0.8);
}

.copy-ip-text {
    position: absolute;
    right: 12px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

.copied-notification {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(106, 27, 154, 0.9);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.copied-notification.show {
    opacity: 1;
}

.server-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f44336;
    box-shadow: 0 0 8px #f44336;
    flex-shrink: 0;
}

.status-indicator.online {
    background: #4caf50;
    box-shadow: 0 0 8px #4caf50;
}

.status-text {
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1;
}

.player-count {
    font-size: 1.2rem;
    font-weight: bold;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.current-count {
    color: #ffffff;
}

.quick-metrics {
    display: flex;
    gap: 20px;
}

.metric {
    text-align: center;
}

.metric-label {
    font-size: 0.8rem;
    opacity: 0.7;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: bold;
}

.motd-line {
    margin: 2px 0;
    line-height: 1.3;
}
.motd-display {
    font-size: 0.9rem;
    line-height: 1.4;
    white-space: pre-wrap; /* Allows line breaks from \n */
    word-wrap: break-word;
    color: #ddd; /* Slightly lighter than main text for emphasis */
    text-align: left; /* Align MOTD to the left */
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.chart-card {
    background: rgba(30, 30, 40, 0.6);
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.chart-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 20, 30, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(106, 27, 154, 0.3);
    border-top-color: #6a1b9a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-message {
    background-color: #d32f2f; /* Material Design error red */
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    text-align: center;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.health-status-container {
    margin-top: 20px;
    padding: 15px;
    background: rgba(30, 30, 40, 0.6);
    border-radius: 6px;
}

.health-status-title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #e0e0e0;
}

.health-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

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

.health-name {
    font-size: 0.95rem;
}

.health-value {
    font-weight: 500;
}

.health-value.healthy { color: #4caf50; } /* Green */
.health-value.unhealthy { color: #f44336; } /* Red */
.health-value.degraded { color: #ff9800; } /* Orange */

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .controls-container, .realtime-stats, .dashboard-header {
        flex-direction: column;
        align-items: stretch;
    }
    .time-range-selector {
        justify-content: center;
    }
    .quick-metrics {
        justify-content: space-around;
        gap: 10px;
    }
    .metric {
        flex-grow: 1;
    }
    
    /* Server Status - Tablet */
    .server-info-container {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .server-icon {
        margin-bottom: 10px;
    }
    
    .server-status-container {
        width: 100%;
        align-items: center;
    }
    
    .server-ip {
        font-size: 0.85rem;
        padding: 6px 10px;
        max-width: 100%;
    }
    
    .server-status {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .player-count {
        font-size: 1rem;
        letter-spacing: -0.3px;
    }
    .metric-value {
        font-size: 1rem;
    }
    .chart-title, .health-status-title {
        font-size: 1rem;
    }
    .time-range-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    /* Server Status - Mobile */
    .server-icon {
        width: 48px;
        height: 48px;
    }
    
    .server-ip {
        font-size: 0.8rem;
        padding: 6px 8px;
        letter-spacing: 0.2px;
    }
    
    .copy-ip-text {
        display: none;
    }
    
    .status-indicator {
        width: 8px;
        height: 8px;
    }
    
    .status-text {
        font-size: 0.85rem;
    }
    
    .server-status {
        gap: 8px;
        flex-wrap: wrap;
    }
    
    .motd-display {
        font-size: 0.8rem;
    }
}

.rules-card .building-guidelines-grid a {
  color: #ffffff;
  font-weight: bold;
  text-decoration: underline;
}
