/* --- FIX: CSS RESET FOR CHATBOT CONTAINER --- */
/* Yeh code chatbot ko bahari CSS ke asar se bachata hai */
#cph-chatbot-container, #cph-chatbot-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
    background: transparent;
    font-family: 'Inter', sans-serif;
}

/* General Container Styling */
#cph-chatbot-container {
    font-family: 'Inter', sans-serif;
    color: #333;
}

/* Color Variables Synced with Your Website */
:root {
    --primary-color: #f59e0b;
    --primary-dark: #d97706;
    --secondary-color: #fef3c7;
    --text-color: #333;
    --bg-color: #ffffff;
    --input-bg: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-light: rgba(0, 0, 0, 0.08);
    --shadow-medium: rgba(0, 0, 0, 0.15);
}

/* --- FIX: FORCE FONT AWESOME STYLES --- */
/* Yeh code sunishchit karta hai ki icon सही se dikhein */
#cph-chatbot-container .fas,
#cph-chatbot-container .fa-solid {
    font-family: 'Font Awesome 6 Free' !important;
    font-weight: 900 !important;
    font-style: normal !important;
    color: white !important;
    display: inline-block;
    line-height: 1;
}

/* Floating Chat Icon */
#cph-chatbot-container #chat-icon {
    position: fixed;
    left: 20px;
    bottom: 20px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 6px 12px var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: all 0.3s ease;
    animation: pulse 2.5s infinite;
}
/* Icon inside the main bubble */
#cph-chatbot-container #chat-icon i {
    font-size: 30px;
}

#cph-chatbot-container #chat-icon:hover {
    transform: scale(1.1);
    animation: none;
}

/* Chat Popup Window */
#cph-chatbot-container #chat-popup {
    position: fixed;
    left: 20px;
    bottom: 90px;
    width: 380px;
    max-height: 80vh;
    box-shadow: 0 10px 30px var(--shadow-medium);
    border-radius: 15px;
    background: white;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 10000;
    transform-origin: bottom left;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: translateY(20px) scale(0.95);
}

#cph-chatbot-container #chat-popup.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
#cph-chatbot-container #chat-header {
    background: var(--primary-color);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    flex-shrink: 0; /* Prevents header from shrinking */
}
#cph-chatbot-container #chat-header-title {
    font-size: 18px;
    font-weight: 600;
    color: white;
}
#cph-chatbot-container #chat-close {
    cursor: pointer;
    font-size: 24px;
    transition: transform 0.2s;
    color: white;
    font-weight: normal;
}
#cph-chatbot-container #chat-close:hover {
    transform: scale(1.2);
}

/* Chat History (Message Area) */
#cph-chatbot-container #chat-history {
    padding: 20px;
    flex-grow: 1;
    overflow-y: auto;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 14px;
}
#cph-chatbot-container #chat-history::-webkit-scrollbar { width: 6px; }
#cph-chatbot-container #chat-history::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

/* User Input Area */
#cph-chatbot-container #chat-input-area {
    display: flex;
    gap: 10px;
    padding: 15px;
    background: var(--input-bg);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}
#cph-chatbot-container #user-input {
    flex-grow: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 15px;
    color: #333;
    transition: all 0.2s;
}
#cph-chatbot-container #user-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px var(--secondary-color);
    outline: none;
}
#cph-chatbot-container #send-btn {
    background: var(--primary-color);
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
#cph-chatbot-container #send-btn i {
    font-size: 16px;
}
#cph-chatbot-container #send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Message Bubbles */
#cph-chatbot-container .chat-message {
    max-width: 85%;
    word-wrap: break-word;
    padding: 12px 18px;
    border-radius: 18px;
    line-height: 1.5;
    box-shadow: 0 1px 3px var(--shadow-light);
    color: var(--text-color);
}
#cph-chatbot-container .chat-message a {
    color: var(--primary-dark) !important;
    text-decoration: underline;
    font-weight: 600;
}
#cph-chatbot-container .user-msg {
    background-color: var(--primary-color);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
#cph-chatbot-container .bot-msg {
    background-color: var(--secondary-color);
    color: var(--text-color);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
#cph-chatbot-container .quick-question {
    background-color: transparent;
    color: var(--primary-dark);
    border: 1px solid var(--primary-color);
    padding: 6px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}
#cph-chatbot-container .quick-question:hover {
    background-color: var(--primary-color);
    color: white;
}
#cph-chatbot-container .questions-container {
    display: flex; flex-wrap: wrap; gap: 8px;
    margin-top: 10px; align-self: flex-start;
}

/* Typing Indicator & Animations */
#cph-chatbot-container .typing-indicator span {
    display: inline-block; width: 7px; height: 7px; background-color: #999;
    border-radius: 50%; margin: 0 2px; animation: dot-bounce 1s infinite ease-in-out;
}
#cph-chatbot-container .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
#cph-chatbot-container .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce { 50% { transform: translateY(-4px); } }
@keyframes pulse { 0% { transform: scale(1); } 70% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* Responsive Design */
@media (max-width: 480px) {
    #cph-chatbot-container #chat-popup {
        width: calc(100% - 20px); left: 10px; bottom: 80px; max-height: 80vh; height: 80vh;
    }
    #cph-chatbot-container #chat-icon {
        left: 15px; bottom: 15px; width: 55px; height: 55px;
    }
}