/* Chatbot Styles */
.chatbot-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'NotoSansHans-Regular', sans-serif;
    user-select: none;
}

.chatbot-toggle {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    padding: 0;
}

.chatbot-toggle:active {
    cursor: grabbing;
}

.chatbot-toggle img {
    pointer-events: none;
}

.chatbot-toggle:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 6px 20px rgba(253, 192, 42, 0.6));
}

.chatbot-toggle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    filter: drop-shadow(0 4px 15px rgba(0, 0, 0, 0.5));
    transition: all 0.3s ease;
}

.chatbot-toggle:hover img {
    filter: drop-shadow(0 6px 25px rgba(253, 192, 42, 0.8));
}

.chatbot-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #E80000;
    border: 2px solid #0A0A0A;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.chatbot-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 380px;
    height: 600px;
    max-height: calc(100vh - 120px);
    background: #0A0A0A;
    border: 2px solid var(--primary);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.chatbot-window.active {
    display: flex;
}

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

.chatbot-header {
    background: linear-gradient(135deg, rgba(253, 192, 42, 0.2) 0%, rgba(253, 192, 42, 0.05) 100%);
    padding: 20px;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 15px;
}

.chatbot-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    overflow: hidden;
    flex-shrink: 0;
}

.chatbot-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chatbot-header-info {
    flex: 1;
}

.chatbot-header-info h3 {
    margin: 0;
    font-size: 18px;
    color: var(--primary);
    font-family: 'AlimamaShuHeiTi-Bold', sans-serif;
    text-transform: uppercase;
}

.chatbot-header-info p {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: var(--text-muted);
}

.chatbot-close {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chatbot-close:hover {
    background: var(--primary);
    color: #000;
    transform: rotate(90deg);
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #050505;
}

.chatbot-messages::-webkit-scrollbar {
    width: 8px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #0A0A0A;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #ffd54f;
}

.message {
    display: flex;
    gap: 10px;
    animation: fadeIn 0.3s ease;
}

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

.message.bot {
    align-items: flex-start;
}

.message.user {
    align-items: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    overflow: hidden;
    flex-shrink: 0;
}

.message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message.user .message-avatar {
    border-color: #008000;
    background: rgba(0, 128, 0, 0.1);
}

.message.user .message-avatar img {
    display: none;
}

.message.user .message-avatar::after {
    content: '👤';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 20px;
}

.message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 18px;
    position: relative;
}

.message.bot .message-content {
    background: rgba(253, 192, 42, 0.15);
    border: 1px solid rgba(253, 192, 42, 0.3);
    color: #fff;
    border-top-left-radius: 4px;
}

.message.user .message-content {
    background: rgba(0, 128, 0, 0.2);
    border: 1px solid rgba(0, 128, 0, 0.4);
    color: #fff;
    border-top-right-radius: 4px;
}

.message-content p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

.message-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 5px;
    opacity: 0.7;
}

.chatbot-input-area {
    padding: 20px;
    background: #0A0A0A;
    border-top: 2px solid var(--primary);
}

.chatbot-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(253, 192, 42, 0.3);
    padding: 12px 15px;
    border-radius: 25px;
    color: #fff;
    font-size: 14px;
    font-family: 'NotoSansHans-Regular', sans-serif;
    transition: all 0.3s;
}

.chatbot-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 10px rgba(253, 192, 42, 0.2);
}

.chatbot-send {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.chatbot-send:hover {
    background: #ffd54f;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(253, 192, 42, 0.4);
}

.chatbot-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.quick-action-btn {
    background: rgba(253, 192, 42, 0.1);
    border: 1px solid rgba(253, 192, 42, 0.3);
    color: var(--primary);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'NotoSansHans-Regular', sans-serif;
}

.quick-action-btn:hover {
    background: rgba(253, 192, 42, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.devis-form {
    background: rgba(253, 192, 42, 0.05);
    border: 1px solid rgba(253, 192, 42, 0.2);
    border-radius: 12px;
    padding: 15px;
    margin-top: 10px;
}

.devis-form-group {
    margin-bottom: 12px;
}

.devis-form-group label {
    display: block;
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 5px;
    font-weight: bold;
}

.devis-form-group input,
.devis-form-group textarea {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(253, 192, 42, 0.3);
    padding: 10px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-family: 'NotoSansHans-Regular', sans-serif;
    box-sizing: border-box;
}

.devis-form-group textarea {
    min-height: 60px;
    resize: vertical;
}

.devis-form-group input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
}

.devis-submit-btn {
    width: 100%;
    background: var(--primary);
    border: none;
    color: #000;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'AlimamaShuHeiTi-Bold', sans-serif;
    text-transform: uppercase;
    font-size: 12px;
    margin-top: 10px;
}

.devis-submit-btn:hover {
    background: #ffd54f;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(253, 192, 42, 0.4);
}

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 12px 16px;
    background: rgba(253, 192, 42, 0.15);
    border: 1px solid rgba(253, 192, 42, 0.3);
    border-radius: 18px;
    border-top-left-radius: 4px;
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Responsive */
@media screen and (max-width: 768px) {
    .chatbot-container {
        bottom: 15px;
        right: 15px;
        left: auto;
    }

    .chatbot-toggle {
        width: 60px;
        height: 60px;
    }

    .chatbot-window {
        width: calc(100vw - 30px);
        max-width: 400px;
        height: calc(100vh - 150px);
        max-height: calc(100vh - 150px);
        right: 15px;
        left: auto;
        bottom: 85px;
        top: auto;
        position: fixed !important;
    }
    
    .chatbot-window.active {
        display: flex !important;
    }
}

@media screen and (max-width: 480px) {
    .chatbot-container {
        bottom: 10px;
        right: 10px;
        left: auto;
    }

    .chatbot-toggle {
        width: 55px;
        height: 55px;
    }

    .chatbot-window {
        width: calc(100vw - 20px);
        max-width: 100%;
        height: calc(100vh - 120px);
        max-height: calc(100vh - 120px);
        right: 10px;
        left: 10px;
        bottom: 75px;
        top: auto;
        border-radius: 15px;
        position: fixed !important;
    }
    
    .chatbot-window.active {
        display: flex !important;
    }

    .chatbot-header {
        padding: 15px;
    }

    .chatbot-avatar {
        width: 40px;
        height: 40px;
    }

    .chatbot-messages {
        padding: 15px;
    }

    .chatbot-input-area {
        padding: 15px;
    }
    
    .message-content {
        max-width: 85%;
    }
}
