/* Keyframes do not get prefixed */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(10px); }
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* === BUTTONS === */
#my-chatbot-widget button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: none;
    border: none;
    font-family: inherit;
    margin: 0;
    padding: 0;
}

#my-chatbot-widget .btn {
    border: 1px solid transparent;
    border-radius: 0.25rem;
    cursor: pointer;
    display: inline-block;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 0.375rem 0.75rem;
    text-align: center;
    text-decoration: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out;
    user-select: none;
    vertical-align: middle;
}

#my-chatbot-widget .btn-primary {
    background-color: #75787B;
    border-color: #75787B;
    color: #fff;
    transition: background-color 0.3s ease;
}

#my-chatbot-widget .btn-primary:disabled {
    background-color: #A11C2D !important;
    color: white !important;
    cursor: not-allowed;
    opacity: 0.7;
}

#my-chatbot-widget .btn-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(161, 28, 45, 0.25);
    outline: none;
}

#my-chatbot-widget .btn-primary:hover {
    background-color: #A11C2D;
    color: white;
}

#my-chatbot-widget .chat-button {
    align-items: center;
    background-color: #A11C2D;
    border: none;
    border-radius: 30px;
    bottom: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    color: white;
    cursor: pointer;
    display: flex;
    font-size: 16px;
    gap: 8px;
    padding: 12px 24px;
    position: fixed;
    right: 20px;
    transition: all 0.3s;
    z-index: 9995;
    bottom: 100px;
}

#my-chatbot-widget .chat-button:hover {
    background-color: #75787B;
    transform: scale(1.05);
}

#my-chatbot-widget .close-btn {
    background: transparent;
    border: none;
    color: rgb(230, 218, 218);
    cursor: pointer;
    font-size: 20px;
}

/* === CONTAINERS === */
#my-chatbot-widget .chat-popup {
    align-items: center;
    animation: fadeIn 0.3s;
    background: white;
    border-radius: 15px;
    bottom: 80px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    display: none;
    justify-content: center;
    position: fixed;
    right: 30px;
    width: 350px;
    z-index: 9998;
}

#my-chatbot-widget .container {
    max-width: 100% !important;
    position: static !important;
}

/* === FORM ELEMENTS === */
#my-chatbot-widget .form-control {
    background-clip: padding-box;
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    box-sizing: border-box;
    color: #212529;
    display: block;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    margin-bottom: 15px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    width: 100%;
    max-width: 100%;
}

#my-chatbot-widget .form-control:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

#my-chatbot-widget .form-label {
    font-weight: 500;
    margin-bottom: 12px;
    margin-top: 15px;
    display: block;
}

#my-chatbot-widget .chat-button:before {
    content: "💬"; /* Unicode speech bubble */
    margin-right: 1px;
    font-size: 1.2em;
}

#my-chatbot-widget .popup-header h3:before {
    content: "💬";
    margin-right: 8px;
}

/* === MESSAGES === */
#my-chatbot-widget .error-message {
    font-size: 14px;
}

#my-chatbot-widget .success-message {
    animation: fadeIn 0.5s;
    background: #d4edda;
    border-radius: 5px;
    color: #155724;
    margin-top: 10px;
    padding: 15px;
    text-align: center;
}

#my-chatbot-widget .success-message i {
    color: #75787B;
    margin-right: 8px;
}

/* === POPUP ELEMENTS === */
#my-chatbot-widget .popup-body {
    box-sizing: border-box;
    padding: 10px 20px 20px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    padding: 15px;
}

#my-chatbot-widget .popup-content {
    width: 100%;
}

#my-chatbot-widget .popup-header {
    align-items: center;
    background: #A11C2D;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    color: white;
    display: flex;
    justify-content: space-between;
    padding: 15px;
}

#my-chatbot-widget .popup-header h3 {
    font-size: 18px;
    margin: 0;
    font-weight: 500;
}

/* === SPINNER === */
#my-chatbot-widget .spinner-border {
    animation: spinner-border 0.75s linear infinite;
    border: 0.25em solid currentColor;
    border-radius: 50%;
    border-right-color: transparent;
    display: inline-block;
    height: 1rem;
    vertical-align: -0.125em;
    width: 1rem;
}

#my-chatbot-widget .spinner-border-sm {
    border-width: 0.2em;
    height: 0.75rem;
    width: 0.75rem;
}

/* === UTILITY CLASSES === */
#my-chatbot-widget .d-none {
    display: none !important;
}

#my-chatbot-widget .is-invalid {
    border-color: #dc3545;
}

#my-chatbot-widget .mb-3 {
    margin-bottom: 1rem !important;
}

#my-chatbot-widget .me-2 {
    margin-right: 0.5rem !important;
}

#my-chatbot-widget .message-box {
    margin-top: 15px;
}

#my-chatbot-widget .mt-1 {
    margin-top: 0.25rem !important;
}

#my-chatbot-widget .mt-2 {
    margin-top: 0.5rem !important;
}

#my-chatbot-widget .w-100 {
    width: 100% !important;
}

/* === FORM ELEMENTS === */
#my-chatbot-widget #status {
    font-size: 14px;
    text-align: center;
}

