/* Advanced WhatsApp Widget Styles - Consistent Square Theme */
:root {
    /* New Color Scheme */
    --e-global-color-primary: #4D5A52;
    --e-global-color-secondary: #738760;
    --e-global-color-text: #333333;
    --e-global-color-accent: #ffffff;
    --e-global-color-f1c3894: #E8E9E3;
    
    /* Widget Color Variables */
    --e-global-color-primary: var(--e-global-color-primary);
    --ww-secondary-color: var(--e-global-color-secondary);
    --ww-accent-color: var(--e-global-color-secondary);
    --e-global-color-text: var(--e-global-color-text);
    --ww-text-light: #718096;
    --e-global-color-primary: var(--e-global-color-primary);
    --ww-shadow: rgba(0, 0, 0, 0.05);
    --ww-shadow-hover: rgba(0, 0, 0, 0.1);
    --ww-border-radius: 0px;
    --ww-card-bg: var(--e-global-color-accent);
    --ww-bg-light: var(--e-global-color-f1c3894);
}

/* Container & Positioning */
.ww-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    transition: all 0.2s ease;
}

.ww-bottom-right {
    bottom: 24px;
    right: 24px;
}

.ww-bottom-left {
    bottom: 24px;
    left: 24px;
}

.ww-top-right {
    top: 24px;
    right: 24px;
}

.ww-top-left {
    top: 24px;
    left: 24px;
}

/* Elegant Floating Button */
.ww-floating-btn {
    width: 60px;
    height: 60px;
    background: var(--ww-secondary-color);
    border: 2px solid var(--e-global-color-primary);
    border-radius: 50%;
    box-shadow: 0 4px 16px var(--ww-shadow);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.2s ease;
    z-index: 10000;
    outline: none;
}

.ww-floating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--ww-shadow-hover);
    background: var(--e-global-color-primary);
    border-color: var(--e-global-color-primary);
}

.ww-floating-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px var(--ww-shadow);
}

/* WhatsApp Icon */
.ww-whatsapp-icon {
    width: 28px;
    height: 28px;
    color: var(--ww-card-bg);
    transition: all 0.2s ease;
}

.ww-floating-btn:hover .ww-whatsapp-icon {
    transform: scale(1.1);
}

/* Elegant Notification Badge */
.ww-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
    z-index: 1;
}

/* Chat Interface - Square Card Style */
.ww-chat-interface {
    position: absolute;
    width: 360px;
    height: 520px;
    background: var(--ww-card-bg);
    border: 1px solid var(--e-global-color-primary);
    border-radius: 0px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 9999;
    bottom: 80px;
    right: 0;
    overflow: hidden;
}

.ww-chat-interface.active {
    transform: translateY(0) scale(1);
    opacity: 1;
    visibility: visible;
}

.ww-bottom-left .ww-chat-interface {
    bottom: 80px;
    left: 0;
}

.ww-top-right .ww-chat-interface {
    top: 80px;
    bottom: auto;
}

.ww-top-left .ww-chat-interface {
    top: 80px;
    bottom: auto;
    left: 0;
}

/* Clean Chat Header with Button Container */
.ww-chat-header {
    background: var(--ww-card-bg);
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--e-global-color-text);
    border-bottom: 1px solid var(--e-global-color-primary);
    border-radius: 0px;
    position: relative;
}

/* Header Button Container */
.ww-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Consistent Button Sizing for Header Buttons */
.ww-minimize-btn,
.ww-back-btn {
    background: transparent !important;
    border: 1px solid var(--e-global-color-primary) !important;
    color: var(--e-global-color-text) !important;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    height: 36px;
    width: 36px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none !important;
    box-shadow: none !important;
    padding: 0;
    margin: 0;
}

.ww-minimize-btn:hover,
.ww-back-btn:hover {
    background: var(--e-global-color-primary) !important;
    color: white !important;
    border-color: var(--e-global-color-primary) !important;
    transform: none;
}

.ww-minimize-btn:focus,
.ww-back-btn:focus {
    background: var(--e-global-color-text) !important;
    color: white !important;
    border-color: var(--e-global-color-text) !important;
    outline: 2px solid var(--ww-accent-color) !important;
    outline-offset: 2px;
}

/* Remove the old back button styling that was at the bottom */
.ww-chat-content .ww-back-btn {
    display: none !important;
}

.ww-agent-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.ww-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--ww-bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    color: var(--e-global-color-text);
    overflow: hidden;
    border: 1px solid var(--e-global-color-primary);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.ww-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.ww-default-avatar {
    background: var(--ww-bg-light);
    font-weight: 600;
    text-transform: uppercase;
}

