/* Chat styles for online game mode */
#chat-container {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 384px; /* 96 * 4rem */
    max-width: 24rem; /* 96 * 0.25rem */
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -2px 4px -1px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    z-index: 50;
}

#chat-container.hidden {
    display: none;
}

#open-chat {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: linear-gradient(to right, var(--primary-color, #ec4899), var(--accent-color, #8b5cf6));
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 40;
}

.chat-header {
    background: linear-gradient(to right, var(--primary-color, #ec4899), var(--accent-color, #8b5cf6));
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem 0.5rem 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background-color: #f9fafb;
}

.chat-message {
    margin-bottom: 1rem;
    max-width: 80%;
}

.chat-message.own {
    margin-left: auto;
    text-align: right;
}

.chat-message.other {
    margin-right: auto;
}

.message-bubble {
    padding: 0.5rem 1rem;
    border-radius: 18px;
    display: inline-block;
    position: relative;
}

.own .message-bubble {
    background-color: #ec4899;
    color: white;
}

.other .message-bubble {
    background-color: #e5e7eb;
    color: #1f2937;
}

.message-info {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.25rem;
    text-align: right;
}

.attachment-preview {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.voice-note-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background-color: #dbeafe;
    border-radius: 8px;
    margin-top: 0.5rem;
}

.chat-input-area {
    border-top: 1px solid #e5e7eb;
    padding: 0.5rem;
    background-color: white;
}

.input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-actions {
    display: flex;
    gap: 0.25rem;
}

.action-button {
    padding: 0.5rem;
    color: #4b5563;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.200s;
}

.action-button:hover {
    background-color: #f3f4f6;
}

#message-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 2rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    outline: none;
}

#message-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.3);
}

.send-button {
    background: linear-gradient(to right, var(--primary-color, #ec4899), var(--accent-color, #8b5cf6));
    color: white;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.200s;
}

.send-button:hover {
    opacity: 0.9;
}

#emoji-picker {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    position: absolute;
    width: 12rem;
    z-index: 50;
    max-height: 10rem;
    overflow-y: auto;
}

.emoji-item {
    font-size: 1.25rem;
    padding: 0.25rem;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.200s;
}

.emoji-item:hover {
    background-color: #f3f4f6;
}

#voice-recorder {
    display: none;
    padding: 0.75rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

#voice-recorder.visible {
    display: flex;
}

.recording-indicator {
    width: 0.75rem;
    height: 0.75rem;
    background-color: #ef4444;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
}

.voice-controls {
    display: flex;
    gap: 0.5rem;
}

.voice-control-btn {
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.875rem;
}

.voice-stop-btn {
    background-color: #ef4444;
    color: white;
}

.voice-cancel-btn {
    background-color: #d1d5db;
    color: #374151;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #chat-container {
        width: 100%;
        height: 50vh;
        left: 0;
        right: 0;
        margin: 0 auto;
    }
    
    #open-chat {
        display: block !important;
    }
}

@media (min-width: 768px) {
    #open-chat {
        display: none;
    }
    
    #chat-container {
        display: block !important;
    }
}