/* Chat Section */
.chat-section {
    background-color: var(--chat-green);
    padding: 1.5rem;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 300px;
}

.chat-section h3 {
    color: white;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.chat-messages {
    flex-grow: 1;
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.chat-message {
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    max-width: 85%;
}

.chat-message.player {
    background-color: #e3f2fd;
    margin-left: auto;
}

.chat-message.bot {
    background-color: #e8f5e9;
    margin-right: auto;
}

.chat-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
}

#chat-input {
    flex-grow: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    background-color: white;
}

#chat-input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

#send-message {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: white;
    color: var(--chat-green);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

#send-message:hover {
    transform: scale(1.05);
}

#send-message i {
    font-size: 1.2rem;
}

/* Bot Thinking Indicator */
.bot-thinking {
    display: flex;
    gap: 0.4rem;
    padding: 0.5rem;
    margin-bottom: 0.75rem;
}

.thinking-dot {
    width: 8px;
    height: 8px;
    background-color: var(--chat-green);
    border-radius: 50%;
    opacity: 0.6;
    animation: botThinking 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes botThinking {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.chat-container {
    background-color: var(--surface-color);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 400px;
}

.chat-header {
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    font-size: var(--font-size-md);
    font-weight: 500;
    margin: 0;
}

.chat-header-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.chat-action-button {
    padding: var(--spacing-xs);
    border: none;
    border-radius: var(--border-radius-sm);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-action-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-action-button i {
    font-size: var(--font-size-md);
}

.chat-messages {
    flex-grow: 1;
    padding: var(--spacing-md);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.message {
    display: flex;
    gap: var(--spacing-sm);
    max-width: 80%;
}

.message.outgoing {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: var(--font-size-sm);
    flex-shrink: 0;
}

.message.outgoing .message-avatar {
    background-color: var(--info-color);
}

.message-content {
    background-color: var(--background-color);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius-md);
    position: relative;
}

.message.outgoing .message-content {
    background-color: var(--primary-color);
    color: white;
}

.message-bubble {
    position: relative;
}

.message-bubble::before {
    content: "";
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px;
}

.message:not(.outgoing) .message-bubble::before {
    left: -8px;
    top: 12px;
    border-color: transparent var(--background-color) transparent transparent;
}

.message.outgoing .message-bubble::before {
    right: -8px;
    top: 12px;
    border-color: transparent transparent transparent var(--primary-color);
}

.message-text {
    font-size: var(--font-size-sm);
    line-height: 1.4;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-top: calc(var(--spacing-xs) / 2);
    font-size: var(--font-size-xs);
    color: var(--text-secondary);
}

.message.outgoing .message-meta {
    color: rgba(255, 255, 255, 0.8);
}

.message-time {
    white-space: nowrap;
}

.chat-input {
    padding: var(--spacing-sm);
    background-color: var(--background-color);
    border-top: 1px solid var(--border-color);
}

.chat-input-form {
    display: flex;
    gap: var(--spacing-sm);
}

.chat-input-field {
    flex-grow: 1;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: var(--surface-color);
    font-size: var(--font-size-sm);
    resize: none;
    min-height: 40px;
    max-height: 120px;
    transition: all var(--transition-fast);
}

.chat-input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
}

.chat-send-button {
    padding: var(--spacing-sm);
    border: none;
    border-radius: var(--border-radius-md);
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send-button:hover {
    background-color: #1b5e20;
}

.chat-send-button:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
}

.chat-send-button i {
    font-size: var(--font-size-md);
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--background-color);
    border-radius: var(--border-radius-sm);
    width: fit-content;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-secondary);
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingAnimation {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-4px);
    }
}

/* New message notification */
.new-messages-indicator {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-sm);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    animation: slideIn var(--transition-normal);
}

@keyframes slideIn {
    from {
        transform: translate(-50%, 100%);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .chat-container {
        height: 350px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: var(--font-size-xs);
    }
}

@media (max-width: 480px) {
    .chat-container {
        height: 300px;
    }
    
    .chat-header h3 {
        font-size: var(--font-size-sm);
    }
    
    .message {
        max-width: 95%;
    }
    
    .chat-input-form {
        flex-direction: column;
    }
    
    .chat-send-button {
        width: 100%;
    }
} 