/* SmartChat Pro Frontend Styles */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #f8fafc;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.smartchat-pro-dark {
    --secondary-color: #1e293b;
    --text-dark: #f1f5f9;
    --text-light: #94a3b8;
    --border-color: #334155;
}

/* Chatbot Container */
#smartchat-pro-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Floating Button */
#smartchat-pro-toggle {
    width: 60px;
    height: 60px;
    background: var(--gradient);
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#smartchat-pro-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.4);
}

#smartchat-pro-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

#smartchat-pro-toggle:hover::before {
    opacity: 1;
}

/* Chat Window */
#smartchat-pro-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 600px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
    animation: slideUp 0.3s ease;
}

.smartchat-pro-dark #smartchat-pro-window {
    background: var(--secondary-color);
    color: var(--text-dark);
}

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

/* Chat Header */
.smartchat-pro-header {
    background: var(--gradient);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.smartchat-pro-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 16px;
}

.smartchat-pro-actions {
    display: flex;
    gap: 8px;
}

.smartchat-pro-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    font-size: 14px;
}

.smartchat-pro-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Chat Body */
.smartchat-pro-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--secondary-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.smartchat-pro-message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
    position: relative;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.smartchat-pro-user {
    align-self: flex-end;
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 6px;
}

.smartchat-pro-bot {
    align-self: flex-start;
    background: white;
    color: var(--text-dark);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 6px;
}

.smartchat-pro-dark .smartchat-pro-bot {
    background: #334155;
    border-color: #475569;
}

/* Typing Indicator */
.smartchat-pro-typing {
    align-self: flex-start;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 18px;
    border-bottom-left-radius: 6px;
    padding: 12px 16px;
    display: none;
}

.smartchat-pro-dark .smartchat-pro-typing {
    background: #334155;
    border-color: #475569;
}

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

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

.smartchat-pro-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.smartchat-pro-typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Chat Footer */
.smartchat-pro-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    background: white;
}

.smartchat-pro-dark .smartchat-pro-footer {
    background: var(--secondary-color);
    border-color: #334155;
}

.smartchat-pro-input-group {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.smartchat-pro-input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 12px 16px;
    outline: none;
    resize: none;
    max-height: 120px;
    font-family: inherit;
    font-size: 14px;
    background: var(--secondary-color);
    color: var(--text-dark);
    transition: border-color 0.2s ease;
}

.smartchat-pro-input:focus {
    border-color: var(--primary-color);
}

.smartchat-pro-send-btn {
    background: var(--primary-color);
    border: none;
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.smartchat-pro-send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.smartchat-pro-send-btn:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    transform: none;
}

.smartchat-pro-voice-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-light);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
}

.smartchat-pro-voice-btn:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.smartchat-pro-voice-btn.listening {
    background: var(--danger-color);
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Powered By Footer */
.smartchat-pro-powered {
    text-align: center;
    padding: 12px;
    font-size: 12px;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    background: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 480px) {
    #smartchat-pro-widget {
        bottom: 10px;
        right: 10px;
    }
    
    #smartchat-pro-window {
        width: calc(100vw - 20px);
        height: 70vh;
        right: 0;
    }
    
    .smartchat-pro-message {
        max-width: 90%;
    }
}

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

.smartchat-pro-body::-webkit-scrollbar-track {
    background: transparent;
}

.smartchat-pro-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.smartchat-pro-body::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}