.ww-small-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
}

.ww-agent-details {
    flex: 1;
    min-width: 0;
}

.ww-agent-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    line-height: 1.3;
    color: var(--e-global-color-text);
    word-wrap: break-word;
}

.ww-agent-status {
    font-size: 13px;
    color: var(--ww-text-light);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.ww-agent-status::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Clean Chat Content */
.ww-chat-content {
    padding: 24px;
    max-height: 420px;
    overflow-y: auto;
    background: var(--ww-card-bg);
}

.ww-chat-step {
    display: none;
    padding: 0;
}

.ww-chat-step.active {
    display: block;
    animation: ww-step-fade-in 0.3s ease;
}

@keyframes ww-step-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.ww-message {
    margin-bottom: 20px;
}

/* Square Message Bubbles */
.ww-agent-message .ww-message-content {
    background: var(--ww-bg-light);
    color: var(--e-global-color-text);
    padding: 16px 20px;
    border-radius: 0px;
    font-size: 14px;
    line-height: 1.5;
    display: inline-block;
    max-width: 85%;
    word-wrap: break-word;
    border: 1px solid var(--e-global-color-primary);
}

.ww-user-message .ww-message-content {
    background: var(--ww-accent-color);
    color: white;
    padding: 16px 20px;
    border-radius: 0px;
    font-size: 14px;
    line-height: 1.5;
    margin-left: auto;
    text-align: right;
    display: inline-block;
    max-width: 85%;
    word-wrap: break-word;
}
.ww-message-content {
    margin-top: 20px;
}

/* Elegant Quick Actions */
.ww-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* Square Action Buttons */
.ww-action-btn {
    background: var(--ww-card-bg);
    border: 1px solid var(--e-global-color-primary);
    color: var(--e-global-color-text);
    padding: 16px 20px;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    text-align: left;
    position: relative;
    line-height: 1.4;
}

/* Improved Hover Contrast for Actions */
.ww-action-btn:hover {
    background: var(--e-global-color-primary) !important;
    border-color: var(--e-global-color-primary) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--ww-shadow);
}

/* Elegant Contact Channels */
.ww-contact-channels {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

/* Square Channel Buttons */
.ww-channel-btn {
    background: var(--ww-card-bg);
    border: 1px solid var(--e-global-color-primary);
    color: var(--e-global-color-text);
    padding: 18px 20px;
    border-radius: 0px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}

/* Improved Hover Contrast for Channels */
.ww-channel-btn:hover {
    background: var(--e-global-color-primary) !important;
    border-color: var(--e-global-color-primary) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--ww-shadow);
}

.ww-whatsapp-btn {
    background: var(--ww-secondary-color);
    color: white;
    border-color: var(--ww-secondary-color);
}

.ww-whatsapp-btn:hover {
    background: var(--e-global-color-primary);
    border-color: var(--e-global-color-primary);
    color: white;
}

.ww-channel-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Clean WhatsApp Header */
.ww-whatsapp-header {
    background: transparent;
    padding: 0 0 20px 0;
    margin: 0;
    color: var(--e-global-color-text);
    border-radius: 0;
    border-bottom: 1px solid var(--e-global-color-primary);
}

.ww-whatsapp-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ww-whatsapp-details {
    flex: 1;
}

.ww-whatsapp-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--e-global-color-text);
    margin-bottom: 2px;
}

.ww-whatsapp-message {
    margin: 20px 0;
}

/* Square Message Bubble */
.ww-message-bubble {
    background: var(--ww-bg-light);
    padding: 16px 20px;
    border-radius: 0px;
    color: var(--e-global-color-text);
    font-size: 14px;
    line-height: 1.5;
    position: relative;
    display: inline-block;
    max-width: 85%;
    border: 1px solid var(--e-global-color-primary);
}

.ww-message-time {
    font-size: 11px;
    color: var(--ww-text-light);
    margin-top: 8px;
    text-align: right;
}

/* Square Message Input */
.ww-whatsapp-input {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: var(--ww-card-bg);
    padding: 16px;
    border-radius: 0px;
    border: 1px solid var(--e-global-color-primary);
    margin-top: 20px;
}

.ww-message-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-size: 14px;
    resize: none;
    outline: none;
    min-height: 20px;
    max-height: 80px;
    font-family: inherit;
    color: var(--e-global-color-text);
}

.ww-message-input::placeholder {
    color: var(--ww-text-light);
}

