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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: rgba(30, 30, 46, 0.9);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    padding: 30px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #3498db;
}

header h1 {
    font-size: 2.8rem;
    color: #3498db;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.1rem;
    color: #95a5a6;
    font-style: italic;
}

/* Controls */
.controls {
    background: rgba(40, 40, 60, 0.8);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.auth-section {
    background: rgba(44, 62, 80, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.auth-section h3 {
    color: #e74c3c;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

#loginForm {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

#loginForm input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #34495e;
    border-radius: 8px;
    background: #2c3e50;
    color: white;
    font-size: 1rem;
}

#loginForm input:focus {
    outline: none;
    border-color: #3498db;
}

#loginForm button {
    padding: 12px 25px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

#loginForm button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.data-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: space-between;
}

.server-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(52, 73, 94, 0.8);
    padding: 10px 15px;
    border-radius: 8px;
}

.server-selector label {
    color: #3498db;
    font-weight: bold;
}

#serverSelect {
    padding: 10px 15px;
    background: #2c3e50;
    color: white;
    border: 2px solid #34495e;
    border-radius: 6px;
    min-width: 200px;
}

#refreshBtn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

#refreshBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.4);
}

.status {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #95a5a6;
}

.loading {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error {
    color: #e74c3c;
    margin-top: 10px;
    padding: 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 6px;
    border-left: 4px solid #e74c3c;
}

/* Table */
.table-container {
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(40, 40, 60, 0.8);
    padding: 20px;
    margin-bottom: 30px;
}

#playersTable {
    width: 100%;
    border-collapse: collapse;
    min-width: 400px;
}

#playersTable thead {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

#playersTable th {
    padding: 18px 15px;
    text-align: left;
    font-weight: bold;
    color: white;
    font-size: 1.05rem;
    border-bottom: 3px solid #1a5276;
}

#playersTable th:nth-child(1) {
    width: 70%;
}

#playersTable th:nth-child(2) {
    width: 30%;
    text-align: right;
}

#playersTable td:nth-child(2) {
    text-align: right;
}

#playersTable th i {
    margin-left: 8px;
    opacity: 0.9;
}

#playersTable tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

#playersTable tbody tr:hover {
    background: rgba(52, 152, 219, 0.1);
}

#playersTable td {
    padding: 15px;
    color: #e0e0e0;
}

/* Player name styling */
.player-name {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    color: #3498db;
}

.player-name i {
    color: #f1c40f;
}

.player-avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    border: 2px solid rgba(52, 152, 219, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    background: #2c3e50;
}

/* Metric styling */
.playtime {
    color: #2ecc71;
    font-weight: bold;
    font-size: 1.1rem;
}

.sessions {
    color: #9b59b6;
    font-weight: bold;
}

.last-seen {
    color: #e67e22;
}

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

.activity {
    font-weight: bold;
}

.activity.high {
    color: #2ecc71;
}

.activity.medium {
    color: #f1c40f;
}

.activity.low {
    color: #e74c3c;
}

.ping {
    color: #1abc9c;
}

.registered {
    color: #95a5a6;
    font-size: 0.95rem;
}

/* Loading states */
.loading-row td {
    text-align: center;
    padding: 60px 20px;
}

.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: #95a5a6;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

.no-data i {
    font-size: 4rem;
    margin-bottom: 20px;
    color: #7f8c8d;
}

.no-data h3 {
    color: #bdc3c7;
    margin-bottom: 10px;
}

/* Footer */
footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #95a5a6;
    font-size: 0.95rem;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.timestamp {
    margin-top: 10px;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .data-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .server-selector, #refreshBtn, .status {
        width: 100%;
    }
    
    #loginForm {
        flex-direction: column;
    }
    
    #loginForm input {
        min-width: 100%;
    }
    
    .table-container {
        padding: 10px;
    }
    
    #playersTable th, #playersTable td {
        padding: 12px 8px;
    }
}