/**
 * Server Detail Page Styles
 * Version: 1.0.2
 * Extracted from views/server_detail.html to reduce code duplication
 */

.server-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.server-header {
    background: white;
    color: #333;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Server header content layout with map preview */
.server-header-content {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.header-map-preview {
    flex: 0 0 280px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
}

.header-map-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #f0f0f0;
}

.header-map-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 100%);
    color: white;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.header-server-info {
    flex: 1;
    min-width: 0;
}

/* Mobile responsive for header */
@media (max-width: 768px) {
    .server-header-content {
        flex-direction: column;
    }
    
    .header-map-preview {
        flex: none;
        width: 100%;
        max-width: 400px;
    }
    
    .header-map-image {
        height: 160px;
    }
}

.server-name {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.server-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.info-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    position: relative;
}

/* Copy icons in address info-item */
.copy-icons {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.copy-icon-btn {
    background: rgba(102, 126, 234, 0.15);
    border: none;
    border-radius: 4px;
    padding: 4px 5px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    min-height: 16px;
    /* Enhanced touch target for better clickability */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.copy-icon-btn:hover {
    background: rgba(102, 126, 234, 0.3);
    transform: scale(1.08);
}

.copy-icon-btn:active {
    transform: scale(0.95);
}

.copy-icon-btn svg {
    width: 8px;
    height: 8px;
    fill: #667eea;
    pointer-events: none;
}

/* Make address info-item clickable for console command */
.info-item.clickable-address {
    cursor: pointer;
    transition: all 0.2s;
}

.info-item.clickable-address:hover {
    background: #e9ecef;
}

/* Auto-refresh progress bar - compact full width row within header */
.auto-refresh-container {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
}

.auto-refresh-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
    color: #333;
}

.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auto-refresh-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.auto-refresh-progress {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    overflow: hidden;
}

.auto-refresh-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 3px;
    transition: width 1s linear;
}

/* Auto-join settings panel styles */
.auto-join-settings-panel {
    display: none;
    margin-top: 15px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.auto-join-settings-panel h4 {
    margin: 0 0 15px 0;
    font-size: 15px;
    color: #333;
}

.auto-join-settings-panel label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.auto-join-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-join-input {
    width: 80px;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    background: white;
    color: #333;
    font-size: 14px;
}

.auto-join-input-hint {
    font-size: 13px;
    color: #666;
}

.auto-join-preview {
    margin-top: 12px;
    padding: 10px;
    background: rgba(76, 175, 80, 0.1);
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: #333;
}

.auto-join-hint-text {
    margin-top: 8px;
    font-size: 11px;
    color: #999;
    line-height: 1.4;
}

/* Auto-join status panel styles */
.auto-join-status-panel {
    display: none;
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
}

/* Dark mode - auto-join status panel */
[data-theme="dark"] .auto-join-status-panel {
    background: #2d2d2d;
}

[data-theme="dark"] .auto-join-status-info {
    color: #aaa;
}

[data-theme="dark"] .auto-join-status-footer {
    border-top-color: #444;
}

[data-theme="dark"] .auto-join-status-footer span {
    color: #aaa;
}

[data-theme="dark"] .auto-join-status-footer a {
    color: #a8bbff;
}

.auto-join-status-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auto-join-status-info {
    margin-top: 10px;
    font-size: 12px;
    color: #666;
}

.auto-join-status-footer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
    font-size: 12px;
}

.auto-join-status-footer span {
    color: #666;
}

.auto-join-status-footer a {
    margin-left: 10px;
    color: #667eea;
    text-decoration: underline;
}

.info-label {
    font-size: 12px;
    opacity: 0.8;
    margin-bottom: 5px;
}

.info-value {
    font-size: 20px;
    font-weight: bold;
}

/* Player count with progress bar */
.player-count-container {
    margin-top: 20px;
}

.player-progress-bar {
    height: 12px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 10px;
}

.player-progress-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 6px;
}

.player-progress-fill.status-green {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
}