#my-chatbot-widget .whatsapp-container {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 100%;
    box-sizing: border-box;
  }
  
#my-chatbot-widget #userMessage {
    width: 100%;
    resize: vertical;
    min-height: 80px;
    max-height: 150px;
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
  }
  
/* Chat Container */
#my-chatbot-widget .chat-container {
    height: 400px;
    display: flex;
    flex-direction: column;
}

#my-chatbot-widget .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 15px;
}

#my-chatbot-widget .chat-input {
    display: flex;
    gap: 10px;
}

#my-chatbot-widget #userInput {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Message Styling */
#my-chatbot-widget .message {
    margin: 8px 0;
    padding: 10px 15px;
    border-radius: 15px;
    max-width: 80%;
}

#my-chatbot-widget .user-message {
    background-color: #75787B;
    color: white;
    margin-left: auto;
}

#my-chatbot-widget .bot-message {
    background-color: #e9ecef;
    color: #212529;
    margin-right: auto;
}

#my-chatbot-widget #loading {
    text-align: center;
    padding: 10px;
}

#my-chatbot-widget .phone-input-group {
    display: flex;
    gap: 10px;
}
#my-chatbot-widget .country-code-select {
    flex: 0 0 120px;
}
#my-chatbot-widget .phone-number-input {
    flex: 1;
}

#my-chatbot-widget .hide { display: none; }
#my-chatbot-widget .error-message { color: #dc3545; font-size: 0.875em; }
#my-chatbot-widget .iti { width: 100%; }

/* Button container */
#my-chatbot-widget .button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
    padding: 0 15px;
    box-sizing: border-box;
}

/* Chat buttons */
#my-chatbot-widget .chat-btn {
    border: none;
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1 1 40%;
    max-width: 200px;
    min-width: 140px;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    font-size: 1rem;
    white-space: nowrap;
}

/* Button styles */
#my-chatbot-widget #chatHereBtn {
    background-image: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

#my-chatbot-widget #chatWhatsAppBtn {
    background-image: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
}

#my-chatbot-widget .chat-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Shine effect */
#my-chatbot-widget .chat-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        120deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    transition: 0.5s;
}
#my-chatbot-widget .chat-btn:hover::after {
    left: 100%;
}

#my-chatbot-widget .chat-btn i {
    margin-right: 8px;
    font-size: 1.2em;
}

/* Mobile styles */
@media (max-width: 576px) {
    #my-chatbot-widget .button-group {
        flex-direction: column;
        align-items: center;
    }
    #my-chatbot-widget .chat-btn {
        max-width: 100%;
        width: 100%;
    }
}
#my-chatbot-widget .whatsapp-note {
    font-size: 0.9rem;
    color: #555;
    text-align: center;
    margin-top: 10px;
    padding: 0 15px;
  }

#my-chatbot-widget .bot-message h1,
#my-chatbot-widget .bot-message h2,
#my-chatbot-widget .bot-message h3 {
  margin: 10px 0 5px;
  font-weight: 600;
  color: #333;
}

#my-chatbot-widget .bot-message h1 {
  font-size: 1.3em;
}
#my-chatbot-widget .bot-message h2 {
  font-size: 1.2em;
}
#my-chatbot-widget .bot-message h3 {
  font-size: 1.1em;
}

#my-chatbot-widget .chat-header {
    background-color: #ab8b8f;
    padding: 6px 10px;
    color: white;
    display: flex;
    align-items: center;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

#my-chatbot-widget .chat-title {
    flex: 1;
    text-align: center;
    font-size: 1rem;
    font-weight: 600;
}
/* === RESPONSIVE CHAT POPUP === */
@media only screen and (max-width: 768px) {
    #my-chatbot-widget .chat-popup {
        width: 300px;
        right: 15px;
        bottom: 70px;
    }
    #my-chatbot-widget .chat-button {
        right: 20px;
        bottom: 150px;
        padding: 10px 20px;
        font-size: 14px;
    }
    #my-chatbot-widget .iti {
        width: 100% !important;
    }
    #my-chatbot-widget .iti__flag-container {
        height: 48px; /* Match input height */
    }
    #my-chatbot-widget .form-control {
        font-size: 14px;
        padding: 10px;
    }
}

@media only screen and (max-width: 576px) {
    body.iti-mobile, #my-chatbot-widget body.iti-mobile {
        width: 100%;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    #my-chatbot-widget .chat-popup {
        width: 360px;
        max-width: 95%;
        right: 50%;
        transform: translateX(50%);
        bottom: 60px;
    }

    #my-chatbot-widget .chat-popup {
        width: 360px;
        max-width: 95%;
        right: 20px;
        transform: none;
        bottom: 150px;
    }

    #my-chatbot-widget .iti {
        width: 100% !important;
    }

    #my-chatbot-widget .iti__flag-container {
        height: 44px;
    }

    #my-chatbot-widget .iti__country-list {
        max-height: 200px;
        overflow-y: auto;
    }

    #my-chatbot-widget .form-control {
        font-size: 14px;
        padding: 8px;
    }
}