* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.chat-container {
    width: 100%;
    max-width: 450px;
    height: 700px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Chat Header */
.chat-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.avatar {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.header-text h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.status {
    font-size: 14px;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status .fa-circle {
    font-size: 8px;
    color: #4ade80;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.settings-btn, .clear-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.settings-btn:hover, .clear-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Settings Panel */
.settings-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.settings-panel.active {
    transform: translateY(0);
}

.settings-content {
    padding: 20px;
}

.settings-content h4 {
    margin-bottom: 20px;
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.setting-group {
    margin-bottom: 15px;
}

.setting-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

.setting-group input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

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

.setting-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.save-btn, .cancel-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.save-btn {
    background: #48bb78;
    color: white;
}

.save-btn:hover {
    background: #38a169;
}

.cancel-btn {
    background: #e2e8f0;
    color: #4a5568;
}

.cancel-btn:hover {
    background: #cbd5e0;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f8fafc;
    scroll-behavior: smooth;
}

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

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

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

.message {
    display: flex;
    margin-bottom: 20px;
    animation: fadeInUp 0.3s ease;
}

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

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

.bot-message .message-avatar {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, #48bb78, #38a169);
    color: white;
}

.message-content {
    max-width: 70%;
    display: flex;
    flex-direction: column;
}

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

.message-bubble {
    padding: 15px 18px;
    border-radius: 20px;
    position: relative;
    word-wrap: break-word;
    line-height: 1.4;
}

.bot-message .message-bubble {
    background: white;
    color: #2d3748;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-bottom-left-radius: 8px;
}

.user-message .message-bubble {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-bottom-right-radius: 8px;
}

.message-time {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 5px;
    padding: 0 5px;
}

.user-message .message-time {
    text-align: right;
}

/* Quick Actions */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.quick-btn {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    color: #667eea;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.quick-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-1px);
}

/* Typing Indicator */
.typing-indicator {
    display: none;
    padding: 0 20px 20px;
    background: #f8fafc;
}

.typing-indicator.active {
    display: block;
    animation: fadeInUp 0.3s ease;
}

.typing {
    background: white !important;
    padding: 15px 20px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

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

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

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

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

/* Chat Input */
.chat-input-container {
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 15px 20px;
}

.chat-input {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    background: #f7fafc;
    border-radius: 25px;
    padding: 8px;
    border: 2px solid #e2e8f0;
    transition: border-color 0.3s ease;
}

.chat-input:focus-within {
    border-color: #667eea;
}

.attachment-btn, .emoji-btn {
    background: none;
    border: none;
    color: #718096;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.attachment-btn:hover, .emoji-btn:hover {
    background: #e2e8f0;
    color: #4a5568;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

#messageInput {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    padding: 12px 0;
    font-size: 16px;
    line-height: 1.4;
    max-height: 120px;
    overflow-y: auto;
    font-family: inherit;
}

#messageInput:focus {
    outline: none;
}

#messageInput::-webkit-scrollbar {
    width: 4px;
}

#messageInput::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

.send-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

/* File Preview */
.file-preview {
    margin-bottom: 15px;
    background: #f7fafc;
    border-radius: 15px;
    padding: 15px;
    border: 2px dashed #cbd5e0;
}

.preview-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

#previewImage {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 10px;
}

.preview-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#fileName {
    font-size: 14px;
    color: #4a5568;
    font-weight: 500;
}

.remove-file {
    background: #fed7d7;
    border: none;
    color: #e53e3e;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-file:hover {
    background: #feb2b2;
}

/* Emoji Picker */
.emoji-picker {
    position: absolute;
    bottom: 100%;
    right: 20px;
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid #e2e8f0;
    margin-bottom: 10px;
}

.emoji-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.emoji-grid span {
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
}

.emoji-grid span:hover {
    background: #f7fafc;
    transform: scale(1.2);
}

/* Connection Status - Hidden */
.connection-status {
    display: none !important;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #2d3748;
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-modal {
    background: none;
    border: none;
    color: #718096;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: #f7fafc;
    color: #4a5568;
}

.modal-body {
    padding: 25px;
}

.pricing-table {
    display: grid;
    gap: 20px;
}

.pricing-section h4 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 18px;
}

.price-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f7fafc;
    border-radius: 10px;
    margin-bottom: 8px;
}

.price-item strong {
    color: #667eea;
    font-size: 18px;
}

.pricing-note {
    margin-top: 20px;
    padding: 15px;
    background: #e6fffa;
    border-radius: 10px;
    border-left: 4px solid #38b2ac;
}

.pricing-note p {
    margin-bottom: 8px;
    color: #2d3748;
    font-size: 14px;
}

.pricing-note p:last-child {
    margin-bottom: 0;
}

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

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Image in Messages */
.message-image {
    max-width: 200px;
    border-radius: 15px;
    margin-top: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.message-image:hover {
    transform: scale(1.02);
}

/* Responsive Design */
@media (max-width: 480px) {
    body {
        padding: 0;
    }
    
    .chat-container {
        height: 100vh;
        border-radius: 0;
        max-width: none;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .avatar {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .header-text h3 {
        font-size: 16px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-btn {
        text-align: center;
    }
}
