/* WordPress Chat Box Plugin Styles */

#wp-chat-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
}

.loading-messages {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

.chat-conversation {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-message {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.chat-message:last-child {
    border-bottom: none;
}

.chat-message.question {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.chat-message.reply {
    background: #f3e5f5;
    border-left: 4px solid #9c27b0;
    margin-left: 20px;
}

.chat-message.admin-reply {
    background: #e8f5e8;
    border-left: 4px solid #4caf50;
    margin-left: 20px;
}

.chat-message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.chat-author {
    font-weight: 600;
    color: #333;
}

.chat-author.admin {
    color: #4caf50;
}

.chat-author.admin::after {
    content: " (Admin)";
    font-weight: normal;
    color: #4caf50;
}

.chat-date {
    font-size: 11px;
    color: #999;
}

.chat-content {
    line-height: 1.5;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-input-container {
    background: #fff;
    padding: 15px;
    border-top: 1px solid #eee;
}

.chat-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.clear-button {
    background: #d32f2f;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.clear-button:hover {
    background: #b71c1c;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(211, 47, 47, 0.3);
}

.clear-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(211, 47, 47, 0.3);
}

.clear-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

#chat-message-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 20px;
    resize: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
    transition: border-color 0.2s ease;
}

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

.send-button {
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.send-button:hover {
    background: #1976d2;
}

.send-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.chat-login-notice {
    padding: 20px;
    text-align: center;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.chat-login-link {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background: #007cba;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.chat-login-link:hover {
    background: #005a87;
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    #wp-chat-box {
        height: auto !important;
        min-height: 300px;
    }
    
    .chat-controls {
        justify-content: center;
        margin-bottom: 8px;
    }
    
    .clear-button {
        font-size: 11px;
        padding: 5px 10px;
    }
    
    .chat-input-wrapper {
        flex-direction: column;
        gap: 8px;
    }
    
    .send-button {
        align-self: flex-end;
        border-radius: 4px;
    }
    
    .chat-message.reply,
    .chat-message.admin-reply {
        margin-left: 10px;
    }
}

/* Animations */
.chat-message.new-message {
    animation: slideIn 0.3s ease-out, highlight 2s ease-out;
}

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

@keyframes highlight {
    0% {
        background-color: rgba(33, 150, 243, 0.1);
    }
    50% {
        background-color: rgba(33, 150, 243, 0.05);
    }
    100% {
        background-color: transparent;
    }
}

/* Scrollbar styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Error and success messages */
.chat-error {
    background: #ffebee;
    border: 1px solid #f8bbd9;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

.chat-success {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

/* Empty state */
.chat-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.chat-empty-state h3 {
    margin: 0 0 10px;
    color: #333;
}

.chat-empty-state p {
    margin: 0;
    font-style: italic;
}