/**
 * ACS Welcome Mat & Support Bot Styles
 */

#awm-chatbot-container {
    position: fixed;
    bottom: 15px !important;
    right: 15px !important;
    z-index: 10000;
    width: 100%;
    max-width: 380px;
}

.awm-toast {
    background-color: #fff;
    color: #333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1), 0 5px 5px rgba(0, 0, 0, 0.05);
    border-left: 5px solid #4299e1; /* Default to 'info' blue */
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    position: relative;
}

.awm-toast.awm-show {
    opacity: 1;
    transform: translateX(0);
}

/* Toast Types */
.awm-toast.awm-toast-success { border-color: #48bb78; }
.awm-toast.awm-toast-error { border-color: #f56565; }
.awm-toast.awm-toast-info { border-color: #4299e1; }
.awm-toast.awm-toast-warning { border-color: #ecc94b; }


.awm-toast-title {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 1.1em;
    font-weight: bold;
}

.awm-toast-message {
    margin: 0;
    font-size: 0.95em;
    line-height: 1.5;
}

.awm-toast-actions {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.awm-toast-button {
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    display: inline-block;
    background-color: #edf2f7;
    color: #2d3748;
    transition: all 0.2s;
    text-align: center;
    flex-grow: 1; /* Allow buttons to grow */
}

.awm-toast-button:hover {
    background-color: #e2e8f0;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* --- NEW BUTTON STYLES --- */
.awm-toast-button.awm-primary {
    background-color: #48bb78; /* Success Green */
    color: #fff;
    border-color: #3f9e6a;
}
.awm-toast-button.awm-primary:hover {
    background-color: #3f9e6a;
}

.awm-toast-button.awm-secondary {
    background-color: transparent;
    color: #4a5568;
    border-color: #e2e8f0;
}
.awm-toast-button.awm-secondary:hover {
    background-color: #f7fafc;
    border-color: #cbd5e0;
}
/* --- END NEW BUTTON STYLES --- */


.awm-toast-close {
    position: absolute;
    top: 5px;
    right: 10px;
    background: none;
    border: none;
    font-size: 24px;
    color: #a0aec0;
    cursor: pointer;
    line-height: 1;
    padding: 5px;
}

.awm-toast-close:hover {
    color: #718096;
}

/* Chat Widget */
#awm-chat-widget {
    background: #f9f9f9;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    width: 370px;
    max-width: 90vw;
    height: 70vh;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    transform-origin: bottom right;
}
#awm-chat-widget.awm-closed {
    transform: scale(0);
    opacity: 0;
    visibility: hidden;
}
#awm-chat-widget.awm-open {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}


/* Header */
#awm-chat-header {
    background: #0073aa;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
#awm-chat-header h4 {
    margin: 0;
    font-size: 1.1rem;
}
#awm-chat-header p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.8;
}
#awm-close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}
#awm-close-chat:hover {
    opacity: 1;
}

/* Body & Messages */
#awm-chat-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px;
}
#awm-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.awm-chat-message {
    display: flex;
    max-width: 85%;
}
.awm-msg-content {
    padding: 10px 15px;
    border-radius: 18px;
    line-height: 1.5;
}

/* Bot Messages */
.awm-msg-bot {
    align-self: flex-start;
}
.awm-msg-bot .awm-msg-content {
    background: #e9ebee;
    color: #1c1e21;
    border-bottom-left-radius: 4px;
}
/* Message Types */
.awm-msg-bot.awm-type-success .awm-msg-content { background: #d4edda; color: #155724; }
.awm-msg-bot.awm-type-warning .awm-msg-content { background: #fff3cd; color: #856404; }
.awm-msg-bot.awm-type-error .awm-msg-content { background: #f8d7da; color: #721c24; }
.awm-msg-bot.awm-type-loading .awm-msg-content {
    font-style: italic;
    color: #666;
}


/* User Messages */
.awm-msg-user {
    align-self: flex-end;
}
.awm-msg-user .awm-msg-content {
    background: #0084ff;
    color: white;
    border-bottom-right-radius: 4px;
}


/* Footer & Form */
#awm-chat-footer {
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #fff;
    flex-shrink: 0;
}
#awm-chat-form {
    display: flex;
    align-items: center;
    gap: 10px;
}
#awm-chat-input {
    flex-grow: 1;
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 1rem;
    outline: none;
}
#awm-chat-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}
#awm-send-btn {
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}
#awm-send-btn:hover {
    background: #005a87;
}

/* Toggle Button */
#awm-chat-toggle {
    background: #0073aa; /* WordPress Blue */
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
#awm-chat-toggle:hover {
    background: #005a87;
    transform: scale(1.1);
}
