/* 
   Nebu Timber - Custom Persistent Chat Widget & WhatsApp Widget & Email Widget & Phone Widget
   Theme: Coffee Brown (Matching nebu-overrides.css)
*/

.chat-widget-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    /* Force left side as requested */
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}

/* --- Toggle Button --- */
.chat-widget-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--medium-roast, #6F4E37), var(--dark-roast, #4A2E1B));
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid var(--caramel, #D4A056);
}

.chat-widget-toggle:hover {
    transform: scale(1.1);
}

.chat-widget-toggle i {
    font-size: 24px;
}

/* "1" Notification Badge */
.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background-color: #ff0000;
    /* Fixed red as requested */
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Animation: Pulse (Calling for attention) */
@keyframes chat-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 160, 86, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(212, 160, 86, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(212, 160, 86, 0);
    }
}

.chat-widget-toggle.animate {
    animation: chat-pulse 2s infinite;
}


/* --- Chat Form Popup --- */
.chat-widget-popup {
    position: absolute;
    bottom: 80px;
    left: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    /* overflow: hidden;  <-- REMOVED to allow dropdown to show */
    opacity: 0;
    pointer-events: none;
    /* transform: translateY(20px); REMOVED to fix stacking context issues */
    bottom: 60px;
    /* Start position for animation */
    transition: opacity 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), bottom 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    /* High z-index for the popup itself */
}

.chat-widget-popup.active {
    opacity: 1;
    pointer-events: all;
    /* transform: translateY(0); */
    bottom: 80px;
    /* End position */
}

.chat-header {
    background: linear-gradient(135deg, var(--medium-roast, #6F4E37), var(--espresso, #3C2415));
    color: white;
    /* var(--coffee-foam) but using white for contrast */
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 2px solid var(--caramel, #D4A056);
}

.chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: inherit;
    font-family: 'Playfair Display', serif;
}

.chat-close {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.8;
}

.chat-close:hover {
    opacity: 1;
}

.chat-body {
    padding: 20px;
    background-color: var(--coffee-foam, #FFF8F0);
}

.chat-intro {
    font-size: 13px;
    color: #5C4033;
    /* text-medium fallback */
    margin-bottom: 15px;
    line-height: 1.4;
}

/* Form Styles */
.chat-form-group {
    margin-bottom: 12px;
}

.chat-form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #D4B996;
    /* latte */
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #3C2415;
    transition: border-color 0.2s;
}

.chat-form-control:focus {
    outline: none;
    border-color: #C17A3D;
    /* cinnamon */
    box-shadow: 0 0 0 2px rgba(193, 122, 61, 0.1);
}

textarea.chat-form-control {
    resize: vertical;
    min-height: 80px;
}

/* Phone Input Overrides ensures it fits */
.iti {
    width: 100%;
}

.iti__flag {
    background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/img/flags.png");
}

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .iti__flag {
        background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/img/flags@2x.png");
    }
}

/* Mobile Dropdown Fix */
.iti--container,
.iti__country-list {
    z-index: 2147483647 !important;
    /* Ensure dropdown is above everything */
}

/* Ensure no overflow clipping on widget parts */
.chat-widget-popup,
.chat-body,
.chat-form-group,
.iti {
    overflow: visible !important;
}

.chat-submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--caramel, #D4A056), var(--cinnamon, #C17A3D));
    color: #3C2415;
    /* espresso text on bright button */
    font-weight: bold;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.5px;
}

.chat-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(193, 122, 61, 0.3);
}

/* --- WhatsApp Widget (Right Side - Bottom) --- */
.whatsapp-widget-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    /* Right side as requested */
    z-index: 9999;
    width: 60px;
    height: 60px;
    background: #25D366;
    /* WhatsApp Green */
    border-radius: 50%;
    color: white !important;
    /* Force white icon */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.whatsapp-widget-toggle:hover {
    transform: scale(1.1);
    color: white !important;
}

.whatsapp-widget-toggle i {
    font-size: 36px;
    /* Slightly larger icon */
}

/* Green Pulse Animation */
@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

.whatsapp-widget-toggle.animate {
    animation: whatsapp-pulse 2s infinite;
}

/* --- Email Widget (Right Side - Above WhatsApp) --- */
.email-widget-toggle {
    position: fixed;
    bottom: 90px;
    /* 20px (WhatsApp bottom) + 60px (height) + 10px (gap) */
    right: 20px;
    /* Aligned with WhatsApp */
    z-index: 9999;
    width: 60px;
    height: 60px;
    background: #007bff;
    /* Blue as requested */
    border-radius: 50%;
    color: white !important;
    /* Force white icon */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.email-widget-toggle:hover {
    transform: scale(1.1);
    color: white !important;
}

.email-widget-toggle i {
    font-size: 28px;
    /* Slightly smaller than WhatsApp icon */
}

/* Blue Pulse Animation */
@keyframes email-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 123, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.email-widget-toggle.animate {
    animation: email-pulse 2s infinite;
    animation-delay: 1s;
    /* Staggered pulse */
}

/* --- Phone Widget (Right Side - Above Email) --- */
.phone-widget-toggle {
    position: fixed;
    bottom: 160px;
    /* 90px (Email bottom) + 60px (height) + 10px (gap) */
    right: 20px;
    /* Aligned with others */
    z-index: 9999;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #FFD700, #DAA520);
    /* Gold Gradient */
    border-radius: 50%;
    color: white !important;
    /* Force white icon */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.phone-widget-toggle:hover {
    transform: scale(1.1);
    color: white !important;
}

.phone-widget-toggle i {
    font-size: 28px;
}

/* Gold Pulse Animation */
@keyframes phone-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(218, 165, 32, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(218, 165, 32, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(218, 165, 32, 0);
    }
}

.phone-widget-toggle.animate {
    animation: phone-pulse 2s infinite;
    animation-delay: 2s;
    /* Staggered pulse */
}


/* Responsive */
@media (max-width: 480px) {
    .chat-widget-popup {
        width: 300px;
        left: -10px;
        /* Slight adjustment for small screens padding */
        bottom: 70px;
    }

    .whatsapp-widget-toggle {
        bottom: 20px;
        right: 15px;
        /* Closer edge on mobile */
    }

    .email-widget-toggle {
        bottom: 90px;
        /* Ensure stacked correctly on mobile too */
        right: 15px;
    }

    .phone-widget-toggle {
        bottom: 160px;
        right: 15px;
    }
}