:root {
    /* Define your color variables here */
    --primary-color: #fd9320;
    --primary-color-hover: #e6851d;
    --primary-color-active: #ca7519;
    --primary-color-light: #FEC98F;
    --secondary-color: #f07800;
    --text-white: white;
    --text-dark: #333;
    --text-medium: #555;
    --text-light: #777;
    --text-lighter: #888;
    --border-color: #eee;
    --border-medium: #ddd;
    --background-light: #f8f9fa;
    --background-medium: #f5f5f5;
    --background-dark: #e9ecef;
    --background-hover: #f0f4f8;
    --table-header: #f2f2f2;
    --table-border: #ddd;
    --table-row-alt: #f9f9f9;
    --table-row-hover: #e9e9e9;
    --weather-blue: #60a5fa;
    --weather-blue-light: #eff6ff;
    --success-green: #28a745;
    --delete-red: #ff5555;
    --delete-red-light: #ffeeee;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-lighter: rgba(0, 0, 0, 0.05);
}

.chat-support-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-white);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 1000;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.chat-support-button:hover {
    transform: scale(1.1);
}

.chat-support-button.hide {
    transform: scale(0.5);
    opacity: 0;
}

.chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 5px 15px var(--shadow-color);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 1001;
    opacity: 0;
    transform-origin: bottom right;
    transition: width 0.3s ease, height 0.3s ease, border-radius 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}

/* Animation for chat container appearing */
.chat-container.animating {
    display: flex !important;
    opacity: 1;
}

/* Final state for chat container when open */
.chat-container.open {
    width: 384px;
    height: 500px;
    border-radius: 10px;
    opacity: 1;
    background-color: var(--text-white); /* Change to white when fully open */
}

/* Hide all content initially */
.chat-container:not(.open) > * {
    opacity: 0;
    visibility: hidden;
}

/* Show all content when open */
.chat-container.open > * {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.2s ease 0.2s, visibility 0s 0.2s;
}

.chat-header {
    padding: 15px;
    background-color: var(--primary-color);
    color: var(--text-white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-weight: bold;
}

.chat-close {
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: var(--background-light);
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
}

.message.user {
    margin-left: auto;
    text-align: right;
}

.message.support {
    margin-right: auto;
}

.message.thinking {
    opacity: 0.8;
}

.message-content {
    padding: 10px;
    border-radius: 10px;
    display: inline-block;
}

/*.message-content:not([data-tool-call-id]) {*/
/*    font-size: 1.5rem;*/
/*}*/

.message.user .message-content {
    background-color: var(--primary-color);
    color: var(--text-white);
}

.message.support .message-content {
    background-color: var(--text-white);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px var(--shadow-lighter);
}

.message-time {
    font-size: 0.7em;
    color: var(--text-lighter);
    margin-top: 5px;
}

.thinking-indicator {
    display: flex;
    justify-content: center;
}

.dot {
    width: 8px;
    height: 8px;
    margin: 0 3px;
    background-color: var(--primary-color);
    border-radius: 50%;
    animation: dot-pulse 1.5s infinite ease-in-out;
}

.dot:nth-child(2) {
    animation-delay: 0.3s;
}

.dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes dot-pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.chat-input-area {
    padding: 15px;
    display: flex;
    border-top: 1px solid var(--border-color);
    background-color: var(--text-white);
}

.chat-input-area textarea {
    flex: 1;
    border: 1px solid var(--border-medium);
    border-radius: 20px;
    padding: 10px 15px;
    resize: none;
    height: 40px;
    outline: none;
}

.chat-input-area textarea:disabled {
    background-color: var(--background-medium);
}

.chat-input-area button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-white);
    border: none;
    margin-left: 10px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

.chat-input-area button:disabled {
    background-color: var(--primary-color-light);
    cursor: not-allowed;
}

.code {
    font-family: monospace;
    background-color: var(--background-medium);
    padding: 10px;
    border-radius: 5px;
    overflow-x: auto;
}

pre {
    margin: 0;
    white-space: pre-wrap;
}

code {
    background-color: var(--background-medium);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: monospace;
}

