:root {
    --bg-color: #0f1115;
    --chat-bg: #1a1d24;
    --user-msg: #4f46e5;
    --bot-msg: #2a2f3a;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --border-color: #2e3340;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.chat-container {
    width: 100%;
    max-width: 650px;
    height: 85vh;
    background: var(--chat-bg);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-color);
}


.chat-header {
    padding: 16px 24px;
    background: var(--chat-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center; 
    align-items: center;
    z-index: 10;
}

.tabs-container {
    display: flex;
    gap: 6px;
    background: var(--bg-color);
    padding: 6px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 8px 18px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-btn.active {
    background: var(--user-msg);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.4);
}

.tab-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tab-btn:not(.disabled):hover:not(.active) {
    color: var(--text-main);
    background: var(--bot-msg);
}

.chat-box {
    flex-grow: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-box::-webkit-scrollbar { width: 6px; }
.chat-box::-webkit-scrollbar-track { background: transparent; }
.chat-box::-webkit-scrollbar-thumb { background: #3f4451; border-radius: 10px; }
.chat-box::-webkit-scrollbar-thumb:hover { background: #4f5565; }

.msg {
    padding: 14px 20px;
    border-radius: 18px;
    max-width: 75%;
    font-size: 0.95rem;
    line-height: 1.5;
    word-wrap: break-word;
    position: relative;
}

.msg.user {
    background: var(--user-msg);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.msg.bot {
    background: var(--bot-msg);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.input-area {
    padding: 20px 24px;
    background: var(--chat-bg);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
}

input {
    flex-grow: 1;
    padding: 14px 24px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    border-color: var(--user-msg);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

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

button.send-btn {
    padding: 0 28px;
    border: none;
    border-radius: 999px;
    background: var(--user-msg);
    color: white;
    font-weight: 600;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

button.send-btn:hover:not(:disabled) {
    background: #4338ca;
}

button.send-btn:active:not(:disabled) {
    transform: scale(0.96);
}

button.send-btn:disabled {
    background: #374151;
    color: #6b7280;
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px 20px;
    background: var(--bot-msg);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
    border: 1px solid var(--border-color);
    align-items: center;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: blink 1.4s infinite both;
}
.dot:nth-child(1) { animation-delay: 0.2s; }
.dot:nth-child(2) { animation-delay: 0.4s; }
.dot:nth-child(3) { animation-delay: 0.6s; }

@keyframes blink {
    0% { opacity: 0.2; transform: scale(0.8); }
    20% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.2; transform: scale(0.8); }
}

.login-screen {
    width: 100%;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-color);
}

.login-card {
    background: var(--chat-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 16px 40px rgba(0,0,0,0.4);
    padding: 50px 40px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 380px;
    color: var(--text-main);
    text-align: center;
}

.login-card h2 {
    margin: 0 0 10px 0;
    font-size: 1.6rem;
    font-weight: 600;
}

.login-card input {
    width: 100%;
    padding: 14px 20px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.login-card input:focus {
    border-color: var(--user-msg);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
}

.login-card input:-webkit-autofill,
.login-card input:-webkit-autofill:hover,
.login-card input:-webkit-autofill:focus,
.login-card input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-color) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

.login-card button.send-btn {
    width: 100%;
    padding: 14px 24px;
    background: var(--user-msg);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    margin-top: 8px;
}

.login-card button.send-btn:hover:not(:disabled) {
    background: #4338ca;
}

.login-card button.send-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.error-msg {
    color: #ef4444;
    font-size: 0.9rem;
    text-align: center;
    margin: 0;
}