/* Chat Widget Core Styles */
#chat-widget * {
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

#chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 350px;
    max-width: calc(100% - 40px);
    height: 500px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(30px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    border: 2px solid #005baa;
}

/* Mobile Fullscreen Mode */
@media (max-width: 768px) {
    #chat-widget.mobile-fullscreen {
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        border: none;
    }
}

#chat-widget.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    background: #005baa;
    color: white;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
}

#chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f5f5f5;
    scroll-behavior: smooth;
}

.bot-message {
    background: white;
    padding: 10px 15px;
    border-radius: 18px 18px 18px 0;
    margin-bottom: 10px;
    max-width: 80%;
    display: inline-block;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    border: 1px solid #e0e0e0;
    animation: fadeIn 0.3s ease;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}

.option-btn {
    background: #005baa;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: background 0.2s;
    width: 100%;
}

.option-btn:hover {
    background: #003d7a;
}

.chat-input-container {
    padding: 10px;
    background: white;
    border-top: 1px solid #eee;
    display: none;
    position: relative;
}

#user-input {
    width: calc(100% - 50px);
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
}

#send-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: #005baa;
    color: white;
    border-radius: 50%;
    margin-left: 5px;
    cursor: pointer;
    font-size: 16px;
    position: absolute;
    right: 10px;
    top: 10px;
    transition: background 0.2s;
}

#send-btn:hover {
    background: #003d7a;
}

#chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #005baa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    border: none;
    transition: all 0.3s ease;
}

#chat-toggle.hidden {
    display: none;
}

#chat-toggle:hover {
    background: #003d7a;
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.mini-dialog {
    position: fixed;
    bottom: 90px;
    right: 20px;
    max-width: 300px;
    width: calc(100% - 40px);
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    padding: 15px;
    border: 2px solid #005baa;
    z-index: 10001;
    display: none;
    flex-direction: column;
    animation: slideIn 0.3s ease;
}

.mini-dialog-close {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    padding: 5px;
}

.mini-dialog-content {
    padding: 10px 0;
    font-size: 14px;
    line-height: 1.4;
}

.mini-dialog-footer {
    margin-top: 10px;
}

.mini-dialog-btn {
    background: #005baa;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    transition: background 0.2s;
}

.mini-dialog-btn:hover {
    background: #003d7a;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Mobile optimizations */
@media (max-width: 480px) {
    #chat-widget {
        right: 10px;
        bottom: 10px;
        max-width: calc(100% - 20px);
    }
    
    .mini-dialog {
        right: 10px;
        bottom: 80px;
        max-width: calc(100% - 20px);
    }
    
    
    
    #chat-toggle {
        right: 10px;
        bottom: 10px;
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

.error-message {
    color: #ff4444;
    margin: 10px 0;
    text-align: center;
    font-size: 14px;
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}