/* 
 * WhatsApp Chat Form Public Styles 
 */

:root {
    --wacf-green: #25D366;
    --wacf-dark-green: #128C7E;
    --wacf-teal: #075E54;
    --wacf-bg: #E5DDD5;
    --wacf-white: #FFFFFF;
    --wacf-text: #303030;
    --wacf-text-light: #777777;
    --wacf-border: #E0E0E0;
    --wacf-bubble-bg: #FFFFFF;
    --wacf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wacf-widget-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: var(--wacf-font);
}

/* Floating Button */
.wacf-floating-button {
    width: 60px;
    height: 60px;
    background-color: var(--wacf-green);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: absolute;
    bottom: 0;
    right: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.wacf-floating-button:hover {
    transform: scale(1.1);
}

.wacf-floating-button i {
    color: var(--wacf-white);
    font-size: 35px;
}

.wacf-custom-icon {
    width: 60%;
    height: 60%;
    object-fit: contain;
}

.wacf-notification-dot {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background-color: #ff3b30;
    border-radius: 50%;
    border: 2px solid var(--wacf-white);
    animation: wacf-pulse 2s infinite;
}

@keyframes wacf-pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0.7); }
    70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); }
}

/* Chat Window */
.wacf-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    background: var(--wacf-white);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    max-height: calc(100vh - 120px);
}

.wacf-chat-window.wacf-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header */
.wacf-chat-header {
    background: var(--wacf-teal);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--wacf-white);
}

.wacf-header-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wacf-avatar-wrapper {
    position: relative;
}

.wacf-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.2);
}

.wacf-online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background-color: var(--wacf-green);
    border-radius: 50%;
    border: 2px solid var(--wacf-teal);
}

.wacf-header-info h4 {
    margin: 0 0 3px 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: var(--wacf-white) !important;
    text-align: left !important;
    line-height: 1.2 !important;
}

.wacf-header-info p {
    margin: 0 !important;
    font-size: 13px !important;
    opacity: 0.9 !important;
    text-align: left !important;
    line-height: 1.2 !important;
}

.wacf-close-btn {
    background: none;
    border: none;
    color: var(--wacf-white);
    font-size: 24px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 0;
    line-height: 1;
}

.wacf-close-btn:hover {
    opacity: 1;
}

/* Body */
.wacf-chat-body {
    background-color: var(--wacf-bg);
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20.5V18H0v-2h20v-2H0v-2h20v-2H0V8h20V6H0V4h20V2H0V0h22v20h2V0h2v20h2V0h2v20h2V0h2v20h2V0h2v20h2V0h2v20h2v2H20v-1.5zM0 20h2v20H0V20zm4 0h2v20H4V20zm4 0h2v20H8V20zm4 0h2v20h-2V20zm4 0h2v20h-2V20zm4 4h20v2H20v-2zm0 4h20v2H20v-2zm0 4h20v2H20v-2zm0 4h20v2H20v-2z' fill='%23000000' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wacf-message-bubble {
    background: var(--wacf-bubble-bg);
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    max-width: 85%;
    align-self: flex-start;
    border-top-left-radius: 0;
    text-align: left !important;
}

.wacf-message-bubble::before {
    content: '';
    position: absolute;
    top: 0;
    left: -8px;
    width: 0;
    height: 0;
    border-top: 10px solid var(--wacf-bubble-bg);
    border-left: 10px solid transparent;
}

.wacf-message-author {
    font-size: 13px !important;
    color: var(--wacf-text-light) !important;
    margin-bottom: 4px !important;
    font-weight: 600 !important;
    text-align: left !important;
}

.wacf-message-text {
    font-size: 14px !important;
    color: var(--wacf-text) !important;
    line-height: 1.4 !important;
    text-align: left !important;
    margin: 0 !important;
}

.wacf-message-time {
    font-size: 11px !important;
    color: var(--wacf-text-light) !important;
    text-align: right !important;
    margin-top: 5px !important;
    display: block !important;
}

/* Agents List */
.wacf-agents-list {
    background: var(--wacf-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.wacf-select-prompt {
    padding: 12px 15px;
    margin: 0;
    font-size: 13px;
    color: var(--wacf-text-light);
    border-bottom: 1px solid var(--wacf-border);
    background: #fafafa;
}

.wacf-agent-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid var(--wacf-border);
    cursor: pointer;
    transition: background 0.2s;
}

.wacf-agent-item:last-child {
    border-bottom: none;
}

.wacf-agent-item:hover {
    background: #f5f5f5;
}

.wacf-agent-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
}

.wacf-agent-details {
    flex-grow: 1;
}

.wacf-agent-details strong {
    display: block;
    font-size: 14px;
    color: var(--wacf-text);
}

.wacf-agent-details span {
    font-size: 12px;
    color: var(--wacf-text-light);
}

.wacf-agent-item i {
    color: var(--wacf-border);
    font-size: 14px;
}

/* Form Container */
.wacf-form-container {
    background: var(--wacf-white);
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.wacf-back-btn {
    background: none;
    border: none;
    color: var(--wacf-dark-green);
    font-size: 13px;
    padding: 0;
    margin-bottom: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.wacf-form-group {
    margin-bottom: 12px;
}

.wacf-form-group input,
.wacf-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--wacf-border);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.wacf-form-group input:focus,
.wacf-form-group textarea:focus {
    outline: none;
    border-color: var(--wacf-green);
}

.wacf-form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.wacf-submit-btn {
    width: 100%;
    background: var(--wacf-green);
    color: var(--wacf-white);
    border: none;
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: background 0.2s;
}

.wacf-submit-btn:hover {
    background: var(--wacf-dark-green);
}

.wacf-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Footer */
.wacf-chat-footer {
    background: var(--wacf-white);
    padding: 8px;
    text-align: center;
    font-size: 11px;
    color: var(--wacf-text-light);
    border-top: 1px solid var(--wacf-border);
}

.wacf-chat-footer a {
    color: var(--wacf-text-light);
    text-decoration: none;
    font-weight: 600;
}

.wacf-chat-footer a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 480px) {
    .wacf-widget-container {
        bottom: 20px;
        right: 20px;
    }
    
    .wacf-chat-window {
        width: calc(100vw - 40px);
        bottom: 70px;
    }
}
