/**
 * AMDG AI Assistant - Public Styles
 */

/* Chat Container */
#amdg-chat-container {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Position Classes */
#amdg-chat-container.amdg-chat-bottom-right {
    bottom: 20px;
    right: 20px;
}

#amdg-chat-container.amdg-chat-bottom-left {
    bottom: 20px;
    left: 20px;
}

#amdg-chat-container.amdg-chat-top-right {
    top: 20px;
    right: 20px;
}

#amdg-chat-container.amdg-chat-top-left {
    top: 20px;
    left: 20px;
}

/* Chat Bubble */
.amdg-chat-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: #0073aa;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
}

.amdg-chat-bubble:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.amdg-bubble-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

/* Chat Window */
.amdg-chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 600px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.amdg-chat-top-right .amdg-chat-window,
.amdg-chat-top-left .amdg-chat-window {
    bottom: auto;
    top: 80px;
}

.amdg-chat-bottom-left .amdg-chat-window,
.amdg-chat-top-left .amdg-chat-window {
    right: auto;
    left: 0;
}

/* Chat Header */
.amdg-chat-header {
    background-color: #0073aa;
    color: #fff;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.amdg-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.amdg-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4caf50;
    margin-right: 6px;
}

.amdg-status-text {
    font-size: 12px;
    opacity: 0.9;
}

.amdg-close-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.amdg-close-btn:hover {
    opacity: 0.8;
}

/* Chat Messages */
.amdg-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f5f5f5;
}

.amdg-message {
    margin-bottom: 16px;
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

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

.amdg-message-content {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    word-wrap: break-word;
    line-height: 1.5;
    font-size: 14px;
}

.amdg-message-assistant .amdg-message-content {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.amdg-message-user {
    justify-content: flex-end;
}

.amdg-message-user .amdg-message-content {
    background: #0073aa;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.amdg-message-content a {
    color: inherit;
    text-decoration: underline;
}

.amdg-message-content strong {
    font-weight: 600;
}

/* Typing Indicator */
.amdg-typing-indicator {
    padding: 12px 16px;
    display: flex;
    gap: 4px;
}

.amdg-typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999;
    animation: typing 1.4s infinite;
}

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

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

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

/* Chat Input */
.amdg-chat-input-container {
    background: #fff;
    border-top: 1px solid #e0e0e0;
}

.amdg-chat-form {
    display: flex;
    padding: 12px;
    gap: 8px;
}

.amdg-message-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}

.amdg-message-input:focus {
    border-color: #0073aa;
}

.amdg-send-btn {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.amdg-send-btn:hover {
    background: #005a87;
}

/* Smart-Sell Modal */
.amdg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000000;
    animation: fadeIn 0.3s ease-out;
}

.amdg-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

.amdg-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.amdg-modal-close:hover {
    color: #333;
}

#amdg-lead-form input,
#amdg-lead-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
}

#amdg-lead-form input:focus,
#amdg-lead-form textarea:focus {
    outline: none;
    border-color: #0073aa;
}

/* Buttons */
.amdg-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.amdg-btn-primary {
    background: #0073aa;
    color: #fff;
}

.amdg-btn-primary:hover {
    background: #005a87;
}

.amdg-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.amdg-btn-secondary:hover {
    background: #e0e0e0;
}

.amdg-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* GDPR Consent Banner */
.amdg-consent-banner {
    position: fixed;
    bottom: 100px;
    right: 20px;
    background: #fff;
    border-radius: 8px;
    padding: 16px;
    max-width: 320px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999998;
}

.amdg-consent-content p {
    margin: 0 0 12px 0;
    font-size: 13px;
    line-height: 1.5;
}

.amdg-consent-actions {
    display: flex;
    gap: 8px;
}

.amdg-consent-actions .amdg-btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .amdg-chat-window {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }

    .amdg-chat-top-right .amdg-chat-window,
    .amdg-chat-top-left .amdg-chat-window {
        top: 0;
    }

    .amdg-consent-banner {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Scrollbar Styling */
.amdg-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.amdg-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.amdg-chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.amdg-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}
