/* Demo Chat Widget Styles */

/* Demo Chat Modal */
.demo-chat-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.demo-chat-modal.active {
    display: flex;
}

.demo-chat-content {
    width: 90%;
    max-width: 800px;
    height: 90vh;
    max-height: 700px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
}

.demo-chat-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: white;
    cursor: pointer;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.demo-chat-close:hover {
    background: rgba(0, 0, 0, 0.4);
}

.demo-chat-header-modal {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px 20px 0 0;
}

.demo-chat-header-modal h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.demo-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    background: #f9fafb;
}

.demo-chat-input-container {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
    border-radius: 0 0 20px 20px;
}

.demo-chat-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    min-height: 50px;
    line-height: 1.4;
    resize: none;
    font-family: inherit;
}

.demo-chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.demo-chat-send-btn {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.demo-chat-send-btn:hover {
    background: #5568d3;
}

.demo-chat-section {
    padding: 6rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.demo-chat-container {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.demo-chat-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: #1f2937;
    line-height: 1.2;
}

.demo-chat-header p {
    font-size: 1.2rem;
    color: #6b7280;
    margin-bottom: 3rem;
}

.demo-chat-button {
    padding: 1.25rem 3rem;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.demo-chat-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

/* Demo Chat Widget */
.demo-chat-widget {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    height: 90vh;
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    overflow: hidden;
    flex-direction: column;
}

.demo-chat-widget.active {
    display: flex;
}

.demo-chat-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
}

.demo-chat-overlay.active {
    display: block;
}

/* Header */
.demo-widget-header {
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.demo-widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.demo-widget-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s;
}

.demo-widget-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* CAPTCHA */
.demo-captcha {
    padding: 2rem;
    text-align: center;
}

.demo-captcha h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.demo-captcha p {
    color: #6b7280;
    margin-bottom: 2rem;
}

.captcha-question {
    font-size: 2rem;
    font-weight: 600;
    color: #667eea;
    margin: 2rem 0;
}

.captcha-input {
    width: 120px;
    padding: 0.75rem;
    font-size: 1.5rem;
    text-align: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin: 0 auto 1.5rem;
    display: block;
}

.captcha-input:focus {
    outline: none;
    border-color: #667eea;
}

.captcha-error {
    color: #dc2626;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.captcha-attempts {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.captcha-button {
    padding: 0.75rem 2rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.captcha-button:hover {
    background: #5568d3;
}

.captcha-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* Messages */
.demo-messages {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2rem;
    background: #f9fafb;
    max-height: 100%;
}

.demo-message {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeInUp 0.3s ease;
}

.demo-message.user {
    flex-direction: row-reverse;
}

.demo-message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.demo-message.user .demo-message-avatar {
    background: #667eea;
    color: white;
}

.demo-message.assistant .demo-message-avatar {
    background: #f3f4f6;
    color: #6b7280;
}

.demo-message-content {
    max-width: 70%;
}

.demo-message.user .demo-message-content {
    text-align: right;
}

.demo-message-bubble {
    padding: 1rem 1.25rem;
    border-radius: 16px;
    line-height: 1.6;
    word-wrap: break-word;
}

.demo-message.user .demo-message-bubble {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.demo-message.assistant .demo-message-bubble {
    background: white;
    color: #1f2937;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: fit-content;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite;
}

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

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

@keyframes typingAnimation {
    0%, 60%, 100% {
        opacity: 0.3;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-4px);
    }
}

/* CTA Panel */
.demo-cta {
    padding: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
}

.demo-cta h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.demo-cta p {
    color: #ffffff;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.demo-cta-button {
    padding: 1rem 2.5rem;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
}

.demo-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

/* Rate Limit Message */
.demo-rate-limit {
    padding: 2rem;
    text-align: center;
}

.demo-rate-limit h3 {
    font-size: 1.5rem;
    color: #dc2626;
    margin-bottom: 1rem;
}

.demo-rate-limit p {
    color: #6b7280;
    line-height: 1.6;
}

/* Disclaimer */
.demo-disclaimer {
    padding: 0.75rem 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    text-align: center;
    font-size: 0.85rem;
    color: #9ca3af;
}

/* Input Area */
.demo-input-area {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.demo-input {
    flex: 1;
    padding: 1rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    font-family: inherit;
    transition: border-color 0.3s;
    background: #f9fafb;
    min-height: 70px;
    resize: none;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.demo-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
}

.demo-send-btn {
    padding: 0.75rem 1.5rem;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.demo-send-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.demo-send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .demo-chat-section {
        padding: 4rem 1.5rem;
    }

    .demo-chat-header h2 {
        font-size: 2rem;
    }

    .demo-chat-header p {
        font-size: 1rem;
    }

    .demo-chat-button {
        padding: 1rem 2rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
    }

    .demo-chat-widget {
        width: 95%;
        height: 90vh;
        max-height: 90vh;
        border-radius: 16px;
    }

    .demo-widget-header {
        padding: 1rem;
    }

    .demo-widget-title {
        font-size: 1.1rem;
    }

    .demo-messages {
        padding: 1rem;
    }

    .demo-message-content {
        max-width: 85%;
    }

    .demo-captcha {
        padding: 1.5rem;
    }

    .captcha-question {
        font-size: 1.5rem;
    }

    .demo-cta {
        padding: 1.5rem;
    }

    .demo-cta h3 {
        font-size: 1.2rem;
    }

    .demo-cta p {
        font-size: 1rem;
    }
}
