.chat-icon {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #01427f 0%, #002a52 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(1, 66, 127, 0.45);
    z-index: 9100;
    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 #01427f;
}

.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: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 140px);
    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: 9000;
    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: 576px) {
    .chat-window {
        bottom: 80px !important;
        right: 10px !important;
        left: 10px !important;
        width: calc(100% - 20px) !important;
        max-width: 380px !important;
        height: 70vh !important;
        max-height: 500px !important;
        border-radius: 15px !important;
    }

    .chat-icon {
        width: 50px !important;
        height: 50px !important;
        bottom: 15px !important;
        right: 15px !important;
    }

    .chat-popup {
        right: 15px !important;
        max-width: 200px !important;
        font-size: 0.8em !important;
    }

    .chat-header {
        padding: 12px !important;
        font-size: 0.95em !important;
    }

    .chat-messages {
        padding: 12px !important;
    }

    .message {
        max-width: 92% !important;
        padding: 10px 14px !important;
        font-size: 0.88em !important;
    }

    .chat-input {
        padding: 10px !important;
    }
}

.chat-header {
    background: linear-gradient(135deg, #01427f 0%, #01427f 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, #01427f, #002a52);
    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(1, 66, 127, 0.15);
    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: #01427f;
    box-shadow: 0 0 0 3px rgba(1, 66, 127, 0.12);
    background: rgba(255, 255, 255, 1);
}

#user-input::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

.send-btn {
    background: linear-gradient(135deg, #01427f 0%, #002a52 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(1, 66, 127, 0.35);
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(1, 66, 127, 0.5);
}

.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, #01427f 0%, #002a52 100%);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    box-shadow: 0 4px 15px rgba(1, 66, 127, 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: 110px;
    right: 25px;
    background: white;
    color: #01427f;
    padding: 15px 20px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 9100;
    max-width: 250px;
    font-size: 0.9em;
    line-height: 1.4;
    border: 2px solid #01427f;
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.chat-popup.show {
    display: block;
}

.chat-popup::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 30px;
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: #01427f transparent transparent;
}