/* Emergency Chat Assistant Styles */
.emergency-chat-container {
    position: fixed;
    bottom: 30px;
    right: 25px;
    z-index: 2500;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.chat-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: #d64045;
    color: white !important;
    border: none;
    border-radius: var(--radius-full);
    padding: 12px 20px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(214, 64, 69, 0.25);
    transition: all var(--transition-normal);
}

.chat-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(214, 64, 69, 0.35);
}

.chat-toggle-btn i {
    font-size: 1.2rem;
}

.chat-panel {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    height: 500px;
    background-color: white;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    transform-origin: bottom right;
}

.chat-panel.hidden {
    transform: scale(0.9);
    opacity: 0;
    pointer-events: none;
}

.chat-header {
    padding: 15px;
    background-color: #d64045;
    color: white !important;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-header h3 {
    color: white !important;
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-close-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.chat-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}


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

.message {
    max-width: 90%;
    padding: 10px 14px 10px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    animation: messageAppear 0.3s forwards;
    box-shadow: 0 0px 2px rgba(0, 0, 0, 0.7);
}

.user-message {
    align-self: flex-end;
    background-color: #1a75bc;
    color: white;
    border-bottom-right-radius: 4px;
    margin-left: 30px;
}

.bot-message {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    margin-right: 40px;
    position: relative;
    padding-left: 40px;
}

.bot-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background-color: #d64045;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    margin-left: -50px;
    margin-right: 0px;
    margin-top: -20px;
    z-index: 2;
}
.bot-icon i {
    font-size: 15px;
    color: white;
}

.message-content {
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 40px;
}

.message-content p {
    margin: 0 0 8px 0;
    padding-bottom: 12px;
    font-size: 0.95rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul, 
.message-content ol {
    margin: 4px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 4px;
    line-height: 1.4;
}

.message-content strong {
    font-weight: 600;
}

.message-content em {
    font-style: italic;
    opacity: 0.9;
}

/* Fix for removing extra spacing in lists */
.message-content ul ul,
.message-content ul ol,
.message-content ol ul,
.message-content ol ol {
    margin: 2px 0;
}

.message-time {
    position: absolute;
    bottom: -7px;
    right: 0;
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0;
    margin-bottom: 4px;
    text-align: right;
    line-height: 1;
    padding: 2px 0;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 10px;
    background-color: var(--gray-50);
}

#chat-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    transition: all 0.2s;
}

#chat-input:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 117, 188, 0.1);
}

#chat-send-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

#chat-send-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

.typing-indicator {
    display: flex;
    align-items: center;
    margin-top: 5px;
    gap: 3px;
}

.typing-indicator-container {
    max-width: 100px !important;
    max-height: 65px !important;
    min-height: 65px !important;
    width: auto !important;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--gray-500);
    border-radius: 50%;
    animation: typingPulse 1.4s infinite ease-in-out;
}

.typing-indicator-container .message-content {
    background-color: #f0f0f0;
    border-radius: 18px;
    padding: 12px 16px;
    min-height: 42px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    width: auto !important;
    max-width: 80px !important;
    display: inline-block;
}

.typing-indicator-container .typing-indicator {
    margin-top: 0;
    padding: 6px 0;
    display: flex;
    align-items: center;
}

.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 typingPulse {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* For mobile devices */
@media (max-width: 600px) {
    .emergency-chat-container {
        right: 20px;
        bottom: 20px;
    }

    .chat-panel {
        width: 90vw;
        height: 70vh;
        bottom: 70px;
        right: 0;
    }
    
    .chat-toggle-btn {
        padding: 10px 15px;
        gap: 6px;
    }
    
    .chat-toggle-btn span {
        font-size: 0.9rem;
    }
}