@charset "UTF-8";

/* Import a modern font pairing */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=JetBrains+Mono&display=swap');

:root {
    --bg-color: #131314;
    --container-bg: #1e1f20;
    --text-primary: #e3e3e3;
    --text-secondary: #b4b4b4;
    --accent-color: #444746;
    --button-bg: #007bff;
    --user-msg-bg: #2b2c2f;
    --bot-msg-bg: transparent;
    --border-color: #444746;
}

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

#chat-container {
    /* 1. Start at a reasonable default */
    width: 800px; 
    
    /* 2. Allow it to shrink for smaller windows */
    max-width: 95vw; 
    min-width: 350px; 
    
    height: 90vh;
    background: var(--container-bg);
    border-radius: 24px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    box-sizing: border-box;
    
    /* 3. Enable horizontal resizing */
    resize: horizontal; 
    overflow: auto; 
    margin: 40px auto;

    /* 4. Remove the strict max-width that was stopping the handle */
    /* (We use 95vw above instead so it doesn't go off-screen) */
}

/* Customizing the resize handle look (Chrome/Safari) */
#chat-container::-webkit-resizer {
    background-color: var(--accent-color);
    border-radius: 10px;
    outline: 2px solid var(--border-color);
	border: 12px solid transparent;
    border-right-color: var(--button-bg); /* Use your blue color */
    border-bottom-color: var(--button-bg);
}

h1 {
    font-weight: 500;
    font-size: 24px;
    margin: 0 0 20px 0;
    color: var(--text-primary);
}

/* Modern Selectors Row */
#bot-selector-container {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap; /* Allows stacking on very small windows */
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selector-group label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.selector-group select {
    background: var(--accent-color);
    color: var(--text-primary);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: all 0.2s;
}

.selector-group select:hover {
    background: #4f5251;
}

/* Chat History Window */
#chat-box {
    flex-grow: 1;
    overflow-y: auto;
    border: none;
    padding: 10px;
    margin-bottom: 20px;
    white-space: pre-wrap;
    font-size: 15px;
    line-height: 1.6;
}

/* Scrollbar Styling */
#chat-box::-webkit-scrollbar { width: 6px; }
#chat-box::-webkit-scrollbar-thumb { background: #3c4043; border-radius: 10px; }

/* Input Area Styling */
#input-wrapper {
    display: flex;
    gap: 12px;
    background: #28292a;
    border-radius: 28px;
    padding: 8px 16px;
    align-items: flex-end;
    border: 1px solid transparent;
    transition: border 0.2s;
}

#input-wrapper:focus-within {
    border-color: #5f6368;
}

#user-input {
    flex-grow: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    padding: 12px 0;
    
    /* Remove manual resize from here so it doesn't fight the container */
    resize: none; 
    
    min-height: 24px;
    max-height: 400px;
    outline: none;
}

#send-button {
    background: var(--button-bg);
    color: white;
    border: none;
    border-radius: 50%; /* Circular button like mobile apps */
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-bottom: 4px;
    transition: transform 0.1s;
}

#send-button:hover { transform: scale(1.05); }

/* Message Bubbles */
.user-message {
    background: var(--user-msg-bg);
    padding: 12px 18px;
    border-radius: 18px 18px 4px 18px;
    max-width: 85%;
    margin-left: auto;
    margin-bottom: 15px;
}
/*
.bot-message {
    padding: 12px 0;
    margin-bottom: 15px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
}
*/
/* Container for the whole code block */
.snippet-container {
    position: relative;
    background: #0d0d0d; /* Slightly darker than main bg */
    border: 1px solid #333;
    border-radius: 12px;
    margin: 15px 0;
    padding: 0;
    overflow: hidden;
}

/* The actual text area */
.bot-message-code {
    padding: 40px 15px 15px 15px; /* Top padding leaves room for button */
    margin: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #e3e3e3;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
}

/* The Copy Button */
.copy-snippet-btn {
    position: absolute;
    top: 8px;
    right: 12px;
    background: #444746;
    color: #e3e3e3;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
}

.copy-snippet-btn:hover {
    background: #5f6368;
}

pre {
    position: relative;
    background: #f4f4f4;
    padding: 15px;
    border-radius: 5px;
    margin: 10px 0;
    overflow-x: auto;
}

.copy-snippet-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 4px 8px;
    font-size: 10px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.copy-snippet-btn:hover {
    background: #0056b3;
}

/* This forces Safari to recognize these elements as interactive */
.send-button, 
.copy-snippet-btn,
button,
[onclick] {
    cursor: pointer !important;
    touch-action: manipulation;
}

#send-button, .copy-snippet-btn, button {
    cursor: pointer !important;
    /* This prevents the "gray highlight" box on iPhone when tapping */
    -webkit-tap-highlight-color: transparent; 
}

#user-input {
    box-sizing: border-box; /* Crucial for height calculation */
    overflow: hidden;       /* Hides the scrollbar as it grows */
    resize: none;           /* Prevents the user from manual resizing */
    min-height: 40px;       /* Set your desired starting height */
}