/**
 * WP Customer AI Chatbot Public CSS
 */

/* Main container */
.wcac-chatbot-container {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 0;
    margin: 0;
    max-width: none;
    width: 100vw;
    height: 100vh;
    min-height: 100vh;
    min-width: 100vw;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background-color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
}

/* Account for WordPress admin bar when present */
.admin-bar .wcac-chatbot-container {
    top: 32px;
    height: calc(100vh - 32px);
    min-height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar .wcac-chatbot-container {
        top: 46px;
        height: calc(100vh - 46px);
        min-height: calc(100vh - 46px);
    }
}

/* Chat header with title and clear button */
.wcac-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px 10px 20px;
    border-bottom: 1px solid #f0f0f0;
    background-color: #fff;
}

.wcac-chatbot-container h2 {
    text-align: center;
    margin: 0;
    padding: 0;
    font-size: 1.4em;
    color: #333;
    flex: 1;
}

/* Clear Chat button */
.wcac-clear-chat-button {
    background-color: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-weight: 500;
}

.wcac-clear-chat-button:hover {
    background-color: #e8e8e8;
    color: #333;
    border-color: #ccc;
}

.wcac-clear-chat-button:active {
    background-color: #ddd;
}

/* Chat messages area */
#wcac-chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 0;
    padding: 20px 10px 10px 10px;
    border: none;
    border-radius: 0;
    background-color: #f9f9f9;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Message styles */
.wcac-user-message, 
.wcac-assistant-message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 18px;
    max-width: 80%;
    word-wrap: break-word;
    position: relative;
    clear: both;
}

.wcac-user-message {
    background-color: #e1f5fe;
    color: #01579b;
    border: 1px solid #b3e5fc;
    float: right;
}

.wcac-assistant-message {
    background-color: #f5f5f5;
    color: #333;
    border: 1px solid #e0e0e0;
    float: left;
}

.wcac-message-content {
    line-height: 1.4;
}

/* Typing indicator */
#wcac-typing-indicator {
    background-color: #f5f5f5;
    padding: 10px;
}

.wcac-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    margin: 0 2px;
    animation: dot-pulse 1.5s infinite ease-in-out;
}

.wcac-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.wcac-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dot-pulse {
    0% { transform: scale(0.8); opacity: 0.5; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.5; }
}

/* Error message */
.wcac-error-message {
    background-color: #ffebee !important;
    color: #c62828 !important;
    border-color: #ffcdd2 !important;
}

/* Form and input area */
.wcac-chat-form {
    margin: 0;
    padding: 10px;
    border-top: 1px solid #e0e0e0;
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

.wcac-chat-input {
    display: flex;
    gap: 10px;
    width: 100%;
}

#wcac-message {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    padding: 10px 15px;
    resize: none;
    outline: none;
    min-height: 20px;
    max-height: 100px;
    overflow-y: auto;
    font-family: inherit;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

#wcac-send-button {
    background-color: #2196f3;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s;
}

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

#wcac-send-button:disabled {
    background-color: #bbdefb;
    cursor: not-allowed;
}

/* Branding */
.wcac-branding {
    text-align: center;
    margin-top: 10px;
    font-size: 11px;
    color: #9e9e9e;
    padding-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .wcac-chatbot-container {
        width: 100vw;
        height: 100vh;
        min-width: 100vw;
        min-height: 100vh;
        margin: 0;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }
    #wcac-chat-messages {
        padding: 10px 5px 5px 5px;
    }
    .wcac-chat-header {
        padding: 10px 15px 8px 15px;
        flex-wrap: wrap;
    }
    .wcac-chatbot-container h2 {
        font-size: 1.2em;
        margin-bottom: 8px;
    }
    .wcac-clear-chat-button {
        font-size: 12px;
        padding: 5px 10px;
        width: 100%;
        margin-top: 5px;
    }
}

/* Links in messages */
.wcac-message-content a {
    color: #2196f3;
    text-decoration: underline;
}

.wcac-message-content a:hover {
    text-decoration: none;
}

/* Lists in messages */
.wcac-message-content ul {
    margin-top: 5px;
    margin-bottom: 5px;
    padding-left: 20px;
}

.wcac-message-content li {
    margin-bottom: 3px;
}

/* Feedback buttons */
.wcac-feedback-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.wcac-feedback-btn {
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.6;
    line-height: 1;
}

.wcac-feedback-btn:hover {
    opacity: 1;
    background-color: #f5f5f5;
    border-color: #ccc;
}

.wcac-feedback-btn:disabled {
    cursor: default;
    opacity: 0.4;
}

.wcac-feedback-btn.wcac-feedback-selected {
    opacity: 1;
    background-color: #e3f2fd;
    border-color: #2196f3;
}

.wcac-feedback-btn.wcac-feedback-up.wcac-feedback-selected {
    background-color: #e8f5e9;
    border-color: #4caf50;
}

.wcac-feedback-btn.wcac-feedback-down.wcac-feedback-selected {
    background-color: #ffebee;
    border-color: #f44336;
}

.wcac-feedback-thanks {
    font-size: 12px;
    color: #666;
    margin-left: 4px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive adjustments for feedback */
@media (max-width: 576px) {
    .wcac-feedback-buttons {
        gap: 6px;
        margin-top: 6px;
        padding-top: 6px;
    }
    
    .wcac-feedback-btn {
        padding: 3px 8px;
        font-size: 13px;
    }
} 