/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --bg-main: #f3f4f6;
    --chat-bg: rgba(255, 255, 255, 0.85);
    --bot-msg-bg: #ffffff;
    --user-msg-bg: #4F46E5;
    --user-msg-text: #ffffff;
    --bot-msg-text: #1f2937;
    --text-muted: #6b7280;
    --shadow-rgb: 0, 0, 0, 0.1;
    --border-color: rgba(255, 255, 255, 0.3);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f0fdf4 0%, #e0e7ff 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1f2937;
    overflow: hidden;
}

.chat-container {
    width: 100%;
    max-width: 450px;
    height: 90vh; /* Not full height for desktop framing */
    background: var(--chat-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(var(--shadow-rgb)), 0 0 0 1px var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Header */
.chat-header {
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    z-index: 10;
}

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

.avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

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

.status {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.text-green { color: #10b981; font-size: 0.5rem; }

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

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: rgba(0,0,0,0.05);
    color: var(--primary);
}

.hidden {
    display: none !important;
}

/* Chat Body */
.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    background-image: radial-gradient(rgba(0,0,0,0.02) 1px, transparent 1px);
    background-size: 20px 20px;
}

.chat-body::-webkit-scrollbar {
    width: 6px;
}
.chat-body::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.1);
    border-radius: 10px;
}

.message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: fadeIn 0.3s ease forwards;
}

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

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

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

.message-content {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.message.user .message-content {
    background: var(--user-msg-bg);
    color: var(--user-msg-text);
    border-bottom-right-radius: 4px;
}

.message.bot .message-content {
    background: var(--bot-msg-bg);
    color: var(--bot-msg-text);
    border-bottom-left-radius: 4px;
}

.message-content strong {
    font-weight: 600;
}
.message-content ul, .message-content ol {
    margin-left: 20px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.timestamp {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 4px;
    align-self: flex-end;
}

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

/* Smart Suggestions */
.smart-suggestions {
    padding: 10px 16px;
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
}
.smart-suggestions::-webkit-scrollbar {
    display: none; /* Chrome */
}

.suggestion-btn {
    background: #e0e7ff;
    color: var(--primary);
    border: 1px solid rgba(79, 70, 229, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.suggestion-btn:hover {
    background: var(--primary);
    color: white;
}

/* Footer (Input) */
.chat-footer {
    padding: 16px;
    background: rgba(255, 255, 255, 0.9);
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.input-wrapper {
    flex: 1;
    background: #f3f4f6;
    border-radius: 24px;
    padding: 2px 16px;
    display: flex;
    align-items: center;
    transition: all 0.3s;
}

.input-wrapper:focus-within {
    background: white;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

#chat-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 12px 0;
    font-size: 0.95rem;
    color: #1f2937;
    outline: none;
    font-family: inherit;
}

.send-btn {
    background: var(--primary);
    color: white;
    width: 42px;
    height: 42px;
}
.send-btn:hover {
    background: var(--primary-hover);
    color: white;
    transform: scale(1.05);
}

.voice-recording {
    color: #ef4444 !important;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px 20px !important;
    align-items: center;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
}

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

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

/* Markdown parsing classes */
.message-content a {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
}
.message-content a:hover {
    text-decoration: underline;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    .chat-container {
        height: 100vh;
        max-width: 100%;
        border-radius: 0;
    }
}