.player-progress-fill.status-yellow {
    background: linear-gradient(90deg, #FF9800, #FFC107);
}

.player-progress-fill.status-red {
    background: linear-gradient(90deg, #f44336, #E91E63);
}

.player-count-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
}

/* Action buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    min-height: 52px;
    /* Enhanced touch target for better clickability */
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.btn-join {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.btn-join:hover {
    background: linear-gradient(135deg, #45a049 0%, #388e3c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-copy {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.btn-copy:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4190 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-steam-china {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.btn-steam-china:hover {
    background: #c62828;
    transform: translateY(-2px);
}

/* Favorite button */
.btn-favorite {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    color: #333333;
    border: none;
    text-shadow: none;
}

.btn-favorite:hover {
    background: linear-gradient(135deg, #bdbdbd 0%, #9e9e9e 100%);
    transform: translateY(-2px);
}

.btn-favorite.favorited {
    background: linear-gradient(135deg, #FF6B6B 0%, #ee5a5a 100%);
    border-color: transparent;
}

.btn-favorite.favorited:hover {
    background: linear-gradient(135deg, #ee5a5a 0%, #dc4a4a 100%);
}

/* Auto-join button */
.btn-auto-join {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    color: white;
}

.btn-auto-join:hover {
    background: linear-gradient(135deg, #F57C00 0%, #E65100 100%);
    transform: translateY(-2px);
}

.btn-auto-join.active {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(76, 175, 80, 0); }
    100% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0); }
}

.auto-join-spinner-wrapper {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 152, 0, 0.08);
}

[data-theme="dark"] .auto-join-spinner-wrapper {
    background: rgba(255, 152, 0, 0.26);
}

.auto-join-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 152, 0, 0.35);
    border-top-color: #FF9800;
    border-right-color: #FFB74D;
    border-radius: 50%;
    animation: autoJoinSpin 1s linear infinite;
    display: inline-block;
}

/* Dark mode - auto-join spinner uses orange color for better visibility */
[data-theme="dark"] .auto-join-spinner {
    border: 3px solid rgba(255, 152, 0, 0.28);
    border-top-color: #FFB74D;
    border-right-color: #FFC107;
    box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.35), 0 0 6px rgba(255, 152, 0, 0.55);
}

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

/* Modal styles (aligned with server list) */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.modal-close:hover { color: #333; }

.modal-body { padding: 20px; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
}

.modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.modal-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.modal-btn-cancel:hover { background: #e0e0e0; }

.modal-btn-confirm {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.modal-btn-confirm:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4190 100%);
}

/* Dark Mode Support for Modal */
[data-theme="dark"] .modal-content {
    background: var(--dark-bg-card);
    box-shadow: 0 4px 20px var(--dark-shadow);
}

[data-theme="dark"] .modal-header {
    border-bottom: 1px solid var(--dark-border-color);
}

[data-theme="dark"] .modal-header h3 {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .modal-close {
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .modal-close:hover {
    color: var(--dark-text-primary);
}

[data-theme="dark"] .modal-footer {
    border-top: 1px solid var(--dark-border-color);
}

[data-theme="dark"] .modal-btn-cancel {
    background: var(--dark-bg-tertiary);
    color: var(--dark-text-secondary);
}

[data-theme="dark"] .modal-btn-cancel:hover {
    background: var(--dark-bg-hover);
}

[data-theme="dark"] .modal-btn-confirm {
    background: linear-gradient(135deg, var(--dark-accent-primary) 0%, var(--dark-accent-secondary) 100%);
}

[data-theme="dark"] .modal-btn-confirm:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4190 100%);
}

/* AI Evaluate button - Enhanced Prominence */
.btn-ai-evaluate {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%) !important;
    color: white !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4), 0 0 0 0 rgba(156, 39, 176, 0.5);
    animation: aiEvaluatePulse 2s infinite;
    position: relative;
    overflow: hidden;
}

.btn-ai-evaluate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: aiEvaluateShine 3s infinite;
}

@keyframes aiEvaluatePulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(156, 39, 176, 0.4), 0 0 0 0 rgba(156, 39, 176, 0.5);
    }
    50% {
        box-shadow: 0 6px 20px rgba(156, 39, 176, 0.5), 0 0 0 8px rgba(156, 39, 176, 0);
    }
}

