/* Chat Container */
#chat-widget-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Toggle Area with Speech Bubble */
#chat-toggle-area {
    display: flex;
    align-items: center;
    gap: 10px;
}

#chat-bubble {
    background: white;
    border: 1px solid #ddd;
    border-radius: 18px;
    padding: 10px 16px;
    font-size: 13px;
    color: #333;
    position: relative;
    cursor: pointer;
    animation: fadeIn 0.3s ease, pulse 2s infinite;
}

#chat-bubble:after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid white;
}

#chat-bubble:before {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 9px solid #ddd;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

#chat-toggle {
    cursor: pointer;
    transition: transform 0.2s ease;
}

#chat-toggle:hover {
    transform: scale(1.1);
}

#chat-box {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 370px;
    height: 500px;
    background: #f9f9f9;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #ddd;
}

#chat-header {
    background: #C8102E;
    color: white;
    padding: 16px 20px;
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#chat-close {
    cursor: pointer;
    font-size: 24px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

#chat-close:hover {
    opacity: 1;
}

#chat-messages {
    flex: 1;
    padding: 20px 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9f9f9;
}

/* Welcome Section */
#chat-welcome {
    animation: fadeIn 0.4s ease;
}

.bot-message-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

.welcome-text {
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    padding: 12px 16px;
}

.welcome-text h3 {
    margin: 0 0 8px 0;
    font-size: 16px;
    color: #C8102E;
}

.welcome-text p {
    margin: 0;
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* Suggested Questions */
#suggested-questions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 0;
    margin-left: 50px;
    animation: fadeIn 0.5s ease;
}

.suggestions-label {
    width: 100%;
    font-size: 12px;
    color: #888;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-chip {
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
}

.suggestion-chip:hover {
    background: #C8102E;
    color: white;
    border-color: #C8102E;
}

/* Chat Messages */
.chat-msg {
    padding: 12px 16px;
    border-radius: 18px;
    max-width: 75%;
    line-height: 1.4;
    font-size: 14px;
    word-wrap: break-word;
    animation: fadeIn 0.3s ease;
}

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

.chat-msg.user {
    background: #C8102E;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg.bot {
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    flex: 1;
}

/* Typing Indicator */
.typing-indicator-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border-radius: 18px;
    border-bottom-left-radius: 4px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #C8102E;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
#chat-input-area {
    padding: 15px;
    background: white;
    display: flex;
    gap: 10px;
    border-top: 1px solid #e0e0e0;
}

#chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #0057B8;
}

#chat-input::placeholder {
    color: #999;
}

#chat-send {
    width: 44px;
    height: 44px;
    background: #C8102E;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

#chat-send:hover {
    transform: scale(1.05);
}

/* Robot Styles */
.robot-head {
    --scale: 0.6;
    width: calc(100px * var(--scale));
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.robot-small {
    --scale: 0.45;
}

.robot-hat {
    width: calc(48px * var(--scale));
    height: calc(33px * var(--scale));
    margin-bottom: calc(-15px * var(--scale));
    position: relative;
    z-index: 2;
}

.robot-head-top {
    transform-origin: bottom left;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.robot-head-top.talking {
    animation: talk 0.25s infinite;
}

@keyframes talk {
    0%   { transform: rotate(0deg); }
    50%  { transform: rotate(-30deg); }
    100% { transform: rotate(0deg); }
}

.robot-top {
    background-color: rgb(158, 185, 235);
    width: calc(90px * var(--scale));
    height: calc(45px * var(--scale));
    border-radius: calc(5px * var(--scale));
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 calc(10px * var(--scale));
    position: relative;
    z-index: 1;
}

.robot-eye {
    width: calc(12px * var(--scale));
    height: calc(12px * var(--scale));
    background: rgb(0, 0, 0);
    border-radius: 50%;
    transition: transform 0.05s ease-out;
}

.robot-bottom {
    background-color: rgb(143, 169, 218);
    width: calc(90px * var(--scale));
    height: calc(15px * var(--scale));
    border-radius: calc(5px * var(--scale));
    margin-top: calc(2px * var(--scale));
}

/* Override any inherited shadows */
#chat-widget-container * {
    box-shadow: none !important;
}