/* Square Send Button */
.ww-send-btn {
    background: var(--ww-secondary-color);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    height: 36px;
    width: 36px;
    border-radius: 0px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ww-send-btn:hover {
    background: var(--e-global-color-primary);
    transform: scale(1.05);
}

/* WordPress Color Override - Prevent All Default Colors */
.ww-chat-interface *,
.ww-chat-interface *:before,
.ww-chat-interface *:after,
.ww-container *,
.ww-container *:before,
.ww-container *:after {
    box-sizing: border-box !important;
}

/* Remove WordPress Button Styles */
.ww-chat-interface button,
.ww-chat-interface .button,
.ww-chat-interface input[type="button"],
.ww-chat-interface input[type="submit"] {
    background: transparent !important;
    border: 1px solid var(--e-global-color-primary) !important;
    color: var(--e-global-color-text) !important;
    font-family: inherit !important;
    font-size: inherit !important;
    text-shadow: none !important;
    box-shadow: none !important;
    border-radius: inherit !important;
}

/* Remove WordPress Focus Styles */
.ww-chat-interface *:focus,
.ww-container *:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Custom Focus for Our Elements */
.ww-floating-btn:focus,
.ww-action-btn:focus,
.ww-channel-btn:focus,
.ww-send-btn:focus,
.ww-back-btn:focus {
    outline: 2px solid var(--ww-accent-color) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

/* Remove all animations and heavy effects */
.ww-pulse, .ww-bounce, .ww-shake, .ww-glow, .ww-spin, .ww-wobble {
    animation: none !important;
}

/* Clean scrollbar */
.ww-chat-content::-webkit-scrollbar {
    width: 4px;
}

.ww-chat-content::-webkit-scrollbar-track {
    background: transparent;
}

.ww-chat-content::-webkit-scrollbar-thumb {
    background: var(--e-global-color-primary);
    border-radius: 0px;
}

.ww-chat-content::-webkit-scrollbar-thumb:hover {
    background: var(--ww-text-light);
}

/* Remove step separators */
.ww-step-separator {
    display: none;
}

.ww-step-separator:after {
    display: none;
}

/* Responsive Design - Maintaining Elegant Style */
@media (max-width: 768px) {
    .ww-hide-mobile {
        display: none !important;
    }
    
    .ww-chat-interface {
        width: calc(100vw - 48px);
        max-width: 340px;
        height: 480px;
    }
    
    .ww-chat-header {
        padding: 20px;
    }
    
    .ww-chat-content {
        padding: 20px;
        max-height: 360px;
    }
}

@media (min-width: 769px) {
    .ww-hide-desktop {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .ww-container {
        bottom: 20px;
        right: 20px;
        left: 20px;
    }
    
    .ww-chat-interface {
        width: calc(100vw - 40px);
        height: 460px;
        bottom: 80px;
        right: 0;
        left: 0;
        margin: 0 auto;
    }
    
    .ww-bottom-left .ww-chat-interface,
    .ww-top-left .ww-chat-interface,
    .ww-top-right .ww-chat-interface {
        left: 0;
        right: 0;
    }
    
    .ww-chat-header {
        padding: 16px;
    }
    
    .ww-chat-content {
        padding: 16px;
        max-height: 340px;
    }
    
    .ww-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .ww-agent-name {
        font-size: 15px;
    }
    
    .ww-agent-status {
        font-size: 12px;
    }
}

/* Accessibility handled by WordPress override section above */

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .ww-floating-btn,
    .ww-action-btn,
    .ww-channel-btn,
    .ww-back-btn {
        border-width: 2px;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .ww-floating-btn,
    .ww-chat-interface,
    .ww-action-btn,
    .ww-channel-btn,
    .ww-notification-badge,
    .ww-back-btn {
        animation: none !important;
        transition: none !important;
    }
}

/* Print Styles */
@media print {
    .ww-container {
        display: none !important;
    }
}

/* Scrollbar Styling */
.ww-chat-content::-webkit-scrollbar {
    width: 6px;
}

.ww-chat-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

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

.ww-chat-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Chat Steps */
.ww-chat-step {
    display: none;
    animation: ww-fadeInUp 0.3s ease-out;
}

.ww-chat-step.active {
    display: block;
}

.ww-chat-step.stacked {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.ww-step-separator {
    display: none;
}

.ww-step-separator:after {
    display: none;
}

@keyframes ww-fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
} 

.ww-minimize-btn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 10001 !important;
    pointer-events: auto !important;
} 