/* New Empty State Structure */

.ai-chat-container {
    font-family: 'font text', sans-serif;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    width: 100%;
    margin: 0 auto;
    border: 1px solid #e2e8f0;
    animation: slideUp 0.5s 
ease-out;
}

.ai-chat-shortcode {
    width: 100%;
    height: 600px;
    display: flex;
    flex-direction: column;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 40px 20px;
    text-align: center;
    color: #6b7280;
    max-width: 768px;
    margin: 0 auto;
}

#emptyStateTitle {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 40px;
    line-height: 1.3;
    max-width: 400px;
}

.chat-input-wrapper {
    width: 100%;
    max-width: 640px;
}

.chat-input-container {
    position: relative;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-end;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 24px;
    padding: 12px 16px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.input-wrapper:focus-within {
    border-color: #10a37f;
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.1);
}

.chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px;
    font-size: 16px;
    font-family: 'font text', sans-serif;
    resize: none;
    outline: none;
    color: #333;
    min-height: 24px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    line-height: 1.5;
}

.chat-input::placeholder {
    color: #718096;
}

.send-button {
    background: #10a37f;
    border: none;
    border-radius: 34%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.send-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(16, 163, 127, 0.4);
}

.send-button:active:not(:disabled) {
    transform: translateY(0);
}

.send-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-button svg {
    width: 20px;
    height: 20px;
}

.ai-chat-input-center {
    border: none;
    background: transparent;
    padding: 0;
}

.ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

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

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

.ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* Container Layout Fix */
.ai-chat-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.chat-header {
    flex-shrink: 0;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
}

.chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 33%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 26px;
}

.chat-info h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    line-height: 1.2;
}

.chat-info span {
    font-size: 12px;
    color: #059669;
    font-weight: 500;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
    align-items: flex-end;
}

.user-message {
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-left: auto;
}

.ai-message {
    flex-direction: row;
    justify-content: flex-start;
    margin-right: auto;
}

.message-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 34%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.user-message .message-avatar {
    background: #10A77F;
    color: white;
display: none;
}

.ai-message .message-avatar {
    background: #fff;
    color: white;
}

.message-content {
    background: #f3f4f6;
    padding: 12px 16px;
    border-radius: 18px;
    word-wrap: break-word;
    position: relative;
}

/* Updated message styles */

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

/* Additional CSS Updates */
.ai-message {
    flex-direction: row;
    justify-content: flex-start;
    margin-right: 0px;
}

.ai-message .message-content {
    background: #f3f4f600;
    color: #374151;
    border-bottom-right-radius: 5px;
}

.user-message .message-content {
    background: #f5f5f5;
    color: #374151;
    border-bottom-right-radius: 4px;
}

.user-message .message-time {
    color: #374151;
    text-align: left;
}

.message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    display: block;
    text-align: right;
}


/* Typing Indicator */
.typing-indicator .message-content {
    background: transparent;
    padding: 12px 16px;
}

.typing-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #059669;
    animation: typingBounce 1.4s infinite ease-in-out;
}

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

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

/* Welcome Message */
.welcome-message {
    padding: 40px 20px;
    text-align: center;
}

.welcome-content h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px 0;
}

.welcome-content p {
    font-size: 16px;
    color: #6b7280;
    margin: 0 0 4px 0;
}

.welcome-subtitle {
    font-size: 14px;
    color: #9ca3af;
    margin: 0;
}

/* Input Section */
.chat-input-section {
    flex-shrink: 0;
    background: #ffffff;
    padding: 23px 40px;
    background-color: rgba(255, 255, 255, 0.7);
    border-color: rgba(255, 255, 255, 1);
    border-top-width: 2px;
    border-top-style: solid;
    box-shadow: 0 -0.125rem 10.125rem 0 rgb(159 159 159 / 20%);
}

.input-container {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 16px;
    padding: 4px 8px 4px 8px;
    transition: all 0.2s 
ease;
}

.input-container:focus-within {
    border-color: #10A77F;
    box-shadow: 0 0 0 3px #10a77f0a;
}

.input-container textarea {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    outline: none;
    color: #374151;
    min-height: 20px;
    max-height: 120px;
    line-height: 1.4;
}

.input-container textarea::placeholder {
    color: #9ca3af;
}


.send-button:not(:disabled) {
    opacity: 1;
    background: #10A77F;
}

.send-button:not(:disabled):hover {
    background: #10A77F;
    transform: scale(1.05);
}

.send-button:disabled {
    background: #d1d5db;
    cursor: not-allowed;
}

.send-button svg {
    width: 18px;
    height: 18px;
}

.input-footer {
    margin-top: 8px;
    text-align: center;
}

