:root {
    --bg-app: #090d16;
    --bg-sidebar: #0f1524;
    --bg-chat: #0c101d;
    --bg-card: rgba(30, 41, 59, 0.4);
    --border-glass: rgba(255, 255, 255, 0.08);
    --color-primary: #8b5cf6;
    --color-primary-light: #a78bfa;
    --color-primary-dark: #7c3aed;
    --color-success: #10b981;
    --color-text: #f1f5f9;
    --color-text-muted: #94a3b8;
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

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

body, html {
    height: 100%;
    font-family: var(--font-sans);
    background-color: var(--bg-app);
    color: var(--color-text);
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styles */
.sidebar {
    width: 320px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    font-size: 2rem;
}

.brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.025em;
}

.sidebar-info {
    margin-top: -4rem;
}

.sidebar-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary-light);
    margin-bottom: 1rem;
}

.sidebar-info p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: 2rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-success);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

.reset-button {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.reset-button:hover {
    background-color: rgba(239, 68, 68, 0.2);
    transform: translateY(-1px);
}

/* Chat Area Styles */
.chat-area {
    flex: 1;
    background-color: var(--bg-chat);
    display: flex;
    flex-direction: column;
    position: relative;
}

.chat-header {
    height: 70px;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    backdrop-filter: blur(12px);
    z-index: 10;
}

.active-chat-info h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

.active-chat-info .subtitle {
    font-size: 0.8rem;
    color: var(--color-success);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.active-chat-info .subtitle::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--color-success);
    border-radius: 50%;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Scrollbar styling */
.chat-history::-webkit-scrollbar {
    width: 6px;
}

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

.chat-history::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

/* Message Bubbles */
.message {
    max-width: 75%;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.message.user {
    align-self: flex-end;
}

.message.bot {
    align-self: flex-start;
}

.bubble {
    padding: 1rem 1.25rem;
    border-radius: 18px;
    font-size: 0.98rem;
    line-height: 1.5;
    word-break: break-word;
}

.message.user .bubble {
    background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
    color: #ffffff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.message.bot .bubble {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-bottom-left-radius: 4px;
    box-shadow: var(--shadow-premium);
    backdrop-filter: blur(8px);
}

.bubble a {
    color: var(--color-primary-light);
    text-decoration: none;
    font-weight: 500;
}

.bubble a:hover {
    text-decoration: underline;
}

/* Button Options / Keyboards */
.inline-keyboard {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.inline-btn {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    color: var(--color-text);
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.inline-btn:hover:not(:disabled) {
    background-color: var(--color-primary);
    border-color: var(--color-primary-light);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.inline-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Product Recommendation Card styling */
.photo-card {
    margin-top: 0.75rem;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    overflow: hidden;
    max-width: 480px;
    box-shadow: var(--shadow-premium);
}

.photo-card-img {
    width: 100%;
    height: 240px;
    object-fit: contain;
    background-color: #fff;
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.photo-card-content {
    padding: 1.25rem;
}

.photo-card-text {
    font-size: 0.95rem;
    line-height: 1.5;
    white-space: pre-line;
}

/* Dynamic CSS for text formatting */
.chat-history p {
    margin-bottom: 0.5rem;
}
.chat-history p:last-child {
    margin-bottom: 0;
}
.chat-history ul, .chat-history ol {
    margin-left: 1.25rem;
    margin-bottom: 0.5rem;
}

/* Input Area Styles */
.chat-input-area {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-glass);
    backdrop-filter: blur(12px);
}

.chat-form {
    display: flex;
    background-color: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 0.4rem 0.5rem 0.4rem 1.2rem;
    align-items: center;
    box-shadow: var(--shadow-premium);
}

.chat-form input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 1rem;
    padding: 0.5rem 0;
}

.chat-form input::placeholder {
    color: var(--color-text-muted);
}

.send-button {
    background-color: var(--color-primary);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-button:hover {
    background-color: var(--color-primary-dark);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.4);
    transform: scale(1.02);
}

/* Typing Indicator Styles */
.typing-indicator {
    padding: 0.5rem 2rem;
    align-self: flex-start;
}

.typing-bubble {
    background-color: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 18px;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.typing-bubble .dot {
    width: 6px;
    height: 6px;
    background-color: var(--color-text-muted);
    border-radius: 50%;
    opacity: 0.4;
    animation: wave 1.3s infinite ease-in-out;
}

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

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

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

.hidden {
    display: none !important;
}

/* Responsive adjustment */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    .message {
        max-width: 90%;
    }
}
