/* Chat Widget Styles */
:root {
    --amp-primary: #00c853;
    --amp-primary-dark: #00a843;
    --amp-text-dark: #2c3e50;
    --amp-text-light: #5a6c7d;
    --amp-bg-light: #ffffff;
    --amp-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    --amp-shadow-lg: 0 12px 48px rgba(0, 0, 0, 0.18);
    --amp-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Chat Button */
.amp-chat-button {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--amp-bg-light);
    box-shadow: var(--amp-shadow);
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid var(--amp-bg-light);
    overflow: hidden;
}

.amp-chat-button:hover {
    transform: scale(1.08);
    box-shadow: var(--amp-shadow-lg);
}

.amp-chat-button.active {
    transform: scale(0.95);
}

.amp-chat-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.amp-chat-status {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: var(--amp-primary);
    border: 3px solid var(--amp-bg-light);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Chat Popup */
.amp-chat-popup {
    position: fixed;
    bottom: 100px;
    right: 24px;
    width: 380px;
    max-width: calc(100vw - 48px);
    background: var(--amp-bg-light);
    border-radius: 16px;
    box-shadow: var(--amp-shadow-lg);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.amp-chat-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Chat Header */
.amp-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    color: white;
    position: relative;
}

.amp-chat-header-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.amp-chat-header-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
}

.amp-chat-header-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: white;
}

.amp-chat-header-info p {
    margin: 4px 0 0 0;
    font-size: 13px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 6px;
}

.amp-status-dot {
    width: 8px;
    height: 8px;
    background: var(--amp-primary);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s infinite;
}

.amp-chat-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.amp-chat-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Chat Body */
.amp-chat-body {
    padding: 24px;
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Chat Messages Container */
.amp-chat-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Message Bubbles */
.amp-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.amp-message.user {
    align-items: flex-end;
}

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

.amp-message.bot .amp-message-bubble {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    color: var(--amp-text-dark);
    border-bottom-left-radius: 4px;
}

.amp-message.user .amp-message-bubble {
    background: var(--amp-gradient);
    color: white;
    border-bottom-right-radius: 4px;
}

.amp-message-time {
    font-size: 11px;
    color: var(--amp-text-light);
    padding: 0 8px;
}

/* Typing Indicator */
.amp-typing-indicator {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    max-width: 80px;
    animation: messageSlideIn 0.3s ease-out;
}

.amp-typing-indicator.active {
    display: flex;
}

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

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

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

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: 0.7;
    }

    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

/* Welcome Message */
.amp-welcome-message {
    background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    position: relative;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.amp-welcome-message::before {
    content: '';
    position: absolute;
    left: 20px;
    top: -8px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #f5f7fa;
}

.amp-welcome-message p {
    margin: 0;
    color: var(--amp-text-dark);
    font-size: 15px;
    line-height: 1.6;
}

/* Chat Options */
.amp-chat-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.amp-chat-option {
    background: white;
    border: 2px solid #e8ecf1;
    padding: 16px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 15px;
    font-weight: 500;
    color: var(--amp-text-dark);
    text-align: left;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.4s ease-out backwards;
}

.amp-chat-option:nth-child(1) {
    animation-delay: 0.1s;
}

.amp-chat-option:nth-child(2) {
    animation-delay: 0.2s;
}

.amp-chat-option:nth-child(3) {
    animation-delay: 0.3s;
}

.amp-chat-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.amp-chat-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.amp-chat-option:hover::before {
    opacity: 1;
}

.amp-chat-option:hover .amp-option-text {
    color: white;
}

.amp-chat-option:active {
    transform: translateY(0);
}

.amp-option-text {
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.amp-option-icon {
    font-size: 18px;
}

/* Chat Input Area */
.amp-chat-input-area {
    padding: 16px 24px;
    background: white;
    border-top: 1px solid #e8ecf1;
    display: none;
}

.amp-chat-input-area.active {
    display: block;
}

.amp-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.amp-chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e8ecf1;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
}

.amp-chat-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amp-chat-input::placeholder {
    color: var(--amp-text-light);
}

.amp-send-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--amp-gradient);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.amp-send-button:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.amp-send-button:active {
    transform: scale(0.95);
}

.amp-send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* Chat Footer */
.amp-chat-footer {
    padding: 12px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e8ecf1;
    text-align: center;
}

.amp-chat-footer p {
    margin: 0;
    font-size: 11px;
    color: var(--amp-text-light);
}

.amp-chat-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.amp-chat-footer a:hover {
    text-decoration: underline;
}

/* Link Button in Messages */
.amp-message-link {
    display: inline-block;
    margin-top: 8px;
    padding: 10px 20px;
    background: var(--amp-gradient);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.amp-message-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    color: white;
    text-decoration: none;
}

/* Reset Chat Button */
.amp-reset-chat {
    cursor: pointer;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    width: 100%;
    transition: all 0.3s ease;
    font-family: inherit;
}

.amp-reset-chat:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #7c8ef5 0%, #8b5bb5 100%);
}

.amp-reset-chat:active {
    transform: translateY(0);
}


/* Responsive */
@media (max-width: 480px) {
    .amp-chat-popup {
        bottom: 90px;
        right: 12px;
        width: calc(100vw - 24px);
    }

    .amp-chat-button {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

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

.amp-chat-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.amp-chat-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.amp-chat-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}