/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    --bg-color: #f3f4f6;
    --chat-bg: #ffffff;
    --bot-msg-bg: #f3f4f6;
    --user-msg-bg: #4f46e5;
    --user-msg-text: #ffffff;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --font-family: 'Outfit', sans-serif;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
        radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
        radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
    background-size: cover;
    background-attachment: fixed;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-primary);
}

/* Chat Container */
#chat-widget {
    width: 100%;
    max-width: 480px;
    height: 90vh;
    max-height: 800px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-xl);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Header */
header {
    padding: 1.25rem 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10;
}

.avatar-container {
    position: relative;
}

.avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid white;
    box-shadow: var(--shadow-sm);
}

.status-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background-color: #10b981;
    border: 2px solid white;
    border-radius: 50%;
}

.header-info h1 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.header-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Chat Log */
#chat-log {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-behavior: smooth;
}

/* Messages */
.message-wrapper {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.message-wrapper.bot {
    align-self: flex-start;
}

.message-wrapper.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.msg-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}

.message-bubble {
    padding: 0.875rem 1.25rem;
    border-radius: 1.25rem;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.bot .message-bubble {
    background-color: var(--bot-msg-bg);
    color: var(--text-primary);
    border-top-left-radius: 4px;
}

.user .message-bubble {
    background: var(--primary-gradient);
    color: var(--user-msg-text);
    border-top-right-radius: 4px;
}

/* Typing Indicator */
.typing {
    display: flex;
    gap: 4px;
    padding: 1rem 1.25rem;
    border-radius: 1.25rem;
    background-color: var(--bot-msg-bg);
    border-top-left-radius: 4px;
    width: fit-content;
}

.typing span {
    width: 6px;
    height: 6px;
    background: #9ca3af;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

.typing span:nth-child(1) { animation-delay: -0.32s; }
.typing span:nth-child(2) { animation-delay: -0.16s; }

/* Input Area */
#input-area {
    padding: 1.25rem;
    background: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

#user-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 3rem;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s;
    background: #f9fafb;
}

#user-input:focus {
    border-color: var(--primary-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

#send-btn {
    background: var(--primary-gradient);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: var(--shadow-md);
}

#send-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

#send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Product Cards */
.product-card {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    margin-top: 0.5rem;
    border: 1px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    gap: 1rem;
    align-items: center;
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.product-thumb {
    width: 64px;
    height: 64px;
    border-radius: 0.5rem;
    object-fit: cover;
    background: #f3f4f6;
}

.product-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.product-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Options */
.options-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.option-btn {
    background: white;
    color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    padding: 0.6rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.option-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Animations */
@keyframes slideUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes typing {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Responsive */
@media (max-width: 480px) {
    #chat-widget {
        height: 100vh;
        max-height: none;
        border-radius: 0;
        width: 100vw;
    }
}
