/* Стили для анонимного чата */
#anonymous-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    width: 300px;
    min-height: 400px;
    max-height: 500px;
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    background-color: white;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    transition: all 0.3s ease;
}

#anonymous-chat-container.minimized {
    height: 48px !important;
    overflow: hidden;
}

#anonymous-chat-header.minimized {
    border-radius: 16px;
}

#anonymous-chat-box.hidden {
    display: none;
}

#anonymous-chat-box {
    display: flex;
    flex-direction: column;
    height: calc(100% - 48px);
    padding: 15px;
}

#chat-restore-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: none;
    align-items: center;
    justify-content: center;
}

#chat-restore-btn.show {
    display: flex;
}

#anonymous-chat-header {
    padding: 12px 15px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

#anonymous-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.header-controls {
    display: flex;
    gap: 10px;
}

.header-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.header-icon:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

#anonymous-chat-box {
    display: flex;
    flex-direction: column;
    height: calc(100% - 48px);
    padding: 15px;
    display: flex;
}

#anonymous-chat-box.hidden {
    display: none;
}

#chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 12px;
    max-height: 250px;
}

.chat-message {
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: 18px;
    background-color: #e3f2fd;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-message strong {
    color: #1976d2;
    font-size: 13px;
}

.chat-message .message-text {
    display: block;
    margin-top: 3px;
}

.chat-message .timestamp {
    font-size: 11px;
    color: #666;
    text-align: right;
    margin-top: 5px;
}

#chat-input-area {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-row {
    display: flex;
    gap: 5px;
}

#chat-message-input {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#chat-message-input:focus {
    border-color: #2196f3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2);
}

#send-message-btn {
    padding: 12px 18px;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

#send-message-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.3);
}

#send-message-btn:disabled {
    background: #b3b3b3;
    cursor: not-allowed;
    opacity: 0.6;
    transform: none;
    box-shadow: none;
}

.emoji-picker {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 5px 0;
}

.emoji-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.emoji-btn:hover {
    background-color: #f0f0f0;
}

/* Мобильная версия */
@media (max-width: 768px) {
    #anonymous-chat-container {
        width: calc(100% - 40px);
        max-width: 350px;
        min-height: 350px;
        bottom: 15px;
        right: 10px;
        left: 10px;
    }
    
    #chat-messages {
        max-height: 200px;
    }
    
    #chat-message-input {
        padding: 10px 12px;
        font-size: 16px; /* Для лучшей читаемости на мобильных */
    }
    
    #send-message-btn {
        padding: 10px 15px;
        font-size: 16px;
    }
    
    .chat-message {
        font-size: 15px;
        padding: 10px 14px;
    }
}