@keyframes aiEvaluateShine {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

.btn-ai-evaluate:hover {
    background: linear-gradient(135deg, #7B1FA2 0%, #6A1B9A 100%) !important;
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 8px 25px rgba(156, 39, 176, 0.5) !important;
}

.btn-ai-evaluate:disabled,
.btn-ai-evaluate:disabled::before {
    animation: none;
}

.btn-ai-evaluate:disabled {
    background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%) !important;
    cursor: not-allowed;
    transform: none;
}

/* AI Evaluation Result Card */
.ai-evaluation-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    display: none;
}

.ai-evaluation-card.visible {
    display: block;
}

.ai-evaluation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.ai-evaluation-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-evaluation-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
    white-space: pre-wrap;
    min-height: 60px;
}

.ai-evaluation-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #9C27B0;
}

.ai-evaluation-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(156, 39, 176, 0.2);
    border-top-color: #9C27B0;
    border-radius: 50%;
    animation: autoJoinSpin 1s linear infinite;
    display: inline-block;
}

.ai-queue-status {
    margin-top: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 8px;
    color: #1565c0;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-queue-status::before {
    content: '⏳';
}

.ai-evaluation-error {
    color: #f44336;
    background: #ffebee;
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.5;
}

.ai-retry-btn {
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.ai-retry-btn:hover {
    background: linear-gradient(135deg, #7B1FA2 0%, #6A1B9A 100%);
}

/* AI History Button */
.btn-ai-history {
    background: linear-gradient(135deg, #8E24AA 0%, #6A1B9A 100%);
    box-shadow: 0 2px 8px rgba(142, 36, 170, 0.3);
}

.btn-ai-history:hover {
    background: linear-gradient(135deg, #7B1FA2 0%, #5E1691 100%);
    box-shadow: 0 4px 12px rgba(142, 36, 170, 0.4);
    transform: translateY(-1px);
}

/* AI History Modal */
.ai-history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.ai-history-modal.visible {
    display: flex;
}

.ai-history-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.ai-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #9C27B0 0%, #7B1FA2 100%);
    color: white;
}

.ai-history-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-history-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-history-close:hover {
    background: rgba(255,255,255,0.3);
}

.ai-history-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
    background: white;
}

.ai-history-empty {
    text-align: center;
    color: #999;
    padding: 40px;
}

.ai-history-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #e9ecef;
}

.ai-history-item:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ai-history-item:last-child {
    margin-bottom: 0;
}

.ai-history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: #666;
}

.ai-history-item-time {
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-history-item-preview {
    color: #333;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.ai-history-item-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #f8f9fa);
}

.ai-history-item.expanded .ai-history-item-preview {
    max-height: none;
}

.ai-history-item.expanded .ai-history-item-preview::after {
    display: none;
}

/* AI Summary Button in Title */
.ai-summary-title-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
}

.ai-summary-title-btn:hover {
    background: linear-gradient(135deg, #43A047 0%, #1B5E20 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(46, 125, 50, 0.4);
}

.ai-summary-title-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.ai-summary-title-btn svg {
    flex-shrink: 0;
}

/* AI Summary Modal */
.ai-summary-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.ai-summary-modal.visible {
    display: flex;
}

.ai-summary-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.ai-summary-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
}

.ai-summary-modal-header h3 {
    margin: 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-summary-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-summary-modal-close:hover {
    background: rgba(255,255,255,0.3);
}

.ai-summary-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 150px;
    max-height: calc(80vh - 140px);
}

.ai-summary-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #4CAF50;
    padding: 20px 0;
}

.ai-summary-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(76, 175, 80, 0.2);
    border-top-color: #4CAF50;
    border-radius: 50%;
    animation: autoJoinSpin 1s linear infinite;
    display: inline-block;
}

.ai-summary-queue-status {
    margin-top: 10px;
    padding: 10px 15px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 8px;
    color: #2E7D32;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-summary-queue-status::before {
    content: '⏳';
}

