/* Dark Theme Variables */
:root {
    --bg-main: #1b1b1b;
    --bg-header: #252525;
    --bg-chat: #1b1b1b;
    --bg-input: #252525;
    --bg-bot-msg: #2d2d2d;
    --bg-user-msg: #004a83;
    --bg-system-msg: #333333;
    --border-color: #3d3d3d;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #0078d4;
    --user-accent: #107c10;
}

/* Layout Styles */
html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#container {
    height: 100%;
}

.ms-welcome {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.ms-welcome__header {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    padding: 10px 20px;
    flex-shrink: 0;
    background-color: rgba(37, 37, 37, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 10;
}

.ms-welcome__header img {
    width: 24px;
    height: 24px;
}

.ms-welcome__header h1 {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-main);
    font-weight: 600;
}

.ms-welcome__main {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
}

#chat-window {
    flex-grow: 1;
    overflow-y: auto;
    padding: 85px 20px 100px 20px; /* Padding for glass header/footer */
    display: flex;
    flex-direction: column;
    background-color: var(--bg-chat);
    height: 100%;
    box-sizing: border-box;
}

#input-area-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px;
    background-color: transparent;
    z-index: 10;
}

#input-area {
    background-color: rgba(37, 37, 37, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    display: flex;
    gap: 8px;
    padding: 6px 6px 6px 18px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
    align-items: center;
}

/* Message Icon Style */
.bot-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    margin-top: -3px;
}

/* New Loading Style */
.loading-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.loading-icon {
    width: 20px;
    height: 20px;
    animation: pulse 1.5s infinite ease-in-out;
}

.loading-text {
    color: var(--text-muted);
    font-size: 1.1em;
    font-weight: bold;
    letter-spacing: 2px;
}

@keyframes pulse {
    0% { transform: scale(0.92); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(0.92); opacity: 0.7; }
}

#user-input {
    flex-grow: 1;
    padding: 10px 0;
    background-color: transparent;
    border: none;
    font-size: 0.95em;
    color: white;
    outline: none;
}

#send-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    background-color: transparent;
    color: var(--accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

#send-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#send-btn:hover:not(:disabled) {
    color: #0086ed;
    transform: scale(1.1);
}

#send-btn:disabled {
    color: #444444;
}

#send-btn:active:not(:disabled) {
    transform: scale(0.95);
}

/* Auth Overlay Styles */
.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(27, 27, 27, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    text-align: center;
    padding: 20px;
}

.auth-card {
    background-color: #2d2d2d;
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.auth-card i {
    font-size: 3em;
    color: var(--accent);
    margin-bottom: 15px;
    display: block;
}

.auth-card p {
    margin: 10px 0;
    color: var(--text-main);
}

/* Chat Message Styles */
.chat-message {
    margin-bottom: 12px;
    padding: 8px 16px;
    border-radius: 12px;
    max-width: 88%;
    font-size: 0.95em;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.bot-message {
    background-color: var(--bg-bot-msg);
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.user-message {
    background-color: var(--bg-user-msg);
    color: white;
    align-self: flex-end;
    margin-left: auto;
    border-bottom-right-radius: 2px;
}

.system-message {
    background-color: var(--bg-system-msg);
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    font-size: 0.85em;
    margin: 10px auto;
    padding: 6px 16px;
    border-radius: 20px;
    max-width: 90%;
    border: 1px solid var(--border-color);
}

/* Loading Animation */
.loading-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    font-weight: bold;
    font-size: 1.1em;
}

.loading-dots span {
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.loading-dots span:nth-child(2) { animation-delay: -0.16s; }

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

/* Table and Content Styles */
.data-table-container {
    overflow-x: auto;
    margin-top: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.data-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.88em;
    background-color: #252525;
}

.data-table th, .data-table td {
    border: 1px solid var(--border-color);
    padding: 10px;
    text-align: left;
}

.data-table th {
    background-color: #333333;
    font-weight: 600;
    color: var(--accent);
}

.status-block {
    background-color: #252525;
    color: #00ff41; /* Matrix green for tools */
    font-size: 0.82em;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-family: 'Consolas', monospace;
}
