* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
}

.login-container {
    max-width: 500px;
    margin: 100px auto;
    padding: 40px;
    background: #2a2a2a;
    border-radius: 8px;
    text-align: center;
}

.login-container h1 {
    margin-bottom: 20px;
    color: #4CAF50;
}

.chat-container {
    max-width: 900px;
    margin: 20px auto;
    height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    background: #2a2a2a;
    border-radius: 8px;
    overflow: hidden;
}

.chat-header {
    background: #1e1e1e;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #4CAF50;
}

.server-info h2 {
    color: #4CAF50;
    font-size: 1.2em;
    margin-bottom: 5px;
}

.status {
    font-size: 0.9em;
    padding: 3px 8px;
    border-radius: 3px;
}

.status.online { color: #4CAF50; }
.status.offline { color: #f44336; }

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.btn-logout {
    padding: 5px 12px;
    background: #444;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
}

.btn-logout:hover {
    background: #555;
}

/* Server tabs */
.server-tabs {
    display: flex;
    background: #1e1e1e;
    border-bottom: 2px solid #333;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    background: #252525;
    border: none;
    border-right: 1px solid #333;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    transition: all 0.2s;
}

.tab-btn:hover {
    background: #2a2a2a;
    color: #e0e0e0;
}

.tab-btn.active {
    background: #1a1a1a;
    color: #4CAF50;
    border-bottom: 2px solid #4CAF50;
}

.tab-name {
    font-weight: 500;
}

.tab-status {
    font-size: 0.8em;
}

.tab-badge {
    background: #f44336;
    color: white;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Chat panels */
.chat-panel {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.chat-panel.active {
    display: flex;
}

.server-details {
    padding: 10px 15px;
    background: #252525;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    font-size: 0.9em;
    color: #999;
}

.server-ip {
    font-family: monospace;
}

.server-players {
    font-weight: 500;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #1a1a1a;
}

.message {
    padding: 8px 12px;
    margin-bottom: 8px;
    border-radius: 4px;
    line-height: 1.4;
}

.message-chat {
    background: #2a2a2a;
}

.message-join, .message-leave, .message-mapend {
    background: #252525;
    font-style: italic;
}

.message-error {
    background: #3d1f1f !important;
    border-left: 3px solid #f44336;
    animation: fadeIn 0.3s;
}

.system-error {
    color: #ff6b6b;
    font-weight: 500;
}

.time {
    color: #888;
    font-size: 0.85em;
    margin-right: 8px;
}

.status-icon {
    margin-right: 5px;
}

.name {
    font-weight: bold;
    color: #4CAF50;
    margin-right: 8px;
}

.clickable-name {
    cursor: pointer;
    text-decoration: underline;
    text-decoration-style: dotted;
}

.clickable-name:hover {
    text-decoration-style: solid;
    color: #66B2FF;
}

.system {
    color: #999;
}

.chat-input-container {
    padding: 15px;
    background: #1e1e1e;
    border-top: 1px solid #333;
    display: flex;
    gap: 10px;
    align-items: center;
}

.chat-input {
    flex: 1;
    padding: 10px;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.chat-input:focus {
    outline: none;
    border-color: #4CAF50;
}

.send-btn {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.send-btn:hover {
    background: #45a049;
}

.send-btn:disabled {
    background: #666;
    cursor: not-allowed;
}

.char-count {
    color: #888;
    font-size: 0.85em;
}

.rate-limit-indicator {
    font-size: 0.85em;
    color: #999;
    margin-left: 10px;
}

.chat-footer {
    padding: 8px 15px;
    background: #1e1e1e;
    text-align: center;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #2a2a2a;
    margin: 5% auto;
    padding: 0;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideIn 0.3s;
}

.modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    padding: 10px 20px;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.modal-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.modal-error {
    text-align: center;
    padding: 40px;
    color: #f44336;
}

/* Player stats */
.player-stats-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #444;
}

.player-stats-avatar {
    width: 128px;
    height: 128px;
    border-radius: 8px;
    border: 2px solid #4CAF50;
}

.player-stats-info h2 {
    margin: 0 0 10px 0;
    color: #4CAF50;
}

.player-stats-steamid {
    font-family: monospace;
    color: #888;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.player-stats-country {
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-stats-country .flag {
    height: 16px;
    width: 16px;
}

.flag {
    height: 1em;
    margin-right: 5px;
    vertical-align: middle;
}

.player-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 5px;
    text-align: center;
    border: 2px solid #444;
}

.stat-card.gold {
    border-color: #ffd700;
    background: linear-gradient(135deg, #1e1e1e 0%, #332200 100%);
}

.stat-card.silver {
    border-color: #c0c0c0;
    background: linear-gradient(135deg, #1e1e1e 0%, #2a2a2a 100%);
}

.stat-card.bronze {
    border-color: #cd7f32;
    background: linear-gradient(135deg, #1e1e1e 0%, #2d1f10 100%);
}

.stat-label {
    font-size: 0.85em;
    color: #888;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5em;
    font-weight: bold;
    color: #fff;
}

.player-stats-dates {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.stat-date {
    margin: 8px 0;
    color: #aaa;
}

.player-stats-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-steam,
.btn-stats {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    background: #4CAF50;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
    transition: background 0.2s;
}

.btn-steam:hover {
    background: #45a049;
}

.btn-stats {
    background: #2196F3;
}

.btn-stats:hover {
    background: #0b7dda;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* Mobile responsive */
@media (max-width: 768px) {
    .tab-btn {
        min-width: 100px;
        padding: 10px 15px;
        font-size: 0.9em;
    }
    
    .server-details {
        flex-direction: column;
        gap: 5px;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .player-stats-header {
        flex-direction: column;
        text-align: center;
    }
    
    .player-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .player-stats-links {
        flex-direction: column;
    }
    
    .btn-steam,
    .btn-stats {
        min-width: 100%;
    }
}
