/* Geist Sans font utility */
.font-geist, html, body {
    font-family: 'Geist', 'Geist Sans', 'Poppins', Verdana, Geneva, Tahoma, Arial, sans-serif !important;
}

/* Icon-text utility class for horizontal alignment */
.icon-text {
    display: flex;
    align-items: center;
}

.icon-text svg {
    margin-right: 0.5rem;
    flex-shrink: 0;
    display: inline-block !important;
    vertical-align: middle;
}

.lucide,
[data-lucide] {
    width: 1.5em !important;
    height: 1.5em !important;
}

/* CSS Variables for Layout */
:root {
    --sidebar-width-expanded: 280px;
    --sidebar-width-collapsed: 70px;
    --navbar-height: 64px;
    --transition-duration: 0.3s;
    --sidebar-border-color: #e5e7eb; /* Light mode default */
}

/* Dark mode variables */
[data-theme="dark"] {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --hover-bg: #374151;
    --sidebar-border-color: #1f2937;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --bg-accent: #1e3a8a;
    --bg-accent-dark: #1e3a8a;
    --error-color: #f87171;
    --error-color-dark: #f87171;
    --error-bg: #450a0a;
    --error-border: #7f1d1d;
    --warning-bg: #1f2937;
    --warning-border: #f59e0b;
    --warning-text: #fbbf24;
    --warning-icon: #f59e0b;
}

/* Light mode variables */
[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --hover-bg: #f3f4f6;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --bg-accent: #eff6ff;
    --bg-accent-dark: #dbeafe;
    --error-color: #dc2626;
    --error-color-dark: #ef4444;
    --error-bg: #fef2f2;
    --error-border: #fecaca;
    --warning-bg: #fef3c7;
    --warning-border: #f59e0b;
    --warning-text: #92400e;
    --warning-icon: #f59e0b;
}

/* Sidebar Container */
.sidebar {
    width: var(--sidebar-width-expanded);
    height: 100vh;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--sidebar-border-color, #e5e7eb);
    transition: width var(--transition-duration) ease-in-out;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 50;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

/* Sidebar Content */
.sidebar-content {
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Sidebar Logo Section */
.sidebar-logo {
    display: flex;
    align-items: center;
    padding: 0.2rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    transition: all var(--transition-duration) ease-in-out;
}

.sidebar-logo img {
    width: 2rem !important;
    height: 2rem !important;
    border-radius: 0.375rem;
    flex-shrink: 0;
    object-fit: contain;
    min-width: 2rem !important;
    min-height: 2rem !important;
    max-width: 2rem !important;
    max-height: 2rem !important;
    transition: none !important;
}

.sidebar-logo span {
    margin-left: 0.75rem;
    font-weight: 600;
    font-size: 1.125rem;
    color: var(--text-primary);
    white-space: nowrap;
    opacity: 1;
    transition: opacity var(--transition-duration) ease-in-out;
}

.sidebar.collapsed .sidebar-logo span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Ensure logo image maintains size when sidebar is collapsed */
.sidebar.collapsed .sidebar-logo img {
    width: 2rem !important;
    height: 2rem !important;
    min-width: 2rem !important;
    min-height: 2rem !important;
    max-width: 2rem !important;
    max-height: 2rem !important;
    transition: none !important;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Sidebar Separator */
.sidebar-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 1rem 0;
    opacity: 0.6;
}

/* Sidebar Menu Items */
.sidebar-menu-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-duration) ease-in-out;
    cursor: pointer;
    white-space: nowrap;
}

.sidebar-menu-item:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.sidebar-menu-item {
    transition: all 0.2s ease-in-out;
}

/* Light mode specific hover for sidebar menu items */
[data-theme="light"] .sidebar-menu-item:hover {
    background-color: #f3f4f6; /* Same as navbar button hover */
}

.sidebar-menu-item.active {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

/* Collapsed state: hide text, center icons for all menu items */
.sidebar.collapsed .sidebar-menu-item span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}
.sidebar.collapsed .sidebar-menu-item {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

/* Main Content Adjustment */
.main-content {
    margin-left: var(--sidebar-width-expanded);
    transition: margin-left var(--transition-duration) ease-in-out;
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-width-collapsed);
}

.focus-ring:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Password strength indicator */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 4px;
    transition: all 0.3s ease;
}

