/**
 * SC Flower Manager - Chat Widget Styles
 */

/* Container */
#scfm-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Chat Bubble */
.scfm-chat-bubble {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.scfm-chat-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(233, 30, 99, 0.4);
}

.scfm-chat-bubble.scfm-hidden {
    display: none;
}

.scfm-chat-bubble-icon {
    font-size: 24px;
}

.scfm-chat-bubble-text {
    font-size: 14px;
    font-weight: 500;
}

/* Chat Window */
.scfm-chat-window {
    display: none;
    flex-direction: column;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 500px;
    max-height: calc(100vh - 100px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 5px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

#scfm-chat-container.scfm-chat-open .scfm-chat-window {
    display: flex;
}

/* Chat Header */
.scfm-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
}

.scfm-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.scfm-chat-avatar {
    font-size: 28px;
}

.scfm-chat-header-text {
    display: flex;
    flex-direction: column;
}

.scfm-chat-header-text strong {
    font-size: 16px;
}

.scfm-chat-header-text small {
    font-size: 12px;
    opacity: 0.9;
}

.scfm-chat-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.scfm-chat-close:hover {
    opacity: 1;
}

/* Messages Container */
.scfm-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

/* Message Bubbles */
.scfm-message {
    display: flex;
    margin-bottom: 15px;
}

.scfm-message.scfm-user {
    justify-content: flex-end;
}

.scfm-message.scfm-bot {
    justify-content: flex-start;
}

.scfm-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.scfm-message.scfm-user .scfm-message-content {
    background: #e91e63;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.scfm-message.scfm-bot .scfm-message-content {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */
.scfm-typing-indicator .scfm-message-content {
    padding: 15px 20px;
}

.scfm-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #999;
    border-radius: 50%;
    margin: 0 2px;
    animation: scfm-typing 1.4s infinite;
}

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

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

@keyframes scfm-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

/* Chat Input Area */
.scfm-chat-input-area {
    display: flex;
    padding: 15px;
    background: #fff;
    border-top: 1px solid #eee;
}

.scfm-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.scfm-chat-input:focus {
    border-color: #e91e63;
}

.scfm-chat-send {
    width: 44px;
    height: 44px;
    margin-left: 10px;
    background: #e91e63;
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.scfm-chat-send:hover {
    background: #c2185b;
    transform: scale(1.05);
}

/* Product Cards in Chat */
.scfm-chat-products {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.scfm-chat-product {
    display: flex;
    gap: 12px;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.scfm-chat-product-img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

.scfm-chat-product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.scfm-chat-product-name {
    font-size: 13px;
    color: #333;
}

.scfm-chat-product-price {
    font-size: 14px;
    font-weight: 600;
    color: #e91e63;
}

.scfm-chat-product-link {
    font-size: 12px;
    color: #e91e63;
    text-decoration: none;
}

.scfm-chat-product-link:hover {
    text-decoration: underline;
}

/* Consent Screen */
.scfm-chat-consent {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 25px;
    background: linear-gradient(180deg, #fff 0%, #fef6f8 100%);
}

.scfm-consent-content {
    text-align: center;
}

.scfm-consent-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.scfm-consent-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
}

.scfm-consent-content p {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 20px;
}

.scfm-consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    margin-bottom: 20px;
}

.scfm-consent-checkbox input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
}

.scfm-consent-btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #e91e63, #c2185b);
    border: none;
    border-radius: 25px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
}

.scfm-consent-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scfm-consent-btn:not(:disabled):hover {
    transform: translateY(-1px);
}

.scfm-privacy-link {
    display: inline-block;
    margin-top: 15px;
    font-size: 12px;
    color: #888;
    text-decoration: none;
}

.scfm-privacy-link:hover {
    color: #e91e63;
    text-decoration: underline;
}

/* Quick Replies */
.scfm-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 15px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.scfm-quick-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #fff;
    border: 1px solid #e91e63;
    border-radius: 18px;
    color: #e91e63;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.scfm-quick-reply-btn:hover {
    background: #e91e63;
    color: #fff;
}

.scfm-quick-reply-icon {
    font-size: 14px;
}

.scfm-quick-reply-text {
    font-weight: 500;
}

/* Quick Action Buttons (legacy) */
.scfm-quick-action {
    display: inline-block;
    padding: 8px 14px;
    margin: 5px 5px 5px 0;
    background: #fff;
    border: 1px solid #e91e63;
    border-radius: 18px;
    color: #e91e63;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.scfm-quick-action:hover {
    background: #e91e63;
    color: #fff;
}

/* Mobile Styles */
@media (max-width: 480px) {
    #scfm-chat-container {
        bottom: 10px;
        right: 10px;
    }

    .scfm-chat-bubble-text {
        display: none;
    }

    .scfm-chat-bubble {
        padding: 12px;
        border-radius: 50%;
    }

    .scfm-chat-window {
        width: calc(100vw - 20px);
        height: calc(100vh - 80px);
        border-radius: 12px;
    }

    .scfm-message-content {
        max-width: 90%;
    }
}
