/* ===== BEAUTIFUL CHAT SYSTEM ===== */

/* WhatsApp Chat Modal Styles - Beautiful Version */
.whatsapp-modal-overlay {
    position: fixed;
    top: 0px;
    left: 35px;
    right: 5px;
    bottom: 50px;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    display: none;
    backdrop-filter: blur(5px);
}

.whatsapp-container {
    width: 100%;
    max-width: 380px;
    height: 600px;
    background-color: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: modalAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.chat-header {
    background: linear-gradient(135deg, #075E54, #128C7E);
    padding: 2px 19px;
    display: flex;
    align-items: center;
    color: white;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-pic {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    background: white;
    padding: 2px;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 4px;
    letter-spacing: 0.3px;
}

.contact-status {
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
}

.status-indicator {
    width: 8px;
    height: 8px;
    background-color: #4ade80;
    border-radius: 50%;
    margin-right: 8px;
    box-shadow: 0 0 10px #4ade80;
    animation: statusPulse 2s infinite;
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.header-icons {
    display: flex;
    gap: 20px;
    font-size: 18px;
}

.header-icons i {
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.header-icons i:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.chat-body {
    flex: 1;
    background-color: #e5ddd5;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23055e5433' fill-opacity='0.2' fill-rule='evenodd'/%3E%3C/svg%3E");
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
    line-height: 1.4;
    font-size: 14.5px;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.1);
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.receiver {
    background-color: white;
    align-self: flex-start;
    border-top-left-radius: 5px;
}

.sender {
    background-color: #DCF8C6;
    align-self: flex-end;
    border-top-right-radius: 5px;
}

.message-time {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    text-align: right;
    margin-top: 5px;
    float: right;
    margin-left: 10px;
}

.quick-options {
    background-color: none;
    border-radius: 18px;
    border-top-left-radius: 5px;
    padding: 9px;
    max-width: 85%;
    align-self: flex-start;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.1);
}

.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.option-btn {
    padding: 5px 16px;
    background: linear-gradient(135deg, #f5f7fa, #f0f2f5);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 15px;
    border: none;
    text-align: left;
    color: #3b4a54;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.option-btn:hover {
    background: linear-gradient(135deg, #e8eaed, #e3e5e8);
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.option-btn:active {
    transform: translateX(5px) scale(0.98);
}

.option-btn i {
    font-size: 16px;
    color: #25D366;
    opacity: 0.9;
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
}

.chat-input {
    padding: 14px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: all 0.3s;
    background: white;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.chat-input:focus {
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.send-button {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    align-self: flex-end;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

.send-button:hover {
    background: linear-gradient(135deg, #128C7E, #075E54);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
}

.send-button:active {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 10000;
    font-size: 22px;
    color: #075E54;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.close-modal:hover {
    background: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}

/* ===== BEAUTIFUL CHAT BUTTON ===== */
.whatsapp-trigger {
    position: fixed;
    bottom: 55px;
    right: 10px;
    background: white;
    border: none;
    width: 80px;
    height: 80px;
    border-radius: 12px; /* Changed from 50% to 16px for rounded square */
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9998;
    font-size: 32px;
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.4);
    transition: all 0.4s;
    animation: floatButton 3s ease-in-out infinite;
    border: 2px solid white;
    overflow: hidden;
    padding: 0;
}

@keyframes floatButton {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.whatsapp-trigger::before {
    content: '';
    position: absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    bottom: 0px;
    border-radius: 00%;
    background: linear-gradient(135deg, #25D366, #128C7E, #25D366);
    background-size: 20% 20%;
    z-index: -1;
    animation: shimmer 3s ease infinite;
}

@keyframes shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.whatsapp-trigger:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6);
}

.whatsapp-trigger i {
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.whatsapp-trigger::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, transparent 70%);
    border-radius: 50%;
}

/* ===== BEAUTIFUL CHAT POPUP MESSAGE ===== */
.chat-pop-msg {
    position: fixed;
    bottom: 165px;
    right: 25px;
    background: white;
    border-radius: 20px 20px 20px 5px;
    padding: 20px;
    width: 320px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    z-index: 9997;
    animation: slideInPopup 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: none;
    border: 1px solid rgba(0, 0, 0, 0.1);
    transform-origin: bottom right;
}

@keyframes slideInPopup {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-pop-msg::before {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: white transparent transparent;
}

.chat-pop-msg::after {
    content: '';
    position: absolute;
    bottom: -12px;
    right: 29px;
    border-width: 11px 11px 0;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.1) transparent transparent;
    z-index: -1;
}

.chat-pop-msg .fa-close {
    position: absolute;
    top: 12px;
    right: 12px;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    background: #f8f9fa;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2;
    border: none;
    outline: none;
}

.chat-pop-msg .fa-close:hover {
    color: #ff4757;
    background: #ffeef0;
    transform: rotate(90deg) scale(1.1);
}

.chat-pop-msgtxt {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 20px;
    color: #333;
    position: relative;
    padding-left: 60px;
    min-height: 50px;
}

.chat-assistant-gif {
    position: absolute;
    left: 0;
    top: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid #25D366;
    overflow: hidden;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.chat-assistant-gif img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-pop-msgtxt strong {
    font-weight: 600;
    color: #075E54;
    display: block;
    margin-top: 8px;
    font-size: 16px;
}

.chat-pop-msgtxt .typing-text {
    color: #25D366;
    font-weight: 500;
    position: relative;
    padding-right: 10px;
}

.typing-text::after {
    content: '|';
    position: absolute;
    right: 0;
    animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.chat-pop-msgtxt ul {
    margin: 10px 0 0 0;
    padding: 0 0 0 18px;
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

.chat-pop-msgtxt ul li {
    margin-bottom: 5px;
    position: relative;
}

.chat-pop-msgtxt ul li::marker {
    color: #25D366;
    font-size: 1.2em;
}

.chat-pop-sm-btn {
    
    color: white;
    border: none;
    padding: 14px 14px;
    border-radius: 14px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    font-size: 16px;
    transition: all 0.4s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.chat-pop-sm-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.7s;
}

.chat-pop-sm-btn:hover::before {
    left: 100%;
}

.chat-pop-sm-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(37, 211, 102, 0.4);
}

.chat-pop-sm-btn:active {
    transform: translateY(-1px);
}

/* ===== MINIMIZED STATE ===== */
.whatsapp-container.minimized {
    height: 70px;
    width: 320px;
    border-radius: 35px;
    cursor: pointer;
    overflow: hidden;
    position: fixed;
    bottom: 25px;
    right: 25px;
    animation: minimizeAppear 0.3s ease;
    /* Add these to ensure it's above other content */
    z-index: 9999;
}
/* Remove backdrop blur and make overlay transparent when minimized */
.whatsapp-modal-overlay.minimized {
    background: transparent !important;
    backdrop-filter: none !important;
    pointer-events: none; /* Allow clicks to pass through */
    z-index: 9998; /* Below the minimized chat but above page content */
}
.whatsapp-modal-overlay.minimized .whatsapp-container {
    pointer-events: auto; /* But still allow clicks on the chat itself */
}

/* When overlay is not minimized (chat is open), show the backdrop */
.whatsapp-modal-overlay:not(.minimized) {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    pointer-events: auto;
}
@keyframes minimizeAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.whatsapp-container.minimized .chat-header {
    border-radius: 35px;
    padding: 14px 24px;
    cursor: pointer;
    height: 100%;
    width: 100%;
    pointer-events: auto;
}

.whatsapp-container.minimized .profile-pic {
    width: 42px;
    height: 42px;
    margin-right: 12px;
}

.whatsapp-container.minimized .contact-info {
    flex: 1;
}

.whatsapp-container.minimized .contact-status {
    font-size: 12px;
}

.whatsapp-container.minimized .contact-name {
    font-size: 15px;
    margin-bottom: 2px;
}

.whatsapp-container.minimized .header-icons {
    display: none;
}

.whatsapp-container.minimized .chat-body,
.whatsapp-container.minimized .input-wrapper {
    display: none !important;
}

.minimized-notification {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
    padding: 16px 20px;
    border-radius: 14px;
    margin: 15px;
    font-size: 14px;
    text-align: center;
    animation: slideInNotification 0.4s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideInNotification {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.minimized-notification:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* ===== TYPING INDICATOR ===== */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: white;
    border-radius: 18px;
    width: fit-content;
    box-shadow: 0 1px 0.5px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
}

.typing-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background-color: #999;
    animation: typingBounce 1.4s infinite;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .whatsapp-modal-overlay {
        padding: 0;
        align-items: flex-end;
        justify-content: center;
    }
    
    .whatsapp-container {
        width: 100%;
        height: 85vh;
        max-width: none;
        border-radius: 20px 20px 0 0;
    }
    
    .whatsapp-trigger {
        bottom: 45px;
        right: 30px;
        width: 64px;
        height: 64px;
        font-size: 30px;
    }
    
    .chat-pop-msg {
        bottom: 130px;
        right: 20px;
        width: calc(100vw - 40px);
        max-width: 320px;
    }
    
    .whatsapp-container.minimized {
        width: 280px;
        right: 10px;
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    .whatsapp-trigger {
        bottom: 45px;
        right: 45px;
        width: 60px;
        height: 60px;
        font-size: 28px;
    }
    
    .chat-pop-msg {
        width: calc(100vw - 30px);
        max-width: 300px;
        right: 15px;
        padding: 16px;
    }
    
    .chat-pop-msgtxt {
        padding-left: 55px;
    }
    
    .chat-assistant-gif {
        width: 45px;
        height: 45px;
    }
}

/* Hide old button */
.chatbot__button {
    display: none !important;
}

/* Success message */
.success-message {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    border-left: 4px solid #28a745;
    color: #155724;
    padding: 18px;
    border-radius: 12px;
    margin: 15px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Error message */
.message.receiver.error {
    background: linear-gradient(135deg, #f8d7da, #f5c6cb);
    border-left: 4px solid #dc3545;
    color: #721c24;
}

/* Input focus enhancement */
.chat-input:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.1), inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Button states */
.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.send-button:disabled:hover {
    background: linear-gradient(135deg, #25D366, #128C7E);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}
/* ===== RESPONSIVE DESIGN - FIXED MOBILE CHAT HEADER ===== */
@media (max-width: 768px) {
    /* Fix the chat header for mobile */
    .chat-header {
        padding: 8px 8px; /* Increased padding for better spacing */
        min-height: 60px; /* Ensure minimum height */
    }
    
    /* Scale down profile picture on mobile */
    .profile-pic {
        width: 40px;  /* Reduced from 48px */
        height: 40px; /* Reduced from 48px */
        margin-right: 12px; /* Reduced margin */
    }
    
    /* Adjust contact info for mobile */
    .contact-name {
        font-size: 16px; /* Slightly smaller */
        margin-bottom: 2px;
    }
    
    .contact-status {
        font-size: 12px; /* Smaller status text */
    }
    
    /* Scale down header icons */
    .header-icons {
        gap: 15px; /* Reduced gap */
    }
    
    .header-icons i {
        width: 32px;  /* Smaller icon containers */
        height: 32px;
        font-size: 16px; /* Smaller icon size */
    }
}

@media (max-width: 480px) {
    /* Further adjustments for very small screens */
    .chat-header {
        padding: 6px 6px;
        min-height: 55px;
    }
    
    .profile-pic {
        width: 36px;  /* Even smaller */
        height: 36px;
        margin-right: 10px;
    }
    
    .contact-name {
        font-size: 14px;
    }
    
    .contact-status {
        font-size: 11px;
    }
    
    .header-icons {
        gap: 12px;
    }
    
    .header-icons i {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}

/* Ensure images don't overflow their containers */
.profile-pic,
.chat-assistant-gif {
    max-width: 100%;
    height: auto;
    object-fit: cover !important;
}