/* Room Management Styles */

.room-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

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

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

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

.modal-header h2 {
    margin: 0;
    color: #333;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 30px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s;
}

.close-btn:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    background: white;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.room-code-help {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
    font-style: italic;
}

.modal-footer {
    padding: 20px 30px 30px;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-primary,
.btn-secondary {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}

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

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

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #ced4da;
}

/* Room Lobby Styles */
.room-lobby {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.room-lobby.hidden {
    display: none;
}

.lobby-header {
    background: rgba(255, 255, 255, 0.1);
    padding: 20px 30px;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.lobby-info h2 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 1.8rem;
}

.room-code-display {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.room-code-display span {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 2px;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

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

.leave-room-btn {
    background: rgba(231, 76, 60, 0.8);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.leave-room-btn:hover {
    background: rgba(231, 76, 60, 1);
    transform: translateY(-2px);
}

.lobby-content {
    flex: 1;
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.players-section,
.game-selection {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    height: fit-content;
}

.players-section h3,
.game-selection h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3rem;
}

.players-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.player-card {
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    transition: all 0.3s;
}

.player-card:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    font-weight: bold;
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: bold;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.host-badge {
    background: linear-gradient(135deg, #f1c40f, #f39c12);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 5px;
    display: inline-block;
}

.player-status {
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
}

.status-ready {
    background: rgba(39, 174, 96, 0.2);
    color: #27ae60;
}

.status-waiting {
    background: rgba(241, 196, 15, 0.2);
    color: #f1c40f;
}

.kick-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(231, 76, 60, 0.8);
    border: none;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.kick-btn:hover {
    background: rgba(231, 76, 60, 1);
    transform: scale(1.1);
}

.game-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
}

.game-option {
    background: #f8f9fa;
    border: 3px solid #e0e0e0;
    border-radius: 15px;
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    min-height: 100px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.game-option:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.game-option.selected {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.game-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.game-name {
    font-weight: 600;
    font-size: 0.9rem;
}

.lobby-actions {
    grid-column: 1 / -1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
}

.btn-large {
    padding: 18px 40px;
    font-size: 1.2rem;
    border-radius: 15px;
}

.host-controls {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.player-status {
    display: flex;
    justify-content: center;
    align-items: center;
}

.status-text {
    font-size: 1.1rem;
    color: #666;
    font-style: italic;
}

.lobby-chat {
    background: rgba(255, 255, 255, 0.95);
    margin: 0 30px 30px;
    border-radius: 20px;
    padding: 20px;
    max-height: 200px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    min-height: 100px;
}

.chat-message {
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 10px;
}

.message-author {
    font-weight: bold;
    color: #667eea;
}

.message-text {
    margin-left: 10px;
}

.chat-input {
    display: flex;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
}

.chat-input button {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
}

.chat-input button:hover {
    background: #5a6fe8;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 600;
    z-index: 1001;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.notification-error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.notification-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .lobby-content {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 20px;
    }
    
    .lobby-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body,
    .modal-footer {
        padding: 20px;
    }
    
    .game-options {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .game-option {
        padding: 15px 10px;
        min-height: 80px;
    }
    
    .game-icon {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }
    
    .game-name {
        font-size: 0.8rem;
    }
    
    .host-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .btn-large {
        width: 100%;
        padding: 15px 30px;
        font-size: 1.1rem;
    }
    
    .players-grid {
        gap: 10px;
    }
    
    .player-card {
        padding: 12px;
    }
    
    .player-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .lobby-chat {
        margin: 0 20px 20px;
        max-height: 150px;
    }
}

@media (max-width: 480px) {
    .game-options {
        grid-template-columns: 1fr;
    }
    
    .room-code-display {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }
    
    .lobby-header {
        padding: 10px 15px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        transform: translateY(-100px);
    }
    
    .notification.show {
        transform: translateY(0);
    }
}