.input-footer small {
    font-size: 12px;
    color: #9ca3af;
}

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

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 480px) {
    .message {
        max-width: 90%;
    }

    .message-content {
        max-width: 280px;
    }

    .chat-header {
        padding: 12px 16px;
    }

    .chat-title {
        gap: 10px;
    }

    .chat-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .chat-info h3 {
        font-size: 15px;
    }

    .chat-messages {
        padding: 16px;
        gap: 12px;
    }

    .chat-input-section {
        padding: 12px 16px;
    }
}

/* Initial welcome screen */
.ai-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
}

.ai-chat-welcome-icon {
    width: 72px;
    height: 72px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.2);
}

.ai-chat-welcome-icon i {
    font-size: 32px;
    color: white;
}

.ai-chat-welcome-title {
    font-size: 32px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
    line-height: 1.2;
}

.ai-chat-welcome-subtitle {
    font-size: 16px;
    color: #6b7280;
    margin-bottom: 32px;
    max-width: 400px;
    line-height: 1.5;
}

.ai-chat-suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 600px;
}

.ai-chat-suggestion {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    font-size: 14px;
    color: #374151;
    line-height: 1.4;
}

.ai-chat-suggestion:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
}

/* Messages Container */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-out;
    width: 100%;
}

.user-message {
    flex-direction: row-reverse;
    justify-content: flex-end;
    margin-left: auto;
    margin-right: 23px;
}


.ai-chat-message-avatar {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.ai-chat-message-user .ai-chat-message-avatar {
    background: #7c3aed;
    color: white;
}

.ai-chat-message-bot .ai-chat-message-avatar {
    background: #10b981;
    color: white;
}

.ai-chat-message-content {
    flex: 1;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
    max-width: 480px;
}

.ai-chat-message-user .ai-chat-message-content {
    background: #f3f4f6;
    color: #1f2937;
    border-bottom-right-radius: 6px;
    border: 1px solid #e5e7eb;
}

.ai-chat-message-bot .ai-chat-message-content {
    background: #ffffff;
    color: #374151;
    border-bottom-left-radius: 6px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Typing Indicator */
.ai-chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 32px;
}

.ai-chat-typing-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.ai-chat-typing-content {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 16px;
    border-bottom-left-radius: 4px;
}

.ai-chat-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chat-typing-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #6b7280;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.ai-chat-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-typing-dots span:nth-child(2) { animation-delay: -0.16s; }

/* Input Area - Modern ChatGPT Style */
.ai-chat-input-container {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #ffffff;
    padding: 20px 24px;
    position: relative;
}

.ai-chat-input-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    max-width: 768px;
    margin: 0 auto;
    background: #f9fafb;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 26px;
    padding: 8px 16px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.ai-chat-input-wrapper:focus-within {
    box-shadow: 0 0 0 2px #7c3aed, 0 1px 3px rgba(0, 0, 0, 0.1);
    border-color: #7c3aed;
}

.ai-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px 8px;
    font-size: 16px;
    resize: none;
    outline: none;
    color: #111827;
    min-height: 24px;
    max-height: 200px;
    overflow-y: auto;
    width: 100%;
    font-family: inherit;
    line-height: 1.5;
}

.ai-chat-input::placeholder {
    color: #6b7280;
    font-weight: 400;
}

.ai-chat-send-button {
    background: #7c3aed;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-left: 8px;
}

.ai-chat-send-button:hover:not(:disabled) {
    background: #6d28d9;
    transform: scale(1.05);
}

.ai-chat-send-button:active:not(:disabled) {
    transform: scale(0.95);
}

.ai-chat-send-button:disabled {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.3);
    cursor: not-allowed;
    transform: none;
}

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

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

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 480px) {
    .ai-chat-widget {
        bottom: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .ai-chat-container {
        border-radius: 8px;
    }

    .ai-chat-header {
        padding: 15px;
    }

    .ai-chat-messages {
        padding: 15px;
        height: 300px;
    }

    .ai-chat-input-container {
        padding: 15px;
    }

    .ai-chat-message-content {
        max-width: 85%;
        font-size: 13px;
    }
}

/* Loading States */
.ai-chat-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error States */
.ai-chat-error {
    border-color: #dc3545;
}

.ai-chat-error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
    border: 1px solid #f5c6cb;
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .ai-chat-container {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .ai-chat-header {
        background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
        border-color: #4a5568;
    }

    .ai-chat-title {
        color: #e2e8f0;
    }

    .ai-chat-subtitle {
        color: #a0aec0;
    }

    .ai-chat-messages {
        background: #2d3748;
    }

    .ai-chat-message-bot .ai-chat-message-content {
        background: #4a5568;
        color: #e2e8f0;
        border-color: #718096;
    }

    .ai-chat-input-container {
        background: #2d3748;
        border-color: #4a5568;
    }

    .ai-chat-input {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }

    .ai-chat-input::placeholder {
        color: #a0aec0;
    }
}