.password-strength.weak {
    background: linear-gradient(to right, #ef4444 0%, #ef4444 33%, #e5e7eb 33%, #e5e7eb 100%);
}

.password-strength.medium {
    background: linear-gradient(to right, #f59e0b 0%, #f59e0b 66%, #e5e7eb 66%, #e5e7eb 100%);
}

.password-strength.strong {
    background: linear-gradient(to right, #10b981 0%, #10b981 100%);
}

/* Form validation styles */
.input-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 1px #ef4444 !important;
}

.input-success {
    border-color: #10b981 !important;
    box-shadow: 0 0 0 1px #10b981 !important;
}

/* Loading state for buttons */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 3px;
    transition: background-color 0.2s ease-in-out;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Form section animations */
.form-section {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s ease forwards;
}

.form-section:nth-child(2) {
    animation-delay: 0.1s;
}

.form-section:nth-child(3) {
    animation-delay: 0.2s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .max-w-2xl {
        margin: 0 1rem;
    }
    
    .bg-white {
        padding: 1.5rem;
    }
}

/* Primary button gradient update */
.btn-primary, .bg-blue-600, .bg-blue-700, .bg-blue-500, .bg-blue-400 {
    background: linear-gradient(90deg, #314755 0%, #26a0da 100%) !important;
    border: none;
    color: #fff;
}

.btn-primary:hover, .bg-blue-700:hover, .bg-blue-500:hover, .bg-blue-400:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(49, 71, 85, 0.2), 0 2px 8px rgba(38, 160, 218, 0.15);
}

/* Violet button (original btn-primary blue-purple gradient) */
.btn-violet {
    background: linear-gradient(90deg, #1A6DFF 0%, #C822FF 100%) !important;
    border: none;
    color: #fff;
}

.btn-violet:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 12px rgba(26, 109, 255, 0.2), 0 2px 8px rgba(200, 34, 255, 0.15);
}


/* .btn-grad {background-image: linear-gradient(to right, #1A6DFF 0%, #C822FF  51%, #1A6DFF  100%)}
.btn-grad {

   text-align: center;
   text-transform: uppercase;
   transition: 0.5s;
   background-size: 200% auto;
   color: white;            
   box-shadow: 0 0 20px #eee;
   border-radius: 10px;
   display: block;
 }

 .btn-grad:hover {
   background-position: right center;
   color: #fff;
   text-decoration: none;
 } */

 
 /* bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 transition-colors duration-200 */

 .btn-grad {background-image: linear-gradient(to right, #314755 0%, #26a0da  51%, #314755  100%)}
 .btn-grad {

    text-align: center;
    text-transform: uppercase;
    transition: 0.5s;
    background-size: 200% auto;
    color: white;            
    box-shadow: 0 0 20px #eee;
    border-radius: 10px;
    display: block;
  }

  .btn-grad:hover {
    background-position: right center; /* change the direction of the change here */
    color: #fff;
    text-decoration: none;
  }
 

/* Agent Dropdown Collapse Behavior */
.sidebar.collapsed .sidebar-agent-dropdown {
    display: none !important;
}
.sidebar.collapsed .sidebar-agent-dropdown .agent-dropdown-text,
.sidebar.collapsed .sidebar-agent-dropdown .agent-dropdown-chevron {
    display: none !important;
}
.sidebar.collapsed .sidebar-agent-dropdown .sidebar-agent-btn {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    justify-content: center;
}
.sidebar.collapsed .sidebar-agent-dropdown .agent-logo {
    margin-right: 0;
}
 
.sidebar.collapsed .sidebar-chat-btn-text {
    display: none !important;
}
.sidebar.collapsed .sidebar-chat-btn {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    /* Override Tailwind classes when collapsed */
    gap: 0 !important;
    padding: 0.5rem !important;
    margin-bottom: 0.5rem !important;
}

/* Ensure chat button icon maintains proper size when collapsed */
.sidebar.collapsed .sidebar-chat-btn i,
.sidebar.collapsed .sidebar-chat-btn svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    min-width: 1.25rem !important;
    min-height: 1.25rem !important;
}
 
.sidebar.collapsed .sidebar-agentspecific span {
    display: none !important;
}
.sidebar.collapsed .sidebar-agentspecific .sidebar-menu-item {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
.sidebar.collapsed .sidebar-agentspecific .sidebar-submenu, .sidebar.collapsed {
    margin-left: 0;
}

.sidebar.collapsed .options-menu .sidebar-menu-item span {
    display: none !important;
}
.sidebar.collapsed .options-menu .sidebar-menu-item {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
 
/* Hide all sidebar menu labels and chevrons when collapsed */
.sidebar.collapsed .sidebar-agentspecific span,
.sidebar.collapsed .options-menu span,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-agent-dropdown .agent-dropdown-text,
.sidebar.collapsed .sidebar-agent-dropdown .agent-dropdown-chevron,
.sidebar.collapsed .sidebar-chat-btn-text,
.sidebar.collapsed .sidebar-menu-item .ml-auto {
    display: none !important;
}

/* Floating submenu for collapsed sidebar */
.sidebar.collapsed .sidebar-menu-group .sidebar-float-submenu {
    display: none;
    position: fixed;
    left: calc(var(--sidebar-width-collapsed) + 8px);
    top: 0;
    min-width: 180px;
    background: var(--bg-primary);
    border: 1px solid var(--sidebar-border-color, #e5e7eb);
    border-radius: 0.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    z-index: 1000;
    padding: 0.5rem 0;
}
.sidebar.collapsed .sidebar-menu-group .sidebar-float-submenu.active {
    display: block;
}
 
/* Show/hide submenus based on sidebar state */
.sidebar.collapsed .sidebar-menu-group .sidebar-submenu {
    display: none !important;
}
.sidebar:not(.collapsed) .sidebar-menu-group .sidebar-float-submenu {
    display: none !important;
}
 
.sidebar-float-submenu {
    align-items: flex-start !important;
}
.sidebar-float-submenu .sidebar-menu-item {
    justify-content: flex-start !important;
    text-align: left !important;
    width: 100%;
}
.sidebar-float-submenu .sidebar-menu-item span {
    text-align: left !important;
}
 
/* --- FLOATING SUBMENU OVERRIDE: ENSURE TEXT IS VISIBLE WHEN SIDEBAR COLLAPSED --- */
.sidebar.collapsed .sidebar-float-submenu .sidebar-menu-item span {
    opacity: 1 !important;
    width: auto !important;
    overflow: visible !important;
    display: inline !important;
    color: inherit !important;
}
 
/* Only hide text in the main sidebar, not in the floating submenu */
.sidebar.collapsed .sidebar-agentspecific > .sidebar-menu-item span,
.sidebar.collapsed .sidebar-agentspecific .sidebar-submenu .sidebar-menu-item span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

/* Navbar Styles */
.navbar {
    position: sticky;
    top: 0;
    z-index: 40;
    /* Remove backdrop-filter and semi-transparent background */
    background-color: var(--bg-primary) !important;
    border-bottom: 1px solid var(--sidebar-border-color) !important;
}

[data-theme="dark"] .navbar {
    background-color: rgba(17, 24, 39, 0.95);
}

/* Breadcrumb styles */
.navbar nav {
    font-size: 0.875rem;
}

/* Notification badge */
.navbar .absolute {
    z-index: 10;
}

/* User dropdown styles */
#user-dropdown-menu {
    transform-origin: top right;
    transition: all 0.2s ease-in-out;
}

#user-dropdown-menu.show {
    display: block;
}

/* Theme toggle icon transition */
#theme-icon {
    transition: transform 0.3s ease-in-out;
}

#theme-toggle:hover #theme-icon {
    transform: rotate(15deg);
}

/* Navbar button hover effects */
.navbar button:hover {
    transform: translateY(-1px);
}

.navbar button {
    transition: all 0.2s ease-in-out;
}

/* Sidebar icon hover effects (when collapsed) */
.sidebar.collapsed .sidebar-menu-item:hover {
    transform: translateY(-1px);
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.sidebar.collapsed .sidebar-menu-item {
    transition: all 0.2s ease-in-out;
}

/* Light mode specific hover for collapsed sidebar menu items */
[data-theme="light"] .sidebar.collapsed .sidebar-menu-item:hover {
    background-color: #f3f4f6; /* Same as navbar button hover */
}

/* Chat button hover effects */
.sidebar.collapsed .sidebar-chat-btn:hover {
    transform: translateY(-1px);
}

.sidebar.collapsed .sidebar-chat-btn {
    transition: all 0.2s ease-in-out;
}

/* Agent dropdown button hover effects (when collapsed) */
.sidebar.collapsed .sidebar-agent-btn:hover {
    transform: translateY(-1px);
}
 
/* 1. Navbar and main content use same bg as sidebar in dark mode */
[data-theme="dark"] .navbar,
[data-theme="dark"] .main-content,
[data-theme="dark"] body,
[data-theme="dark"] html {
    background-color: var(--bg-primary) !important;
}

/* 2. Breadcrumb text white in dark mode */
[data-theme="dark"] .navbar nav span,
[data-theme="dark"] .navbar nav {
    color: #fff !important;
}

/* 3. Navbar icon and avatar hover in dark mode */
[data-theme="dark"] .navbar button:hover,
[data-theme="dark"] .navbar #user-dropdown-btn:hover {
    background-color: var(--hover-bg) !important;
    color: var(--text-primary) !important;
}

/* 4. Avatar button hover matches other navbar icons */
.navbar #user-dropdown-btn {
    transition: all 0.2s ease-in-out;
}
 
/* 1. Breadcrumbs style matches sidebar-section-label */
.navbar nav {
    font-size: 0.75rem; /* text-xs */
    font-weight: 600;   /* font-semibold */
    color: var(--text-secondary);
}
[data-theme="dark"] .navbar nav {
    color: var(--text-secondary) !important;
}

/* 2. Navbar bottom border matches sidebar right border */
.navbar {
    border-bottom: 1px solid var(--sidebar-border-color) !important;
}

/* 3. Agent dropdown styles */
.sidebar-agent-btn {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease-in-out;
}
.sidebar-agent-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}
/* Light mode explicit styles */
[data-theme="light"] .sidebar-agent-btn {
    background-color: #f3f4f6 !important; /* bg-gray-100 equivalent */
    color: #111827 !important; /* text-gray-900 equivalent */
}
[data-theme="light"] .sidebar-agent-btn:hover {
    background-color: #e5e7eb !important; /* hover:bg-gray-200 equivalent */
    color: #111827 !important; /* text-gray-900 equivalent */
}
/* Dark mode styles */
[data-theme="dark"] .sidebar-agent-btn {
    background-color: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
}
[data-theme="dark"] .sidebar-agent-btn:hover {
    background-color: var(--hover-bg) !important;
    color: var(--text-primary) !important;
}

