
:root {
    
    --bg-color: #f9fafb;
    --text-color: #111827;
    --user-message-bg: #e0f2fe;
    --assistant-message-bg: #ffffff;
    --input-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --accent-color: #3b82f6;
    --hover-color: #2563eb;
    --placeholder-color: #9ca3af;
    --status-connecting: #f59e0b;
    --status-connected: #10b981;
    --status-disconnected: #ef4444;
}

.dark-mode {
    
    --bg-color: #111827;
    --text-color: #f9fafb;
    --user-message-bg: #1e3a8a;
    --assistant-message-bg: #1f2937;
    --input-bg: #374151;
    --border-color: #4b5563;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --accent-color: #60a5fa;
    --hover-color: #93c5fd;
    --placeholder-color: #9ca3af;
    --status-connecting: #fbbf24;
    --status-connected: #34d399;
    --status-disconnected: #f87171;
}



body {
    background-color: var(--bg-color);
    transition: background-color 0.3s, color 0.3s;
    min-height: 100vh; /* Use viewport height to ensure minimum full height */
    display: flex;
    flex-direction: column;
    padding-bottom: 10px; 
}

/* Add padding to the bottom of the main container to prevent content from being hidden */
.main {
    padding-bottom: 100px; /* Adjust based on your input container height */
}




.chat-container {
    display: flex;
    flex-direction: column;
    position: relative;
    margin-bottom: 20px; /* Add space at the bottom */
    padding-bottom: 150px;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 40px;
    
}

/* Ensure messages expand properly */
.message {
    
    border-radius: 0.75rem;
    max-width: 90%;
    animation: fadeIn 0.3s ease-out;
    word-wrap: break-word; /* Ensure long words don't overflow */
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    background-color: var(--user-message-bg);
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
    padding: 1rem;
}

.assistant-message {
    /*background-color: var(--assistant-message-bg); */
    align-self: flex-start;
    /*border-bottom-left-radius: 0.25rem;
    box-shadow: 0 2px 5px var(--shadow-color);*/
    font-size: 1.25rem;
    line-height: 1.875;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}



.typing-indicator {
    display: inline-block;
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
}

.typing-indicator::after {
    content: '';
    position: absolute;
    width: 0.5rem;
    height: 0.5rem;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: blink 1s infinite;
}

.loading-animation {
    color:#9ca3af
}

@keyframes blink {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 1; }
}

.input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--bg-color);
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    z-index: 100; /* Higher z-index to ensure it stays on top */
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1); /* Add shadow for visual separation */
    /* Center the input container and limit its width */
    max-width: 1200px;
    margin: 0 auto;
    transition: transform 0.3s ease-in-out;
}

#message-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.textarea-wrapper {
    flex-grow: 1;
    position: relative;
}

#message-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-color);
    resize: none;
    font-family: inherit;
    font-size: 1.5rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    max-height: 200px;
    overflow-y: auto;
}

#message-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

#message-input::placeholder {
    color: var(--placeholder-color);
}

.button-group {
    display: flex;
    gap: 0.5rem;
}

button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

button:hover {
    background-color: var(--hover-color);
}

#send-button {
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0.5rem; /* Ensure consistent rounded corners */
    padding: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
}

#send-button:hover {
    background-color: var(--hover-color);
}

#send-button:active {
    transform: scale(0.95); /* Slight press effect */
}

/* Add a subtle shadow for depth */
#send-button svg {
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.1));
}

#new-chat-button {
    background-color: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto; /* Push to the right side */
    margin-top: 10px;
}

#new-chat-button svg {
    width: 16px;
    height: 16px;
}

#new-chat-button:hover {
    background-color: var(--border-color);
}

.connection-status {
    font-size: 0.75rem;
    margin-top: 0.5rem;
    text-align: center;
    color: var(--status-connecting);
}

.connection-status.connected {
    color: var(--status-connected);
}

.connection-status.disconnected {
    color: var(--status-disconnected);
}


.chat-container.empty-chat {
    justify-content: center;
}

.empty-chat .chat-messages {
    flex-grow: 0;
}


.response-type-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 1.25rem;
    color: var(--text-color-secondary);
}

.response-options-container {
    display: flex;
    flex-direction: column;
}

.response-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 4px;
}

.response-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.response-option input {
    margin-right: 4px;
}

.response-type-selector,
.connection-status {
    transition: opacity 0.3s ease-in-out;
}

.message-form {
    display: flex;
    width: 100%;
}


@media (max-width: 600px) {
    .response-options {
        flex-direction: column;
        gap: 6px;
    }
}


@media (max-width: 768px) {
    .message {
        max-width: 95%;
    }
    
    .input-container {
        padding: 0.75rem;
    }
    
    #message-input {
        padding: 0.5rem 0.75rem;
    }
    
    button {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    
    
    header {
        padding: 0.5rem 0;
    }
    
    h1 {
        font-size: 1.25rem;
    }
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .button-group {
        flex-direction: row;
        align-items: center;
    }
    
    #new-chat-button {
        margin-top: 0;
        width: auto;
    }
}

/* If you want it to always be at the bottom even with little content */
@media screen and (min-height: 800px) {
    .body {
        min-height: 100vh;
    }
}

/* Ensure the input container has proper padding on the sides to match the container */
@media (min-width: 1200px) {
    .input-container {
        left: calc((100% - 1200px) / 2);
        right: calc((100% - 1200px) / 2);
    }
}

/* Collapsed state for mobile */
@media (max-width: 768px) {
    .input-container.collapsed {
        transform: translateY(calc(100% - 70px)); /* Show only the input field */
    }
    
    .input-container.collapsed .response-type-selector,
    .input-container.collapsed .connection-status {
        opacity: 0;
        pointer-events: none;
    }
    
    /* Ensure the input is always accessible */
    .input-container.collapsed #message-form {
        opacity: 1;
    }
    
    /* Add a subtle indicator that more is available */
    .input-container.collapsed::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 4px;
        background-color: var(--border-color);
        border-radius: 2px;
        opacity: 0.7;
    }
}

/* Ensure desktop view is not affected */
@media (min-width: 769px) {
    .input-container.collapsed {
        transform: none;
    }
    
    .input-container.collapsed .response-type-selector,
    .input-container.collapsed .connection-status {
        opacity: 1;
        pointer-events: auto;
    }
}

