/**
 * CSS Styles for WebSocket Real-time Features
 * Match status indicators, quick access, realtime stats, chat notifications
 */

/* Enhanced Chat Notification Badges */
.chat-notification-badge {
    font-size: 0.7em !important;
    min-width: 18px;
    height: 18px;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: notificationPulse 2s infinite;
}

.chat-notification-badge:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

@keyframes notificationPulse {
    0%, 70%, 100% { 
        transform: scale(1); 
        opacity: 1; 
    }
    35% { 
        transform: scale(1.15); 
        opacity: 0.8; 
    }
}

/* Chat Status Panel */
.chat-status-panel {
    background: rgba(15,23,42,0.6);
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid #3b82f6;
}

.chat-status-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.chat-status-conversations {
    max-height: 200px;
    overflow-y: auto;
}

.conversation-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    margin: 4px 0;
    background: rgba(15,23,42,0.4);
    border-radius: 6px;
    border-left: 3px solid #3b82f6;
}

.conversation-item .sender-info {
    font-weight: bold;
    color: #e5e7eb;
}

.conversation-item .message-preview {
    color: #94a3b8;
    font-size: 0.9em;
    margin-top: 2px;
}

.conversation-item .unread-count {
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

/* Match Status Indicator in Header */
.match-status-indicator {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    padding: 12px 20px;
    margin: 10px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    animation: slideDown 0.3s ease-out;
}

.match-status-active {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.match-status-active i {
    font-size: 1.2em;
}

.match-status-active span {
    flex: 1;
    font-weight: 600;
}

.btn-join-match {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9em;
}

.btn-join-match:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* Quick Match Access in Notification Center */
.quick-match-access {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.match-widget {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

.match-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: bold;
    font-size: 1.1em;
}

.match-info p {
    margin: 5px 0;
    font-size: 0.95em;
}

.match-status {
    color: #ffeb3b !important;
    font-weight: 600;
}

.connect-info {
    background: rgba(0,0,0,0.2);
    padding: 8px;
    border-radius: 4px;
    margin: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.connect-info code {
    flex: 1;
    background: none;
    color: #e8f5e8;
    font-size: 0.85em;
}

.btn-copy-small {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8em;
}

.btn-copy-small:hover {
    background: rgba(255,255,255,0.3);
}

.btn-join-full {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.2s;
    width: 100%;
}

.btn-join-full:hover {
    background: #45a049;
    transform: translateY(-1px);
}

/* Real-time Stats Display */
.realtime-stats {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.realtime-stats h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.score-display {
    text-align: center;
    font-size: 3em;
    font-weight: bold;
    margin: 20px 0;
    text-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

.team1-score, .team2-score {
    color: #4CAF50;
}

.score-separator {
    color: #ffd54f;
    margin: 0 20px;
}

.player-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 25px 0;
}

.player-stat-box {
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
}

.player-stat-box h4 {
    text-align: center;
    margin-bottom: 15px;
    color: #ffeb3b;
    font-size: 1.2em;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.stat {
    text-align: center;
    background: rgba(0,0,0,0.2);
    padding: 12px 8px;
    border-radius: 6px;
}

.stat-label {
    display: block;
    font-size: 0.8em;
    color: #bbb;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.3em;
    font-weight: bold;
    color: #fff;
}

.last-updated {
    text-align: center;
    font-size: 0.85em;
    color: #bbb;
    margin-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 10px;
}

/* User Avatar Styles */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    object-fit: cover;
}

.user-avatar-small {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #ddd;
    object-fit: cover;
    margin-right: 8px;
}

.user-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    object-fit: cover;
}

/* Player Card with Avatar */
.player-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    margin: 10px 0;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
    font-size: 1.1em;
    margin-bottom: 4px;
}

.player-status {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Copy Notification */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out, slideOutRight 0.3s ease-out 1.7s;
    animation-fill-mode: forwards;
}

/* Animations */
@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Status Pills */
.status-pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-ready-check { background: #ff9800; color: white; }
.status-server-starting { background: #2196F3; color: white; }
.status-in-progress { background: #4CAF50; color: white; }
.status-completed { background: #9E9E9E; color: white; }

/* Responsive Design */
@media (max-width: 768px) {
    .match-status-active {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .player-stats {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .score-display {
        font-size: 2.5em;
    }
}

@media (max-width: 480px) {
    .realtime-stats {
        padding: 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .score-display {
        font-size: 2em;
    }
}