#agent-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--sidebar-border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    z-index: 50;
    overflow: hidden;
}

/* Seamless connection effect when dropdown is open */
#agent-dropdown-btn.dropdown-open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none;
}

#agent-dropdown-menu.dropdown-open {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: none;
    margin-top: -1px; /* Compensate for the removed border */
}
/* Light mode explicit styles for dropdown menu */
[data-theme="light"] #agent-dropdown-menu {
    background-color: #ffffff !important; /* white */
    color: #111827 !important; /* text-gray-900 */
    border: 1px solid #e5e7eb !important; /* border-gray-200 */
}
[data-theme="light"] #agent-dropdown-menu button {
    color: #111827 !important; /* text-gray-900 */
}
[data-theme="light"] #agent-dropdown-menu button:hover {
    background-color: #f3f4f6 !important; /* hover:bg-gray-100 */
    color: #111827 !important; /* text-gray-900 */
}
/* Dark mode styles for dropdown menu */
[data-theme="dark"] #agent-dropdown-menu {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--sidebar-border-color) !important;
}
#agent-dropdown-menu button {
    background: none;
    color: var(--text-primary);
    transition: background 0.2s, color 0.2s;
}
#agent-dropdown-menu button:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}
[data-theme="dark"] #agent-dropdown-menu button {
    color: var(--text-primary) !important;
}
[data-theme="dark"] #agent-dropdown-menu button:hover {
    background-color: var(--hover-bg) !important;
    color: var(--text-primary) !important;
}
 
/* Ensure navbar icons are white in dark mode */
[data-theme="dark"] .navbar i,
[data-theme="dark"] .navbar svg {
    color: var(--text-primary) !important;
    stroke: var(--text-primary) !important;
    fill: none !important;
}

/* User dropdown menu dark mode styles */
#user-dropdown-menu {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--sidebar-border-color);
}

[data-theme="dark"] #user-dropdown-menu {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--sidebar-border-color) !important;
}

#user-dropdown-menu .px-4 {
    border-bottom: 1px solid var(--sidebar-border-color);
}

[data-theme="dark"] #user-dropdown-menu .px-4 {
    border-bottom: 1px solid var(--sidebar-border-color) !important;
}

#user-dropdown-menu a {
    background: none;
    color: var(--text-primary);
    transition: background 0.2s, color 0.2s;
}

#user-dropdown-menu a:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

[data-theme="dark"] #user-dropdown-menu a {
    color: var(--text-primary) !important;
}

[data-theme="dark"] #user-dropdown-menu a:hover {
    background-color: var(--hover-bg) !important;
    color: var(--text-primary) !important;
}

/* Chat Container and Page Content Layout */
.content-area {
    display: flex;
    flex-direction: row;
    flex: 1;
    overflow: hidden;
}

/* Chat Container Styles */
.chat-container {
    width: 20%; /* 5x smaller than main content (which is 80%) */
    min-width: 300px;
    max-width: 80%; /* Maximum width when resized */
    background-color: var(--bg-primary);
    border-left: 1px solid var(--sidebar-border-color);
    border-right: 1px solid var(--sidebar-border-color);
    display: flex;
    flex-direction: column;
    transform: translateX(-100%); /* Start hidden by default */
    opacity: 0;
    transition: width 0.1s ease-out, transform var(--transition-duration) ease-in-out, opacity var(--transition-duration) ease-in-out; /* Combined transitions */
}

.chat-container.hidden {
    transform: translateX(-100%);
    opacity: 0;
    width: 0;
    min-width: 0;
    max-width: 0;
    border-left: none;
    border-right: none;
    visibility: hidden;
    position: absolute;
}

.chat-container.visible {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    position: relative;
}

/* Resize Handle as pseudo-element */
.chat-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: -2px;
    width: 2px;
    height: 100%;
    background-color: var(--border-color);
    cursor: col-resize;
    z-index: 10;
    opacity: 0;
    transition: 
        background-color 0.2s ease-in-out,
        opacity var(--transition-duration) ease-in-out;
}

.chat-container.visible::after {
    opacity: 1;
}

/* Visual indicator (small handle in the middle) */
.chat-container::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -1px;
    transform: translateY(-50%);
    width: 2px;
    height: 20px;
    background-color: var(--text-muted);
    border-radius: 1px;
    opacity: 0;
    z-index: 11;
    transition: opacity var(--transition-duration) ease-in-out;
}

.chat-container.visible::before {
    opacity: 0.5;
}

.chat-container:hover::after {
    background-color: var(--text-primary);
}

.chat-container:hover::before {
    background-color: var(--text-primary);
    opacity: 1;
}

.chat-container.dragging::after {
    background-color: var(--text-primary);
    width: 6px;
    /* Disable transitions during drag to prevent conflicts */
    transition: none !important;
}

.chat-container.dragging::before {
    background-color: var(--text-primary);
    opacity: 1;
    transition: none !important;
}