.chat-tabs {
    padding: 10px 15px;
    background-color: var(--background-light);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.tab-slider {
    flex: 1;
    display: flex;
    position: relative;
    background-color: var(--background-dark);
    border-radius: 20px;
    height: 36px;
    overflow: hidden;
}

.tab {
    flex: 1;
    text-align: center;
    line-height: 36px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
    font-weight: 500;
    color: var(--text-medium);
}

.tab.active {
    color: var(--text-white);
}

.slider {
    position: absolute;
    height: 36px;
    width: 50%;
    background-color: var(--primary-color);
    border-radius: 20px;
    transition: transform 0.3s ease;
    z-index: 0;
}

.slider::before {
    display: none;
}

.new-chat-button {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--text-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    box-shadow: 0 2px 5px var(--shadow-light);
}

.new-chat-button:hover {
    background-color: var(--primary-color-hover);
    transform: scale(1.05);
}

.new-chat-button i {
    font-size: 20px;
}

/* History view styles */
.chat-history {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background-color: var(--background-light);
}

.history-item {
    padding: 12px;
    margin-bottom: 10px;
    background-color: var(--text-white);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background-color: var(--background-hover);
}

.history-item-title {
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
}

.history-item-time {
    font-size: 0.8em;
    color: var(--text-light);
    margin-right: 10px;
}

.history-item-delete {
    color: var(--delete-red);
    cursor: pointer;
    margin-left: 10px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.history-item-delete:hover {
    background-color: var(--delete-red-light);
}

.empty-history {
    text-align: center;
    color: var(--text-light);
    padding: 40px 20px;
    font-style: italic;
}

.chat-overview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: calc(100% - 20px); /* Subtract some space to ensure input is visible */
    padding: 2rem;
    text-align: center;
    overflow-y: auto; /* Add scroll if content is too tall */
}

.overview-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 1rem;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.overview-subtitle {
    color: var(--text-medium);
    margin-bottom: 2rem;
}

.overview-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.feature-card {
    background-color: var(--text-white);
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 5px var(--shadow-light);
    width: 100%;
    max-width: 200px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px var(--shadow-light);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.feature-title {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.feature-description {
    font-size: 0.8rem;
    color: var(--text-medium);
}

.overview-prompt {
    font-size: 0.9rem;
    color: var(--text-medium);
    font-style: italic;
}

.loading-container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--shadow-lighter);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* ---- Tools ---- */
/*!* Table container *!*/
.table-element-tool-table-container {
    width: 100%;
    overflow-x: auto; /* Enable horizontal scrolling */
    max-height: 400px;
    overflow-y: auto; /* Enable vertical scrolling */
}

/* Base table styling */
.table-element-tool-data-table {
    border-collapse: collapse;
    width: max-content; /* Allow table to expand beyond container width */
    min-width: 100%; /* Ensure table is at least as wide as container */
    border: 1px solid var(--table-border);
    font-size: 14px;
}

/* Table header styling */
.table-element-tool-data-table thead th {
    padding: 8px;
    text-align: left;
    background-color: var(--table-header);
    border-bottom: 2px solid var(--table-border);
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap; /* Prevent text wrapping in headers */
}

/* Table body styling */
.table-element-tool-data-table tbody td {
    padding: 8px;
    border-top: 1px solid var(--table-border);
    white-space: nowrap; /* Prevent text wrapping in cells */
}

/* Alternating row colors */
.table-element-tool-data-table tbody tr:nth-child(even) {
    background-color: var(--table-row-alt);
}

/* Hover effect on rows */
.table-element-tool-data-table tbody tr:hover {
    background-color: var(--table-row-hover);
}

/* Caption/info text */
.table-element-tool-table-info {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-medium);
}

/* Error message */
.table-element-tool-table-error {
    color: var(--delete-red);
}

/* ---- TOOL: get_weather ---- */
.tool-get-weather-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 16px;
    background-color: var(--weather-blue); /* bg-blue-400 equivalent */
}

.tool-get-weather-current-temp {
    font-size: 2.25rem; /* text-4xl */
    font-weight: 500; /* font-medium */
    color: var(--weather-blue-light); /* text-blue-50 */
}

.tool-get-weather-high-low {
    color: var(--weather-blue-light); /* text-blue-50 */
}

/* ---- TOOL: navigate_website ---- */
.tool-navigate-website-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    margin: 8px 0;
    background-color: var(--background-light);
    border-radius: 8px;
    border: 1px solid var(--background-dark);
}

.tool-navigate-website-message {
    font-size: 14px;
    color: var(--text-medium);
}

.tool-navigate-website-confidence {
    color: var(--success-green);
    font-weight: bold;
}

.tool-navigate-website-button {
    align-self: flex-start;
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: var(--text-white);
    border: none;
    border-radius: 4px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.tool-navigate-website-button:hover {
    background-color: var(--primary-color-hover);
}

.tool-navigate-website-button:active {
    background-color: var(--primary-color-active);
}
