/* AI Chat Float Button */
.ai-chat-float {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #af8b28 0%, #192f59 100%);
    color: white;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 1001;
    transition: all 0.3s ease;
    animation: bounce 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-float-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.ai-float-icon {
    font-size: 28px;
    line-height: 1;
}

.ai-float-text {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ai-chat-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(175, 139, 40, 0.5);
}

.ai-chat-float:hover .ai-float-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-10px);
}

.ai-float-tooltip {
    position: absolute;
    right: 85px;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    color: #192f59;
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.ai-float-tooltip::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid white;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

/* AI Chat Window */
.ai-chat-window {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 999;
    overflow: hidden;
}

.ai-chat-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chat-header {
    background: linear-gradient(135deg, #192f59 0%, #af8b28 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-avatar {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-status {
    margin: 0;
    font-size: 12px;
    opacity: 0.9;
}

.ai-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.ai-message {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.ai-bot .ai-message-avatar {
    background: linear-gradient(135deg, #af8b28 0%, #192f59 100%);
    color: white;
}

.ai-user .ai-message-avatar {
    background: #28a745;
    color: white;
}

.ai-message-content {
    background: white;
    padding: 10px 13px;
    border-radius: 15px;
    max-width: 75%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    font-size: 13px;
}

.ai-message-content p {
    margin: 0 0 6px 0;
    line-height: 1.4;
    font-size: 13px;
}

.ai-message-content p:last-child {
    margin-bottom: 0;
}

.ai-message-content ul {
    font-size: 12px;
}

.ai-message-content li {
    margin-bottom: 4px;
}

.ai-user {
    flex-direction: row-reverse;
}

.ai-user .ai-message-content {
    background: #28a745;
    color: white;
}

.ai-typing {
    display: flex;
    gap: 5px;
    padding: 10px;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: #af8b28;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.ai-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {

    0%,
    60%,
    100% {
        transform: translateY(0);
    }

    30% {
        transform: translateY(-10px);
    }
}

.ai-chat-input {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.ai-chat-input input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 13px;
}

.ai-chat-input input:focus {
    border-color: #af8b28;
}

#aiSendBtn {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, #af8b28 0%, #192f59 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
}

#aiSendBtn:hover {
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .ai-chat-float {
        width: 60px;
        height: 60px;
        bottom: 20px;
        right: 20px;
    }

    .ai-float-icon {
        font-size: 24px;
    }

    .ai-float-text {
        font-size: 10px;
    }

    .ai-float-tooltip {
        right: 75px;
        font-size: 11px;
        padding: 10px 14px;
        max-width: 200px;
        white-space: normal;
    }

    .ai-chat-window {
        width: calc(100vw - 40px);
        height: calc(100vh - 150px);
        right: 20px;
        bottom: 95px;
    }
}