/* Chat Actions (positioned in upper right corner) */
.chat-actions {
    display: flex;
    gap: 0.25rem;
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    z-index: 10;
    background-color: var(--bg-primary);
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

/* Chat Agent Profile (positioned in upper left corner) */
.chat-agent-profile {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    background-color: var(--bg-primary);
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
}

.chat-agent-profile .agent-logo {
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    overflow: hidden;
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: all 0.2s ease-in-out;
}

/* Chat Messages Styling */
.chat-messages {
    padding: 1rem;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    display: flex;
    margin-bottom: 0.75rem;
}

.user-message {
    justify-content: flex-end;
}

.agent-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
}

.user-message .message-content {
    background-color: var(--primary-color);
    color: white;
    border-bottom-right-radius: 0.25rem;
}

.agent-message .message-content {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 0.25rem;
}

.message-text {
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.agent-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.message-timestamp {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-top: 0.25rem;
}

.welcome-message .message-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    text-align: center;
}

.welcome-message .agent-name {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Upper Right Button - Reusable button class based on chat-action-btn */
.upper-right-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.upper-right-button:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.upper-right-button i {
    width: 0.75rem !important;
    height: 0.75rem !important;
}

/* Make chat actions semi-transparent when messages exist */
.chat-actions.hidden-on-hover {
    opacity: 0.3;
    visibility: visible;
}

.chat-actions.hidden-on-hover:hover {
    opacity: 1;
}

/* Make chat agent profile semi-transparent when messages exist */
.chat-agent-profile.hidden-on-hover {
    opacity: 0.3;
    visibility: visible;
}

.chat-agent-profile.hidden-on-hover:hover {
    opacity: 1;
}

.chat-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.chat-action-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

/* Tooltip styles for chat action buttons */
.chat-action-btn::before {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateX(0);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    z-index: 1000;
    border: 1px solid var(--border-color);
    margin-top: 0.25rem;
}

.chat-action-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

.chat-action-btn i {
    width: 0.75rem !important;
    height: 0.75rem !important;
}

/* Chat Body */
.chat-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    padding-top: 4rem; /* Increased top padding for more space between chat actions and first message */
    padding-bottom: 5rem; /* Add bottom padding to account for transparent input area */
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.chat-message.user {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

.chat-message.assistant {
    flex-direction: row;
    justify-content: flex-start;
}

.chat-message-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    flex-shrink: 0;
}

.chat-message-content {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.chat-message-content-llm {
    background-color: var(--bg-primary);
    padding: 0.5rem;
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    border: none;
    max-width: 100%;
}

.chat-message-content-user {
    background-color: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: 0.75rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

.chat-message-content-session-start {
    background-color: transparent;
    padding: 0.5rem;
    border-radius: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    border: none;
    text-align: center;
    font-style: italic;
}

.chat-message-text {
    margin: 0;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Message Action Icons */
.chat-message-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.chat-message.assistant:hover .chat-message-actions {
    opacity: 1;
}

.chat-message-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.chat-message-action-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.chat-message-action-btn i {
    width: 0.75rem !important;
    height: 0.75rem !important;
}

/* Tooltip styles */
.chat-message-action-btn::before {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 0;
    transform: translateX(0);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease-in-out;
    z-index: 1000;
    border: 1px solid var(--border-color);
    margin-top: 0.25rem;
}

.chat-message-action-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Chat Input Area */
.chat-input-area {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.7rem;
    background: transparent; /* Transparent background */
    z-index: 10;
}

/* Make chat input area semi-transparent when messages exist */
.chat-input-area.hidden-on-hover {
    opacity: 0.3;
    visibility: visible;
}

.chat-input-area.hidden-on-hover:hover {
    opacity: 1;
}

/* Light mode specific styling for chat areas */
[data-theme="light"] .chat-input-area {
    background: transparent !important;
}

.chat-input-container {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    width: 100%;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.8rem;
    transition: border-color 0.2s ease-in-out, height 0.2s ease-in-out;
    resize: none;
    outline: none;
    min-height: 2.5rem; /* One line */
    max-height: 6.2rem; /* Three lines (2.5rem base + 1.4 line-height * 2 additional lines) */
    line-height: 1.4;
    font-family: inherit;
    overflow-y: hidden; /* Hide scrollbar initially */
    box-sizing: border-box;
    cursor: text; /* Normal text cursor for input */
}

.chat-input:focus {
    outline: none;
    border-color: var(--text-primary);
}

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

.chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.375rem;
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.chat-send-btn:hover {
    opacity: 0.8;
    transform: translateY(-1px);
}

/* Page Content */
.page-content {
    flex: 1;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    padding: 1.5rem;
    min-width: 0; /* Allow content to shrink */
}

/* Two-column layout when chat is visible */
.content-area:has(.chat-container:not(.hidden)) .page-content {
    width: 80%;
}

/* Full width when chat is hidden */
.content-area:has(.chat-container.hidden) .page-content {
    width: 100%;
}

/* Fallback: When chat container is hidden, page content should expand */
.chat-container.hidden + .page-content {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
}

/* Responsive behavior */
@media (max-width: 1024px) {
    .chat-container {
        width: 30%;
        min-width: 250px;
    }
    
    .content-area:has(.chat-container:not(.hidden)) .page-content {
        width: 70%;
    }
    
    .content-area:has(.chat-container.hidden) .page-content {
        width: 100%;
    }
    
    .chat-container.hidden + .page-content {
        width: 100% !important;
        max-width: 100% !important;
        flex: 1 !important;
    }
}

@media (max-width: 768px) {
    .chat-container {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        z-index: 100;
        min-width: 100%;
        max-width: 100%;
    }
    
    .chat-container.hidden {
        transform: translateX(-100%);
        visibility: hidden;
        position: absolute;
    }
    

    
    .content-area:has(.chat-container:not(.hidden)) .page-content {
        width: 100%;
    }
}

/* Chat History Modal */
.chat-history-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-history-modal.hidden {
    display: none;
}

.chat-history-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.chat-history-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background-color: var(--bg-primary);
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-history-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.chat-history-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chat-history-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: 0.375rem;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.chat-history-close-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.chat-history-search-container {
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    background-color: var(--bg-primary);
}

.chat-history-search-container .search-icon {
    position: absolute;
    left: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 1rem;
    height: 1rem;
    z-index: 1;
    pointer-events: none;
}

.chat-history-search {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
}

.chat-history-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-history-search::placeholder {
    color: var(--text-muted);
}

.chat-history-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    background-color: var(--bg-primary);
}

.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.chat-history-group {
    margin-bottom: 1rem;
}

.chat-history-date {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    padding: 0 0.25rem;
}

.chat-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: transparent;
    border: 1px solid transparent;
}

.chat-history-item:hover {
    background-color: var(--hover-bg);
    border-color: var(--border-color);
}

.chat-history-item:hover .chat-history-item-actions {
    opacity: 1;
}

.chat-history-item.current-chat {
    background-color: var(--hover-bg);
    border: 1px solid var(--border-color);
}

.chat-history-item.current-chat .chat-history-item-actions {
    opacity: 1;
}

.chat-history-item-content {
    flex: 1;
    min-width: 0;
    margin-right: 0.5rem;
}

.chat-history-item-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-history-item-preview {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.125rem;
    line-height: 1.2;
}

.chat-history-item-datetime {
    font-size: 0.625rem;
    color: var(--text-muted);
    opacity: 0.8;
    font-weight: 400;
    line-height: 1.1;
}

.chat-history-item-actions {
    display: flex;
    gap: 0.125rem;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    margin-left: 0.375rem;
    flex-shrink: 0;
}

.chat-history-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    border-radius: 0.25rem;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.chat-history-action-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.chat-history-action-btn.edit-btn:hover {
    color: #3b82f6;
    background-color: rgba(59, 130, 246, 0.1);
}

.chat-history-action-btn.delete-btn:hover {
    color: #ef4444;
    background-color: rgba(239, 68, 68, 0.1);
}

.chat-history-edit-input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
}

.chat-history-edit-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* Chat Error Messages */
.chat-error-message {
    margin: 0.5rem 0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

[data-theme="dark"] .chat-error-message {
    background-color: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

.chat-error-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0;
}

.typing-indicator span {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background-color: var(--text-muted);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-indicator span:nth-child(1) {
    animation-delay: -0.32s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive Design for Chat History Modal */
@media (max-width: 768px) {
    .chat-history-modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

/* Custom Confirmation Modal */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirmation-modal.hidden {
    display: none;
}

.confirmation-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.confirmation-modal-content {
    position: relative;
    width: 90%;
    max-width: 400px;
    background-color: var(--bg-primary);
    border-radius: 0.75rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.confirmation-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.confirmation-modal-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.confirmation-modal-header .warning-icon {
    color: #f59e0b;
}

.confirmation-modal-body {
    padding: 1.25rem;
    background-color: var(--bg-primary);
}

.confirmation-modal-message {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
    margin: 0;
}

.confirmation-modal-warning {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
    background-color: var(--warning-bg);
    border: 1px solid var(--warning-border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--warning-text);
}

.warning-icon-small {
    flex-shrink: 0;
    color: var(--warning-icon);
}

.confirmation-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-primary);
}

.confirmation-modal-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    min-width: 4rem;
}

.confirmation-modal-btn.cancel-btn {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.confirmation-modal-btn.cancel-btn:hover {
    background-color: var(--hover-bg);
    border-color: var(--text-muted);
}

.confirmation-modal-btn.confirm-btn {
    background-color: #ef4444;
    color: white;
    border: 1px solid #ef4444;
}

.confirmation-modal-btn.confirm-btn:hover {
    background-color: #dc2626;
    border-color: #dc2626;
}

.confirmation-modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive Design for Confirmation Modal */
@media (max-width: 768px) {
    .confirmation-modal-content {
        width: 95%;
        max-width: 350px;
    }
    
    .confirmation-modal-actions {
        flex-direction: column-reverse;
    }
    
    .confirmation-modal-btn {
        width: 100%;
    }
}

/* Toast Notification System */
.toast-container {
    position: fixed !important;
    bottom: 1rem !important;
    right: 1rem !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.5rem !important;
    pointer-events: none !important;
}

.toast {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.875rem 1rem !important;
    border-radius: 0.5rem !important;
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    min-width: 300px !important;
    max-width: 400px !important;
    opacity: 0 !important;
    transform: translateX(100%) !important;
    transition: all 0.3s ease-in-out !important;
    pointer-events: auto !important;
}

.toast.show {
    opacity: 1 !important;
    transform: translateX(0) !important;
}

.toast.success {
    border-left: 6px solid #10b981 !important;
}

.toast.error {
    border-left: 6px solid #ef4444 !important;
}

.toast.warning {
    border-left: 6px solid #f59e0b !important;
}

.toast.info {
    border-left: 6px solid #3b82f6 !important;
}

.toast-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.125rem;
    color: var(--text-primary);
}

.toast-message {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.toast-close i {
    width: 0.875rem;
    height: 0.875rem;
}

/* Responsive toast */
@media (max-width: 640px) {
    .toast-container {
        top: 0.5rem;
        right: 0.5rem;
        left: 0.5rem;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Agents Page Styles */
.agents-page {
    padding: 1.5rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

.agents-section {
    margin-bottom: 3rem;
}

.agents-section .section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.agent-card {
    position: relative;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.agent-settings-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.integration-settings-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.integration-settings-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.integration-settings-btn i {
    width: 0.75rem !important;
    height: 0.75rem !important;
}

.agent-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.agent-card.active {
    border-left: 4px solid #10b981;
}

.agent-card.available {
    border-left: 4px solid var(--accent-color);
    opacity: 0.8;
}

.agent-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #1A6DFF 0%, #C822FF 100%);
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.agent-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.agent-icon {
    width: 2rem;
    height: 2rem;
    color: white;
}

.fallback-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.agent-info {
    flex: 1;
    margin-bottom: 1rem;
}

.agent-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.agent-short-desc {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.agent-long-desc {
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.8rem; /* Ensure minimum height for visibility */
}

.credits-section {
    margin-bottom: 1.5rem;
}

.credits-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.credits-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.credits-usage {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 0.5rem;
    background-color: var(--bg-secondary);
    border-radius: 0.25rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1A6DFF 0%, #C822FF 100%);
    border-radius: 0.25rem;
    transition: width 0.3s ease-in-out;
    width: var(--progress-width, 0%);
}

.agent-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
}

.agent-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    flex: 1;
    border: none;
    cursor: pointer;
}

.agent-btn i {
    width: 1rem;
    height: 1rem;
}

.review-btn {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.review-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.chat-btn {
    background: linear-gradient(90deg, #314755 0%, #26a0da 100%);
    color: white;
}

.chat-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: white;
}

.hire-btn {
    background: linear-gradient(90deg, #1A6DFF 0%, #C822FF 100%);
    color: white;
    margin-left: auto;
    flex: 0 0 auto;
    min-width: 120px;
}

.hire-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    color: white;
}

/* Responsive Design for Agents Page */
@media (max-width: 768px) {
    .agents-grid {
        grid-template-columns: 1fr;
    }
    
    .agent-card {
        min-height: 250px;
    }
    
    .agent-actions {
        flex-direction: column;
    }
    
    .hire-btn {
        margin-left: 0;
        width: 100%;
    }
}

/* Customer Issues Page Styles */
.page-title {
    color: var(--text-primary);
}

.page-subtitle {
    color: var(--text-secondary);
}

/* Issues Table Styling */
.issues-table-container {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 2rem;
}

.issues-table {
    width: 100%;
    border-collapse: collapse;
}

.issues-table th,
.issues-table td {
    border-bottom: 1px solid var(--border-color);
}

.table-header {
    padding: 0.75rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    background-color: var(--bg-secondary);
}

.table-row {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.table-row:hover {
    background-color: var(--hover-bg);
}

.table-row.resolved-issue {
    color: var(--text-muted);
}

.table-cell {
    padding: 1rem 1.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.table-row.resolved-issue .table-cell {
    color: var(--text-muted);
}

/* Text styling */
.unassigned-text,
.empty-text {
    color: var(--text-muted);
}

/* Empty state styling */
.empty-state {
    padding: 3rem 1.5rem;
    text-align: center;
}

.empty-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    background-color: var(--bg-secondary);
}

.empty-icon i {
    color: var(--text-muted);
}

.empty-title {
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-message {
    color: var(--text-secondary);
}

/* Action buttons styling */
.action-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.view-button {
    color: var(--accent-color);
}

.view-button:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

.edit-button {
    color: var(--accent-color);
}

.edit-button:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

.close-button {
    color: var(--error-color);
}

.close-button:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

.connect-button {
    color: var(--text-secondary);
}

.connect-button:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

/* Category badge styling */
.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Status badge styling */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-open {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

[data-theme="dark"] .status-open {
    background-color: #450a0a;
    color: #fca5a5;
    border: 1px solid #7f1d1d;
}

.status-reopened {
    background-color: #fffbeb;
    color: #d97706;
    border: 1px solid #fed7aa;
}

[data-theme="dark"] .status-reopened {
    background-color: #451a03;
    color: #fbbf24;
    border: 1px solid #92400e;
}

.status-resolved {
    background-color: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}

[data-theme="dark"] .status-resolved {
    background-color: #052e16;
    color: #4ade80;
    border: 1px solid #166534;
}

.status-not-resolved {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.status-default {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Days open styling */
.days-open-today {
    color: #16a34a;
}

[data-theme="dark"] .days-open-today {
    color: #4ade80;
}

.days-open-recent {
    color: #d97706;
}

[data-theme="dark"] .days-open-recent {
    color: #fbbf24;
}

.days-open-week {
    color: #ea580c;
}

[data-theme="dark"] .days-open-week {
    color: #fb923c;
}

.days-open-old {
    color: #dc2626;
}

[data-theme="dark"] .days-open-old {
    color: #f87171;
}

/* Form styling */
.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-muted);
}

.form-select {
    appearance: none;
    padding-right: 2rem;
}

.select-icon {
    position: absolute;
    top: 50%;
    right: 0.5rem;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

.relative {
    position: relative;
}

/* Issue Details Page Styles */
.issue-section {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Editable Fields */
.editable-field {
    position: relative;
}

/* Inline editing in title */
.editable-field.inline-block {
    display: inline-block;
    position: relative;
}

.editable-field.inline-block .field-edit {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    padding: 0.75rem;
    min-width: 300px;
    margin-top: 0.25rem;
}

.editable-field.inline-block .field-display {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.editable-field.inline-block .edit-btn {
    opacity: 0.6;
    transition: opacity 0.2s ease-in-out;
}

.editable-field.inline-block:hover .edit-btn {
    opacity: 1;
}

.field-display {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: all 0.2s ease-in-out;
}

.field-display:hover {
    background-color: var(--hover-bg);
    border-color: var(--border-color);
}

.field-text {
    flex: 1;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
}

.edit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: 0.25rem;
    background-color: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
}

.edit-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.field-edit {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--bg-secondary);
}

.edit-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    resize: vertical;
}

.edit-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.edit-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* Detail Items */
.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-marker {
    position: absolute;
    left: -1.5rem;
    top: 0.25rem;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    background-color: var(--accent-color);
    border: 2px solid var(--bg-primary);
}

.timeline-content {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.timeline-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.timeline-type {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.timeline-message {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.timeline-comment {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: italic;
    padding: 0.5rem;
    background-color: var(--bg-primary);
    border-radius: 0.25rem;
    margin-top: 0.5rem;
}

/* Button Styles */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
}


/* Agent Settings Page Styles */
.agent-settings-page {
    padding: 0;
    margin: 0;
    max-width: 100%;
}

.settings-column {
    background: var(--bg-primary);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    height: fit-content;
}

.agent-image-column {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 0.5rem;
}

.agent-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.agent-settings-image {
    max-width: 80%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Title Section */
.title-section {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.agent-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 0.5rem 0;
}

.agent-subtitle {
    color: var(--text-secondary);
    margin: 0;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border-color);
    border-radius: 1.5rem;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background-color: white;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background-color: var(--accent-color);
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(1.5rem);
}

/* Section Headers */
.section-header {
    margin-bottom: 1rem;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-icon {
    color: var(--accent-color);
}

/* Subsections */
.subsection {
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.subsection-header {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.subsection-header:hover {
    background: var(--hover-bg);
}

.subsection-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0;
}

.chevron-icon {
    transition: transform 0.2s;
    color: var(--text-muted);
}

.subsection-content {
    padding: 1rem;
    max-height: 300px;
    overflow-y: auto;
}

/* Core Prompt Editor */
.core-prompt-editor,
.default-prompt-editor {
    margin-bottom: 1rem;
}

.prompt-display {
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
    min-height: 4rem;
    white-space: pre-line;
    word-wrap: break-word;
    display: flex;
    align-items: flex-start;
    margin: 0;
}

.prompt-display:hover {
    background: var(--hover-bg);
}

.prompt-edit {
    margin-top: 0.5rem;
}

.prompt-edit textarea,
.prompt-edit .form-control {
    min-height: 200px;
    height: auto;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.prompt-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Items Lists */
.subsection-actions {
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.items-list {
    max-height: 200px;
    overflow-y: auto;
}

.list-item {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    font-size: 0.75rem;
    overflow: hidden;
}

.list-item:hover {
    background: var(--hover-bg);
}

.item-icon {
    margin-right: 0.75rem;
    color: var(--accent-color);
    flex-shrink: 0;
}

.item-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-top: 0.25rem;
}

.item-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.item-description {
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.625rem;
    color: var(--text-muted);
}

.item-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}

.action-btn {
    padding: 0.25rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 0.25rem;
}

.action-btn:hover {
    color: var(--text-primary);
    background: var(--hover-bg);
}

/* Monitoring Section */
.monitoring-section {
    margin-bottom: 2rem;
}

.credits-section {
    margin-bottom: 1.5rem;
}

.add-credits-btn {
    margin-top: 0.5rem;
}

/* Chart Container */
.chart-container {
    margin-bottom: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
}

/* Timeline */
.timeline-section {
    margin-bottom: 1.5rem;
}

.timeline-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.timeline-container {
    max-height: 200px;
    overflow-y: auto;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    font-size: 0.75rem;
}

.timeline-marker {
    width: 0.5rem;
    height: 0.5rem;
    background: var(--accent-color);
    border-radius: 50%;
    margin-right: 0.75rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-time {
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.timeline-text {
    color: var(--text-primary);
}

/* Other Settings */
.other-settings-section {
    margin-bottom: 1.5rem;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-label {
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Temperature Slider */
.temperature-slider-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.temperature-slider {
    width: 100px;
    height: 0.25rem;
    background: var(--border-color);
    outline: none;
    border-radius: 0.125rem;
    -webkit-appearance: none;
}

.temperature-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 1rem;
    height: 1rem;
    background: var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
}

.temperature-slider::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    background: var(--accent-color);
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.temperature-value {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    min-width: 1.5rem;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .agent-settings-page {
        padding: 1rem;
    }
    
    .settings-column {
        padding: 1rem;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-6 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .agent-image-column {
        order: -1;
    }
    
    .agent-settings-image {
        max-width: 200px;
    }
}

/* Credentials Page Styles */
.credentials-page {
    padding: 2rem 1rem;
}

.credentials-header {
    text-align: left;
    margin-bottom: 2rem;
}

.credentials-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.credentials-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.integrations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.integration-card {
    position: relative;
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    transition: all 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    min-height: 220px;
}

.integration-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.integration-card.active {
    border-left: 4px solid var(--success-color, #10b981);
}

.integration-card.available {
    border-left: 4px solid var(--accent-color);
    opacity: 0.8;
}

.integration-icon {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 0.75rem;
}

.integration-icon i {
    width: 2rem;
    height: 2rem;
    color: var(--text-primary);
    font-size: 2rem;
}

.integration-info {
    flex: 1;
    margin-bottom: 0.75rem;
}

.integration-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text-primary);
}

.integration-description {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.1rem;
}



.integration-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    align-items: center;
}

.integration-status-text {
    color: var(--success-color, #10b981);
    font-weight: 500;
    font-size: 0.875rem;
}



/* Responsive Design for Integrations */
@media (max-width: 768px) {
    .integrations-grid {
        grid-template-columns: 1fr;
    }
    
    .integration-card {
        min-height: 200px;
    }
}

/* CSS Variables for credentials page */
:root {
    --success-color: #10b981;
}

/* Section styling */
.integrations-section {
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

/* Integration type styling (for active integrations) */
.integration-type {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.25rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Integration add button positioning */
.integration-add-btn {
    position: absolute !important;
    top: 1rem !important;
    right: 50px !important;
    background: var(--accent-color) !important;
    color: white !important;
    border: none !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
}

.integration-add-btn:hover {
    background: var(--accent-hover) !important;
    transform: scale(1.1) !important;
}

.integration-add-btn i {
    font-size: 16px !important;
    width: auto !important;
    height: auto !important;
}

/* New Integration Page Styles */
.new-integration-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.new-integration-header {
    text-align: center;
    margin-bottom: 2rem;
}

.new-integration-header .integration-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.new-integration-header .integration-icon i {
    width: 3rem;
    height: 3rem;
    color: var(--accent-color);
    font-size: 3rem;
}

.integration-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.integration-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.integration-form-container {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.integration-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.required {
    color: var(--error-color);
    margin-left: 0.25rem;
}

.form-input {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

.info-note {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-accent);
    border: 1px solid var(--bg-accent-dark);
    border-radius: 0.5rem;
    color: var(--text-primary);
}

.info-note i {
    color: var(--accent-color);
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.info-note span {
    font-size: 0.875rem;
    line-height: 1.5;
}

.info-note.warning {
    background-color: rgba(251, 191, 36, 0.1);
    border-color: #f59e0b;
    color: var(--text-primary);
}

.info-note.warning i {
    color: #f59e0b;
}

.info-note.warning div {
    font-size: 0.875rem;
    line-height: 1.5;
}

.info-note.warning ol {
    margin: 0.5rem 0 0 1rem;
    padding-left: 1rem;
}

.info-note.warning li {
    margin-bottom: 0.25rem;
}

/* Form validation error styling */
.form-input.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.field-error {
    color: var(--error-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.cancel-btn {
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: transparent;
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.cancel-btn:hover {
    background-color: var(--hover-bg);
    border-color: var(--text-muted);
}

.connect-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    background: linear-gradient(90deg, #1A6DFF 0%, #C822FF 100%);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.connect-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.connect-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.connect-btn i {
    width: 1rem;
    height: 1rem;
}

/* Responsive Design for New Integration Page */
@media (max-width: 768px) {
    .new-integration-page {
        padding: 1rem;
    }
    
    .integration-form-container {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .cancel-btn,
    .connect-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Custom Checkbox Styles */
.custom-checkbox {
    position: relative;
    display: inline-block;
    cursor: pointer;
    width: 18px; /* Fixed width for checkbox */
    height: 18px; /* Fixed height for checkbox */
    flex-shrink: 0; /* Don't shrink */
}

.custom-checkbox input[type="checkbox"] {
    opacity: 0;
    position: absolute;
    width: 0;
    height: 0;
}

.custom-checkbox .checkmark {
    position: relative;
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

.custom-checkbox:hover .checkmark {
    border-color: var(--accent-color);
    background-color: var(--hover-bg);
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.custom-checkbox input[type="checkbox"]:checked + .checkmark:after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input[type="checkbox"]:focus + .checkmark {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Connect Agent Modal Specific Styling */
#connectAgentModal .chat-history-modal-content {
    width: 90%;
    max-width: 500px; /* Wider than default 600px but appropriate for this modal */
    min-width: 400px; /* Ensure minimum width */
}

/* Connect Knowledge Modal Specific Styling */
#connectKnowledgeModal .chat-history-modal-content {
    width: 95%;
    max-width: 800px; /* Much wider for knowledge items */
    min-width: 600px; /* Ensure minimum width */
}

/* Knowledge List Container */
.knowledge-list-container {
    max-height: 20rem;
    overflow-y: auto;
    padding: 0.25rem;
    margin-bottom: 1rem;
}

/* Knowledge List Item Styles */
.knowledge-list-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    margin-bottom: 4px;
}

.knowledge-list-item:hover {
    background-color: var(--bg-hover);
    border-color: var(--accent-color);
}

.knowledge-name {
    font-weight: normal;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin: 0;
    cursor: pointer;
}

/* Knowledge search container and styling */
.knowledge-search-container {
    position: relative;
    margin-bottom: 1rem;
}

.knowledge-search {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    box-sizing: border-box;
}

.knowledge-search:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.knowledge-search::placeholder {
    color: var(--text-muted);
}

#connectAgentModal .chat-history-content {
    padding: 1rem; /* Add padding to modal content */
}

/* Agent List Container */
.agent-list-container {
    max-height: 16rem;
    overflow-y: auto;
    padding: 0.5rem; /* Increased padding for better spacing */
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-secondary);
}

/* Agent List Item Styles */
.agent-list-item {
    display: flex;
    align-items: center;
    gap: 8px; /* Slightly increased for better spacing */
    padding: 6px; /* Reduced padding */
    border-radius: 4px; /* Smaller radius */
    border: 1px solid var(--border-color);
    background-color: var(--bg-primary);
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    margin-bottom: 4px; /* Tighter spacing between items */
}

.agent-list-item:hover {
    background-color: var(--hover-bg);
    border-color: var(--accent-color);
}

.agent-list-item.selected {
    background-color: var(--bg-accent);
    border-color: var(--accent-color);
}


.agent-name {
    font-weight: normal;
    color: var(--text-primary);
    font-size: 0.875rem;
    margin: 0; /* Remove any margins */
    cursor: pointer;
}

/* Knowledge Base Styles */
.knowledge-table-container {
    background: var(--bg-primary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.knowledge-table {
    width: 100%;
    border-collapse: collapse;
}

.knowledge-table th,
.knowledge-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.knowledge-type-badge {
    display: inline-block;
    padding: 4px 8px;
    background: var(--accent-color);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.knowledge-subtype-badge {
    display: inline-block;
    padding: 4px 8px;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Knowledge table additional styles */

.category-text {
    color: var(--text-primary);
    font-weight: 500;
}

.small-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-avatar-sm {
    position: relative;
    cursor: pointer;
}

.agent-avatar-sm:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.owner-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Agent Avatars Container - Overlapping Layout */
.agent-avatars-container {
    display: flex;
    align-items: center;
    position: relative;
}

.agent-avatar-overlapping {
    position: relative;
    cursor: pointer;
    margin-left: -8px; /* Overlap by 8px */
    z-index: 1;
    transition: z-index 0.2s ease;
}

.agent-avatar-overlapping:first-child {
    margin-left: 0; /* First avatar has no left margin */
}

.agent-avatar-overlapping:hover {
    z-index: 10; /* Bring to front on hover */
}

.agent-avatar-img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.agent-avatar-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 2px solid var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.agent-connect-plus {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: var(--bg-secondary);
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    margin-left: -8px;
    transition: all 0.2s ease;
    z-index: 1;
}

.agent-connect-plus:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    z-index: 10;
    transform: scale(1.1);
}

.agent-avatar-overlapping:hover::after,
.agent-connect-plus:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 20;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 4px;
}

/* Knowledge table column constraints */
.knowledge-table td[style*="max-width"] {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.knowledge-table td[style*="max-width"] .small-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

/* ============================================================================
   BOOTSTRAP OFFCANVAS OVERRIDE STYLES
   ============================================================================ */

/* Override Bootstrap offcanvas styling to match theme */
.offcanvas {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border-left: 1px solid var(--border-color) !important;
    font-family: 'Geist', 'Geist Sans', 'Poppins', Verdana, Geneva, Tahoma, Arial, sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}

.offcanvas-header {
    background-color: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-color) !important;
    height: var(--navbar-height) !important; /* 64px - same as navbar */
    min-height: var(--navbar-height) !important;
    max-height: var(--navbar-height) !important;
    display: flex !important;
    align-items: center !important;
    padding: 0 1rem !important;
}

.offcanvas-body {
    background-color: var(--bg-primary) !important;
    font-family: 'Geist', 'Geist Sans', 'Poppins', Verdana, Geneva, Tahoma, Arial, sans-serif !important;
    font-size: 1rem !important;
    line-height: 1.5 !important;
}


/* Offcanvas close button styling */
.offcanvas-close-btn {
    background: none !important;
    border: none !important;
    padding: 0.5rem !important;
    cursor: pointer !important;
    color: var(--text-primary) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 0.375rem !important;
    transition: all 0.2s ease-in-out !important;
    margin-left: auto !important; /* Right-align the button */
}

.offcanvas-close-btn:hover {
    background-color: var(--hover-bg) !important;
    color: var(--text-primary) !important;
}

.offcanvas-close-btn i {
    width: 1.25rem !important;
    height: 1.25rem !important;
}

/* Offcanvas title styling */
.offcanvas-header h5 {
    color: var(--text-primary) !important;
    font-family: 'Geist', 'Geist Sans', 'Poppins', Verdana, Geneva, Tahoma, Arial, sans-serif !important;
    font-size: 1.125rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    line-height: 1.5 !important;
}

/* Dark mode specific overrides */
[data-theme="dark"] .offcanvas {
    background-color: var(--bg-primary) !important;
    color: var(--text-primary) !important;
}

[data-theme="dark"] .offcanvas-header {
    background-color: var(--bg-primary) !important;
    border-bottom-color: var(--border-color) !important;
}

[data-theme="dark"] .offcanvas-body {
    background-color: var(--bg-primary) !important;
}


[data-theme="dark"] .offcanvas-header h5 {
    color: var(--text-primary) !important;
}

/* ============================================================================
   PROMPT MANAGEMENT STYLES
   ============================================================================ */

.prompt-list-item {
    display: flex;
    align-items: flex-start;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.prompt-list-item:hover {
    background-color: var(--hover-bg);
}

.prompt-content {
    flex: 1;
    margin-left: 0.75rem;
}

.prompt-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.prompt-preview {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.prompt-meta {
    display: flex;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.prompt-type,

/* Notification Dropdown Styles */
.notification-dropdown {
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.notification-header {
    border-bottom: 1px solid var(--border-color);
}

.notification-title {
    color: var(--text-primary);
}

.notification-mark-all-btn {
    color: var(--accent-color);
}

.notification-mark-all-btn:hover {
    color: var(--accent-hover-color);
}

.notification-empty {
    color: var(--text-muted);
}

.notification-item {
    border-bottom: 1px solid var(--border-light);
}

.notification-item:hover {
    background-color: var(--hover-bg);
}

.notification-indicator {
    background-color: var(--accent-color);
}

.notification-text {
    color: var(--text-primary);
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.notification-text a {
    color: var(--accent-color);
    text-decoration: underline;
    cursor: pointer;
}

.notification-text a:hover {
    color: var(--accent-hover-color);
    text-decoration: none;
}

.notification-time {
    color: var(--text-muted);
}

.prompt-type,
.prompt-category {
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    background-color: var(--bg-secondary);
    color: var(--text-muted);
}

/* Tag styling */
.tag {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 500;
    border-radius: 0.25rem;
    line-height: 1.2;
    white-space: nowrap;
}




