.chat-icon {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: iconBounce 0.6s ease-out;
}
.chat-icon:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.6);
}
.chat-icon i {
    font-size: 28px;
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}
@keyframes iconBounce {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
.chat-window {
    display: none;
    position: fixed;
    bottom: 110px;
    right: 25px;
    width: 380px;
    height: 520px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 768px) {
    .chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        top: 0;
        width: 100vw;
        height: 90vh;
        border-radius: 0;
        max-width: 100vw;
        max-height: 100vh;
    }
    .chat-header {
        border-radius: 0 !important;
        font-size: 1.3em !important;
        padding: 20px 15px !important;
    }
    .chat-messages,
    .chat-input,
    #user-input,
    .message {
        font-size: 1.15em !important;
    }
    .chat-input {
        padding: 15px 8px !important;
        flex-direction: row;
        gap: 8px;
    }
    #user-input {
        min-width: 0;
        width: 100%;
        font-size: 1.1em;
        padding: 12px 10px;
    }
    .send-btn {
        min-width: 44px;
        max-width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 12px;
        font-size: 1.2em;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}
.chat-header span {
    font-weight: 600;
    font-size: 1.1em;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}
.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}
.chat-messages {
    flex-grow: 1;
    padding: 25px 20px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
}
.chat-messages::-webkit-scrollbar {
    width: 6px;
}
.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
}
.chat-input {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    align-items: flex-end;
}
#user-input {
    flex-grow: 1;
    padding: 15px 18px;
    border: 2px solid rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    font-size: 0.95em;
    font-family: 'Inter', sans-serif;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    outline: none;
    color: #2d3748;
    resize: none;
    min-height: 50px;
    max-height: 120px;
}
#user-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(255, 255, 255, 1);
}
#user-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}
.send-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 15px 18px;
    cursor: pointer;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.send-btn:active {
    transform: translateY(0);
}
.send-btn i {
    font-size: 18px;
}
.message {
    margin: 15px 0;
    padding: 15px 20px;
    border-radius: 18px;
    max-width: 85%;
    position: relative;
    animation: messageSlide 0.3s ease-out;
    word-wrap: break-word;
    line-height: 1.5;
}
@keyframes messageSlide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.user-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    border-bottom-right-radius: 8px;
}
.assistant-message {
    background: rgba(255, 255, 255, 0.9);
    color: #2d3748;
    align-self: flex-start;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border-bottom-left-radius: 8px;
}
.welcome-message {
    text-align: center;
    color: #6b7280;
    font-style: italic;
    padding: 20px;
    opacity: 0.8;
}
.fade-in {
    animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.chat-popup {
    position: fixed;
    bottom: 105px;
    right: 105px;
    background: white;
    color: #2d3748;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(102,126,234,0.18);
    padding: 18px 22px;
    font-size: 1.05em;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.4s, transform 0.4s;
}
.chat-popup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}
.chat-popup-hidden {
    opacity: 0 !important;
    pointer-events: none !important;
}
@media (max-width: 600px) {
    .chat-popup {
        right: 20px;
        left: 20px;
        bottom: 100px;
        font-size: 1em;
        padding: 14px 12px;
    }
}