.ai-summary-result {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-summary-error {
    color: #d32f2f;
    background: #ffebee;
    padding: 15px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.5;
}

.ai-summary-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.ai-summary-retry-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.ai-summary-retry-btn:hover {
    background: linear-gradient(135deg, #43A047 0%, #1B5E20 100%);
}

.ai-summary-close-btn {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.ai-summary-close-btn:hover {
    background: #d0d0d0;
}

/* Mobile responsive for AI Summary */
@media (max-width: 768px) {
    .ai-summary-title-btn {
        margin-left: 8px;
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .ai-summary-title-btn svg {
        width: 14px;
        height: 14px;
    }
    
    .ai-summary-modal-content {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .ai-summary-modal-body {
        max-height: calc(90vh - 140px);
    }
}

/* Map Preview */
.map-preview-section {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
}

.map-preview-container {
    flex: 0 0 300px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.map-preview-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: #f0f0f0;
}

.map-info-container {
    flex: 1;
}

/* Cards */
.info-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.info-card h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Extended Server Info Grid */
.extended-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.extended-info-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.extended-info-item .label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

.extended-info-item .value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #e8f5e9;
    color: #4CAF50;
}

.badge-warning {
    background: #fff3e0;
    color: #ff9800;
}

.badge-danger {
    background: #ffebee;
    color: #f44336;
}

/* CS2 Player List Plugin Hint */
.cs2-plugin-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    width: 18px;
    height: 18px;
    color: #999;
    text-decoration: none;
    transition: all 0.2s;
}

.cs2-plugin-hint:hover {
    color: #667eea;
}

.cs2-plugin-hint svg {
    flex-shrink: 0;
}

/* CS2 Plugin Notice Text (inline after question mark) */
.cs2-plugin-notice-inline {
    font-size: 12px;
    color: #999;
    font-weight: normal;
    margin-left: 4px;
}

.cs2-plugin-notice-inline a {
    color: #999;
    text-decoration: none;
    transition: color 0.2s;
}

.cs2-plugin-notice-inline a:hover {
    color: #667eea;
    text-decoration: underline;
}

/* Players List */
.players-section {
    margin-top: 20px;
}

.players-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.refresh-btn {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: #5568d3;
}

.refresh-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* New Grid-based Player List */
.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 10px 0;
}

.player-masking-hint {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff3cd 0%, #fffadc 100%);
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 10px 15px;
    color: #856404;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.player-card {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 12px 15px;
    transition: all 0.2s ease;
    border: 1px solid #e0e0e0;
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.player-rank {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    margin-right: 12px;
    flex-shrink: 0;
}

.player-rank.top-3 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
}

.player-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.player-name {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.player-stats {
    display: flex;
    gap: 12px;
    margin-top: 4px;
    font-size: 12px;
    color: #666;
}

.player-stat {
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-stat svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

.players-table {
    width: 100%;
    border-collapse: collapse;
}

.players-table th,
.players-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.players-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.players-table tr:hover {
    background: #f5f5f5;
}

.rate-limit-warning {
    color: #ff9800;
    font-size: 12px;
    margin-top: 10px;
}

/* Map Statistics Chart */
.map-chart-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.map-chart-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.map-chart-tab {
    padding: 12px 24px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.map-chart-tab.active {
    color: #4CAF50;
    border-bottom-color: #4CAF50;
    font-weight: bold;
}

.map-chart-tab:hover {
    color: #4CAF50;
}

.map-chart-container {
    height: 400px;
    position: relative;
}

.chart-section {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

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

.chart-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.chart-tab {
    padding: 12px 24px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.chart-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: bold;
}

.chart-tab:hover {
    color: #667eea;
}

/* Custom date range picker */
.custom-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.date-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-input-group label {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.date-input {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    color: #333;
    background: white;
    transition: border-color 0.2s;
}

.date-input:focus {
    outline: none;
    border-color: #667eea;
}

.date-apply-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.date-apply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.date-apply-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.date-reset-btn {
    padding: 8px 12px;
    background: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.date-reset-btn:hover {
    background: #e0e0e0;
}

/* Mobile responsive for date range */
@media (max-width: 768px) {
    .chart-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .custom-date-range {
        width: 100%;
    }
    
    .date-input-group {
        flex: 1;
        min-width: 0;
    }
    
    .date-input {
        width: 100%;
        min-width: 0;
    }
}

.chart-container {
    height: 400px;
    position: relative;
}

.loading {
    text-align: center;
    padding: 50px;
    color: #999;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    margin-top: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 15px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
}

.back-link:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
    color: white;
}

.back-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .back-link {
        padding: 14px 20px;
        font-size: 14px;
        width: calc(100% - 40px);
        justify-content: center;
        margin-left: 0;
        margin-right: 0;
    }
    
    /* Enhanced mobile button sizes */
    .action-btn {
        padding: 18px 24px;
        font-size: 15px;
        min-height: 56px;
        width: 100%;
        justify-content: center;
    }
    
    .copy-icon-btn {
        min-width: 18px;
        min-height: 18px;
        padding: 5px;
    }
    
    .copy-icon-btn svg {
        width: 10px;
        height: 10px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}

.no-data {
    text-align: center;
    padding: 50px;
    color: #999;
    font-size: 16px;
}

/* Map History Timeline */
.map-history-timeline {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

.map-history-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
    gap: 12px;
    cursor: pointer;
}

.map-history-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.map-history-item.current-map {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-color: #4CAF50;
}

.map-history-main {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.map-history-time {
    font-size: 11px;
    color: #666;
    font-weight: 500;
    flex-shrink: 0;
}

.map-history-arrow {
    color: #4CAF50;
    font-size: 12px;
    flex-shrink: 0;
}

.map-history-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.map-history-brief-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 11px;
    color: #666;
    flex-shrink: 0;
}

.map-history-duration {
    color: #667eea;
    font-weight: 600;
}

.map-history-duration.running {
    color: #4CAF50;
}

.map-history-avg {
    color: #333;
    font-weight: 500;
}

.map-history-detail-btn {
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}

.map-history-detail-btn:hover {
    background: #5568d3;
}

.map-history-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Map History Pagination */
.map-history-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.map-history-page-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.map-history-page-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.map-history-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.map-history-page-info {
    color: #666;
    font-size: 14px;
}

/* Map Session Detail Modal */
.map-session-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    justify-content: center;
    align-items: center;
}

.map-session-modal.active {
    display: flex;
}

.map-session-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.map-session-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px 12px 0 0;
    color: white;
}

.map-session-modal-title {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.map-session-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.map-session-modal-close:hover {
    opacity: 1;
}

.map-session-modal-body {
    padding: 20px;
}

.map-session-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.map-session-stat-item {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.map-session-stat-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
}

.map-session-stat-value {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.map-session-stat-value.highlight {
    color: #667eea;
}

.map-session-chart-section {
    margin-top: 15px;
}

.map-session-chart-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-session-sparkline {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 60px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
}

.map-session-sparkline-bar {
    flex: 1;
    background: linear-gradient(to top, #667eea, #a8bbff);
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}

/* Map session modal chart container */
.map-session-chart-container {
    height: 150px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 10px;
}

/* Mobile responsive for map history */
@media (max-width: 768px) {
    .map-history-item {
        flex-wrap: wrap;
    }
    
    .map-history-brief-stats {
        width: 100%;
        justify-content: flex-start;
        margin-top: 5px;
    }
    
    .map-session-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Login Modal Styles */
.login-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.login-modal-overlay.active {
    display: flex;
}

.login-modal {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    animation: loginModalSlideIn 0.3s ease;
}

@keyframes loginModalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-modal-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.login-modal-icon svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.login-modal h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 10px;
}

.login-modal p {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.login-modal-buttons {
    display: flex;
    gap: 12px;
    flex-direction: column;
}

.login-modal-btn {
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-modal-btn.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.login-modal-btn.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.login-modal-btn.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

.login-modal-btn.btn-secondary:hover {
    background: #e0e0e0;
}
