/* Basic Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Light theme colors */
    --color-text-primary: #1F2936;
    --color-text-secondary: #64748b;
    --color-text-placeholder: #94a3b8;
    --color-bg-primary: #f8fafc;
    --color-bg-secondary: #e2e8f0;
    --color-bg-sidebar: #ffffff;
    --color-bg-sidebar-header: #94a3b8;
    --color-bg-chat: #f8fafc;
    --color-bg-right-panel: #f8fafc;
    --color-bg-card: #ffffff;
    --color-border: #e2e8f0;
    --color-border-sidebar: #e2e8f0;
    --color-accent: #0057B8; /* Bayer Blue */
    --color-accent-secondary: #0073e6; /* Slightly lighter Bayer Blue */
    --color-hover: #f1f5f9;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --color-sidebar-text: #334155;
    --color-sidebar-text-secondary: #64748b;
    --color-sidebar-nav-hover: #f1f5f9;
    
    /* Spacing system */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 16px;
    --spacing-xl: 20px;
    --spacing-2xl: 24px;
    --spacing-3xl: 32px;
    
    /* Border radius system */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50%;
    
    /* Typography scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-dynamic: clamp(0.75rem, 2vw, 1.25rem);
    --spacing-dynamic: clamp(8px, 2vw, 24px);
    --sidebar-width-dynamic: clamp(200px, 25vw, 270px);
    --font-responsive: clamp(0.875rem, 2.5vw, 1.125rem);
    --padding-responsive: clamp(12px, 3vw, 24px);
    --icon-size: clamp(32px, 6vw, 48px);

    /* ADD THESE DYNAMIC SCALING VARIABLES */
    --text-dynamic: clamp(0.75rem, 2vw, 1.25rem);
    --spacing-dynamic: clamp(8px, 2vw, 24px);
    --sidebar-width-dynamic: clamp(200px, 25vw, 270px);
    --font-responsive: clamp(0.875rem, 2.5vw, 1.125rem);
    --padding-responsive: clamp(12px, 3vw, 24px);
    --icon-size: clamp(32px, 6vw, 48px);
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.4s ease;
}

body.dark-theme {
    /* Dark theme colors */
    --color-text-primary: #F1F5F9;
    --color-text-secondary: #cbd5e1;
    --color-text-placeholder: #94a3b8;
    --color-bg-primary: #0f172a;
    --color-bg-secondary: #1e293b;
    --color-bg-sidebar: #151A2D;
    --color-bg-sidebar-header: #1e293b;
    --color-bg-chat: #0f172a;
    --color-bg-right-panel: #0f172a;
    --color-bg-card: #1e293b;
    --color-border: #334155;
    --color-border-sidebar: rgba(255, 255, 255, 0.1);
    --color-accent: #0057B8; /* Bayer Blue */
    --color-accent-secondary: #0073e6; /* Slightly lighter Bayer Blue */
    --color-hover: #1e293b;
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-sidebar-text: #F1F4FF;
    --color-sidebar-text-secondary: #F1F4FF;
    --color-sidebar-nav-hover: #003366;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Flex Utilities */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.gap-xs { gap: var(--spacing-xs); }
.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

/* Spacing Utilities */
.p-xs { padding: var(--spacing-xs); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

.px-xs { padding-left: var(--spacing-xs); padding-right: var(--spacing-xs); }
.px-sm { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-md { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.px-lg { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }
.px-xl { padding-left: var(--spacing-xl); padding-right: var(--spacing-xl); }

.py-xs { padding-top: var(--spacing-xs); padding-bottom: var(--spacing-xs); }
.py-sm { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-md { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-lg { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
.py-xl { padding-top: var(--spacing-xl); padding-bottom: var(--spacing-xl); }

.m-xs { margin: var(--spacing-xs); }
.m-sm { margin: var(--spacing-sm); }
.m-md { margin: var(--spacing-md); }
.m-lg { margin: var(--spacing-lg); }
.m-xl { margin: var(--spacing-xl); }

.mx-auto { margin-left: auto; margin-right: auto; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* Position & Layout Utilities */
.relative { position: relative; }
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Display Utilities */
.hidden { display: none !important; }

/* ========================================
   BASE STYLES
   ======================================== */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* ========================================
   COMPONENTS
   ======================================== */

/* Loading Spinner */
.spinner {
    display: inline-block;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--color-accent);
    border-radius: var(--radius-full);
    width: 12px;
    height: 12px;
    animation: spin 1s linear infinite;
    margin-left: var(--spacing-xs);
    vertical-align: middle;
}

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

/* ========================================
   LAYOUT
   ======================================== */

.app-container {
    display: grid;
    /* UPDATED FOR BETTER RIGHT PANEL EXPANSION ON LARGE SCREENS */
    grid-template-columns: minmax(200px, 270px) minmax(300px, 1fr) minmax(0, 50vw);
    grid-template-rows: 1fr;
    grid-template-areas: "sidebar chat right";
    width: 100%;
    height: 100vh;
    background-color: var(--color-bg-card);
    overflow: hidden;
    transition: grid-template-columns 0.3s ease;
    position: relative;
    min-width: 320px;
}

/* Improved responsive behavior for collapsed sidebar */
.app-container.sidebar-collapsed {
    grid-template-columns: minmax(85px, 85px) minmax(280px, 1fr) minmax(0, 35vw);
}

/* Large screens - allow right panel to expand more */
@media (min-width: 1600px) {
    .app-container {
        grid-template-columns: clamp(270px, 16vw, 320px) 1fr clamp(400px, 45vw, 800px);
    }
    .app-container.sidebar-collapsed {
        grid-template-columns: 85px 1fr clamp(450px, 50vw, 900px);
    }
}

/* Ultra-wide screens - maximize space usage */
@media (min-width: 1920px) {
    .app-container {
        grid-template-columns: 320px 1fr minmax(500px, 50vw);
    }
    .app-container.sidebar-collapsed {
        grid-template-columns: 85px 1fr minmax(600px, 55vw);
    }
}

/* Better breakpoints for different screen sizes */
@media (max-width: 1400px) {
    .app-container {
        grid-template-columns: 270px 1fr 35vw; /* Smaller right panel on medium screens */
    }
    .app-container.sidebar-collapsed {
        grid-template-columns: 85px 1fr 30vw; /* Even more space for chat */
    }
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: 270px 1fr 350px; /* Fixed width right panel */
    }
    .app-container.sidebar-collapsed {
        grid-template-columns: 85px 1fr 300px;
    }
}

/* Enhanced mobile responsiveness */
@media (max-width: 768px) {
    .app-container {
        grid-template-columns: 1fr; /* Single column on mobile */
        grid-template-areas: "chat";
    }
    
    .app-container.sidebar-collapsed {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        position: fixed;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar:not(.collapsed) {
        transform: translateX(0);
    }
    
    .right-panel {
        display: none; /* Hide right panel on mobile */
    }
    
    .chatbox {
        padding: 20px; /* Reduced padding on mobile */
    }
    
    .message {
        margin-bottom: 20px; /* Reduced spacing on mobile */
        gap: 12px; /* Reduced gap on mobile */
    }
    
    .user-message {
        max-width: 100%; /* Full width on mobile */
    }
    
    .agent-message {
        max-width: 100%; /* Full width on mobile */
    }
    
    .user-icon, .agent-icon {
        width: 40px; /* Slightly smaller icons on mobile */
        height: 40px;
        font-size: 1.1em;
    }
    
    .message-content {
        font-size: 1rem; /* Slightly smaller font on mobile */
        padding: 18px 22px; /* Reduced padding on mobile */
    }
    
    .user-message .message-content,
    .agent-message .message-content {
        padding: 18px 22px; /* Consistent reduced padding */
        font-size: 1rem;
    }
    
    /* Enhanced mobile responsiveness for input area */
    .input-area {
        padding: 16px 16px;
        min-height: 76px;
    }
    
    #userInput {
        font-size: clamp(0.875rem, 2vw, 1rem);
        padding: clamp(12px, 2vw, 16px);
        min-height: clamp(44px, 8vw, 48px);
        max-height: clamp(80px, 15vh, 120px);
        border-radius: clamp(20px, 3vw, 24px);
    }
    
    .chatbox {
        max-height: calc(100vh - 152px); /* Adjusted for mobile header and input */
        padding: 20px 16px;
    }
}

@media (max-width: 1200px) {
    .app-container {
        grid-template-columns: minmax(250px, 270px) 1fr 350px;
        min-width: 800px; /* Prevent over-compression */
    }
    
    .sidebar {
        width: clamp(250px, 30vw, 270px);
    }
}

/* Large mobile/small tablet */
@media (max-width: 900px) {
    .message-content {
        padding: clamp(12px, 3vw, 18px);
        font-size: clamp(0.875rem, 3vw, 1rem);
    }
    
    .user-icon, .agent-icon {
        width: clamp(40px, 8vw, 48px);
        height: clamp(40px, 8vw, 48px);
    }
}

/* Mobile - keep your existing mobile styles but add constraints */
@media (max-width: 768px) {
    /* ...your existing mobile styles... */
    
    /* ADD THESE LINES TO YOUR EXISTING MOBILE SECTION */
    .app-container {
        min-width: 320px; /* Prevent breaking on very small screens */
    }
    
    .message-content {
        font-size: clamp(0.875rem, 4vw, 1rem);
        padding: clamp(14px, 4vw, 20px);
    }
}

/* Extra small mobile */
@media (max-width: 480px) {
    .chatbox {
        padding: clamp(16px, 4vw, 20px);
    }
    
    .input-area {
        padding: clamp(12px, 3vw, 16px);
    }
    
    #userInput {
        font-size: clamp(14px, 4vw, 16px);
        padding: clamp(8px, 2vw, 12px);
    }
}

/* Extreme small - horizontal scroll fallback */
@media (max-width: 320px) {
    .app-container {
        min-width: 320px;
        overflow-x: auto;
    }
    
    body {
        min-width: 320px;
    }
}

/* ========================================
   SIDEBAR STYLES
   ======================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10;
    width: clamp(200px, 25vw, 270px);
    height: 100vh;
    background: var(--color-bg-sidebar);
    transition: all 0.4s ease;
    grid-area: sidebar;
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: 85px;
}

.sidebar .sidebar-header {
    display: flex;
    position: relative;
    padding: 25px 20px;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
}

.sidebar-header .header-logo img {
    width: 46px;
    height: 46px;
    display: block;
    object-fit: contain;
    border-radius: 50%;
}

.sidebar-header .sidebar-toggler,
.sidebar-menu-button {
    position: absolute;
    right: var(--spacing-xl);
    height: 35px;
    width: 35px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--color-sidebar-nav-hover);
    color: var(--color-sidebar-text);
    transition: all var(--transition-slow);
}

.sidebar.collapsed .sidebar-header .sidebar-toggler {
    transform: translate(-4px, 65px);
}

.sidebar-header .sidebar-toggler i,
.sidebar-menu-button i {
    font-size: 1.2rem;
    transition: all var(--transition-slow);
    color: inherit;
}

body.dark-theme .sidebar-header .sidebar-toggler,
body.dark-theme .sidebar-menu-button {
    color: var(--color-sidebar-text);
    background: var(--color-sidebar-nav-hover);
}

.sidebar.collapsed .sidebar-header .sidebar-toggler i {
    transform: rotate(180deg);
}

.sidebar-header .sidebar-toggler:hover,
.sidebar-menu-button:hover {
    background: var(--color-hover);
    color: var(--color-accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Sidebar User Profile Section */
.sidebar-user-profile {
    padding: 0 15px;
    margin-top: 15px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--color-bg-sidebar);
    transition: all 0.3s ease;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    background: transparent;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.4s ease;
    color: var(--color-text-primary);
    white-space: nowrap;
}

.sidebar-user-info:hover {
    background: var(--color-sidebar-nav-hover);
}

.sidebar.collapsed .sidebar-user-profile {
    padding: 0 15px;
    align-items: center;
    margin-top: 75px; /* Push down when collapsed to avoid overlap with toggle button */
}

.sidebar.collapsed .sidebar-user-info {
    padding: 11px 15px;
    justify-content: center;
    border-radius: 8px;
}

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

.sidebar-user-info .fa-user-circle {
    color: var(--color-accent);
    font-size: 1em;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.sidebar-user-name {
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.sidebar-logout-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    background: transparent;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.4s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.sidebar-logout-btn:hover {
    background: var(--color-sidebar-nav-hover);
    color: var(--color-accent);
}

.sidebar-logout-btn i {
    color: #ef4444;
    font-size: 1em;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.sidebar-logout-btn .logout-text {
    color: var(--color-text-secondary);
    font-weight: 600;
    font-size: 1rem;
}

.sidebar.collapsed .sidebar-logout-btn span,
.sidebar.collapsed .sidebar-login-btn span {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-login-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 15px;
    background: var(--color-accent);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.4s ease;
    border: 1px solid transparent;
    white-space: nowrap;
}

.sidebar-login-btn:hover {
    background: var(--color-accent-secondary);
    color: white;
}

.sidebar-login-btn i {
    flex-shrink: 0;
    width: 20px;
    text-align: center;
    font-size: 1em;
}

.sidebar-login-btn .login-text {
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.sidebar.collapsed .sidebar-login-btn,
.sidebar.collapsed .sidebar-logout-btn {
    padding: 11px 15px;
    justify-content: center;
}

.sidebar-nav .nav-list {
    list-style: none;
    display: flex;
    gap: clamp(6px, 1vw, 10px); /* Increased gap to prevent overlapping */
    padding: 0 15px;
    flex-direction: column;
    transform: translateY(15px);
    transition: 0.4s ease;
}

.sidebar .sidebar-nav .primary-nav {
    overflow-y: auto;
    scrollbar-width: 6px;
    padding-bottom: 20px;
    height: calc(100vh - 320px);
    scrollbar-color: transparent transparent;
}

.sidebar .sidebar-nav .primary-nav:hover {
    scrollbar-color: #EEF2FF transparent;
}

.sidebar.collapsed .sidebar-nav .primary-nav {
    overflow: unset;
    transform: translateY(65px);
}

.sidebar-nav .nav-item .nav-link {
    color: var(--color-text-primary);
    display: flex;
    gap: 12px;
    white-space: nowrap;
    border-radius: 8px;
    padding: clamp(10px, 2vw, 14px) 15px; /* Responsive padding for better spacing */
    align-items: center;
    text-decoration: none;
    border: 1px solid transparent;
    transition: 0.4s ease;
    min-height: clamp(40px, 6vh, 48px); /* Ensure minimum height to prevent overlap */
}

.sidebar-nav .nav-item:is(:hover, .open) > .nav-link:not(.dropdown-title) {
    color: var(--color-accent); 
    background: var(--color-sidebar-nav-hover);
}

body.dark-theme .sidebar-nav .nav-item:is(:hover, .open) > .nav-link:not(.dropdown-title) {
    color: var(--color-accent); 
}

.sidebar-nav .nav-item:is(:hover, .open) > .nav-link.dropdown-title {
    color: var(--color-bg-sidebar);
    background: var(--color-sidebar-nav-hover);
}

.sidebar .nav-link .nav-label {
    transition: opacity 0.3s ease;
    border: none;
    font-weight: 600;
    font-size: 1rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}




/* Hide nav-label and dropdown-icon text when sidebar is collapsed */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .dropdown-icon {
    opacity: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, width 0.3s ease;
    overflow: hidden;
    display: inline-block;
    transform: translateX(-20px);
}

/* Hide nav labels and theme toggle track when collapsed */
.sidebar.collapsed .nav-label,
.sidebar.collapsed .theme-toggle-track {
    opacity: 0 !important;
    width: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.3s ease, width 0.3s ease;
    overflow: hidden;
}

/* Ensure icons remain visible and properly positioned when collapsed */
.sidebar.collapsed .nav-link i {
    opacity: 1 !important;
    transform: translateX(0) !important;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Adjust theme icon position when collapsed */
.sidebar.collapsed .theme-toggle .theme-icon {
    transform: translateX(-4px);
}

/* Hide dropdown menus by default when sidebar is collapsed */
.sidebar.collapsed .dropdown-menu {
    display: none !important;
}

/* Show dropdown menus on hover when sidebar is collapsed */
.sidebar.collapsed .nav-item:hover .dropdown-menu {
    display: block !important;
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 200px;
    background: var(--color-bg-sidebar);
    border: 1px solid var(--color-border-sidebar);
    border-radius: 8px;
    box-shadow: 0 4px 16px var(--color-shadow);
    z-index: 1000;
    opacity: 1;
    pointer-events: auto;
    margin-left: 10px;
}

/* Ensure collapsed sidebar maintains proper width */
.sidebar.collapsed {
    width: 85px !important;
}

/* Ensure nav links in collapsed sidebar center the icons */
.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 11px 15px;
}

.sidebar.collapsed .nav-link .dropdown-icon {
    transition: opacity 0.3s 0s ease;
}

.sidebar-nav .secondary-nav {
    position: absolute;
    bottom: 35px;
    width: 100%;
    background: var(--sidebar-bg);
    gap: 0;
    padding-top: 10px; /* Add padding at top to prevent overlap */
}

.sidebar-nav .nav-item {
    position: relative;
}
.sidebar-nav .secondary-nav .nav-item .nav-link {
    /* MAKE ITEMS MORE COMPACT */
    padding: 8px 15px; /* Reduced from clamp(10px, 2vw, 14px) 15px */
    min-height: 40px; /* Reduced from clamp(40px, 6vh, 48px) */
}
/* Dropdown Stylings */
.sidebar-nav .dropdown-container .dropdown-icon {
    margin: 0 -4px 0 auto;
    transition: transform var(--transition-slow), opacity 0.3s 0.2s ease, color var(--transition-base);
    color: var(--color-text-secondary);
}

.sidebar-nav .dropdown-container.open .dropdown-icon {
    transform: rotate(180deg);
    height: auto;
    max-height: calc(100vh - 450px); /* Prevent overlap with secondary nav */
    overflow-y: auto;
}

/* Dropdown icon color states */
.sidebar-nav .nav-item:hover .dropdown-icon,
.sidebar-nav .nav-item.open .dropdown-icon {
    color: var(--color-accent);
}

/* Dark theme dropdown icon colors */
body.dark-theme .sidebar-nav .dropdown-container .dropdown-icon {
    color: var(--color-text-secondary);
}

body.dark-theme .sidebar-nav .nav-item:hover .dropdown-icon,
body.dark-theme .sidebar-nav .nav-item.open .dropdown-icon {
    color: var(--color-accent);
}

.sidebar-nav .dropdown-menu {
    height: 0;
    overflow-y: hidden;
    list-style: none;
    padding-left: 15px;
    transition: height 0.4s ease;
    max-height: calc(100vh - 400px);
}

.sidebar.collapsed .dropdown-menu {
    position: sticky;
    top: -10px;
    left: 100%;
    opacity: 0;
    height: auto !important;
    padding-right: 10px;
    overflow-y: unset;
    pointer-events: none;
    border-radius: 0 10px 10px 0;
    background: #151A2D;
    transition: 0s;
}

.sidebar.collapsed .dropdown-menu:has(.dropdown-link) {
    padding: 7px 10px 7px 24px;
}

.sidebar.collapsed .nav-item:hover > .dropdown-menu {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(12px);
    transition: all 0.4s ease;
}

.sidebar.collapsed .nav-item:hover > .dropdown-menu:has(.dropdown-link) {
    transform: translateY(10px);
}

.dropdown-menu .nav-item .nav-link {
    color: var(--color-sidebar-text-secondary);
    padding: 9px 15px;
}

.sidebar.collapsed .dropdown-menu .nav-link {
    padding: 7px 15px;
}

.dropdown-menu .nav-item .nav-link.dropdown-title {
    display: none;
    color: var(--color-sidebar-text);
    padding: 9px 15px;
}

.dropdown-menu:has(.dropdown-link) .nav-item .dropdown-title {
    font-weight: 500;
    padding: 7px 15px;
}

.sidebar.collapsed .dropdown-menu .nav-item .dropdown-title {
    display: block;
}

.sidebar-menu-button {
    display: none;
}

/* Dropdown Selector Styles */
.dropdown-selector {
    padding: 4px 15px 8px 15px;
    color: var(--color-sidebar-text-secondary);
}

.dropdown-selector label {
    display: block;
    color: var(--color-sidebar-text-secondary);
    font-size: 0.9em;
    margin-bottom: 5px;
}

.dropdown-selector select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--color-border-sidebar);
    border-radius: 4px;
    background-color: var(--color-bg-secondary);
    color: var(--color-sidebar-text);
    font-size: 0.9em;
}

.dropdown-selector select:focus {
    outline: none;
    border-color: var(--color-accent);
}

/* Environment Toggle Styles */
.environment-toggle-container {
    padding: 8px 15px;
}

.environment-toggle {
    display: flex;
    gap: 8px;
    background-color: var(--color-bg-secondary);
    border-radius: 8px;
    padding: 4px;
}

.env-option {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background-color: transparent;
    color: var(--color-sidebar-text-secondary);
    font-size: 0.85em;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
}

.env-option:hover {
    background-color: var(--color-hover);
}

.env-option.active {
    background-color: var(--color-bg-card);
    color: var(--color-text-primary);
    box-shadow: var(--shadow-sm);
}

.env-option i {
    font-size: 0.9em;
}

.env-prod.active {
    color: #10b981; /* Green for production */
}

.env-qa.active {
    color: #f59e0b; /* Amber for QA */
}

/* Edit Config Button Container */
.edit-config-container {
    display: flex;
    justify-content: flex-end;
    padding: var(--spacing-sm) var(--spacing-lg) 0 var(--spacing-lg);
}

/* Edit Config Button - Fully integrated with utility classes */
.edit-config-btn {
    /* Base button styles */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-size: 0.85em;
    text-decoration: none;
    transition: all var(--transition-base);
    user-select: none;
    position: relative;
    
    /* Primary button colors */
    background: var(--color-accent);
    color: white;
    box-shadow: var(--shadow-sm);
}

.edit-config-btn:hover {
    background-color: var(--color-accent-secondary);
    box-shadow: var(--shadow-md);
}

.edit-config-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Tooltip styling for the edit button - REMOVED */
/*
.edit-config-btn:hover::after {
    content: attr(title);
    position: absolute;
    top: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: var(--text-xs);
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
}

.edit-config-btn:hover::before {
    content: '';
    position: absolute;
    top: 110%;
    left: 50%;
    transform: translateX(-50%);
    border: var(--spacing-xs) solid transparent;
    border-bottom-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    pointer-events: none;
}
*/


/* Chat History Container */
.chat-history-container {
    max-height: 250px;
    overflow-y: auto;
    padding: 0 15px;
    margin-bottom: 10px;
}

.sidebar-nav .dropdown-container.open .dropdown-menu {
    height: auto;
    max-height: calc(100vh - 500px); /* Prevent overlap with secondary nav */
    overflow-y: auto;
}

.chat-history-container ul {
    list-style: none;
    padding: 0;
}

.chat-history-container li {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--color-sidebar-text-secondary);
    transition: background-color 0.3s ease;
}

.chat-history-container li:hover {
    background-color: var(--color-hover);
}

/* Add active session styling */
.chat-history-container li.active-session {
    background-color: var(--color-accent);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 87, 184, 0.2);
    border: 1px solid var(--color-accent);
}

.chat-history-container li.active-session a {
    color: white !important;
    font-weight: 500;
}

.chat-history-container li.active-session span {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Ensure active session styling overrides hover */
.chat-history-container li.active-session:hover {
    background-color: var(--color-accent-secondary);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 87, 184, 0.3);
}

.chat-history-container li a {
    text-decoration: none;
    color: var(--color-sidebar-text-secondary);
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.chat-history-container li span {
    font-size: 0.8em;
    color: var(--color-text-placeholder);
    white-space: nowrap;
}

/* Responsive media query code for small screens */
@media (max-width: 768px) {
    .sidebar-menu-button {
        position: fixed;
        left: var(--spacing-xl);
        top: var(--spacing-xl);
        height: 40px;
        width: 42px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: var(--radius-md);
        cursor: pointer;
        color: var(--color-sidebar-text);
        background: var(--color-bg-sidebar);
        box-shadow: var(--shadow-md);
        transition: all var(--transition-base);
        z-index: 11;
    }
    
    .sidebar-menu-button:hover {
        background: var(--color-hover);
        color: var(--color-accent);
        transform: translateY(-1px);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.collapsed {
        width: 270px;
        left: -270px;
    }
    
    .sidebar.collapsed .sidebar-header .sidebar-toggler {
        transform: none;
    }
    
    .sidebar.collapsed .sidebar-nav .primary-nav {
        transform: translateY(15px);
    }
    
    .app-container {
        grid-template-columns: 0 1fr 40vw;
    }
    
    .chat-area {
        margin-left: 0;
        height: 100dvh; /* Dynamic viewport height */
        max-height: calc(100vh - 2rem);
        min-height: 400px; /* Minimum height constraint */
    }
    
    .right-panel-header {
        padding: 16px 20px;
        margin: -16px -16px 0 -16px;
        height: 72px; /* Mobile height: 40px (mobile padding) + 32px for content */
    }
    
    .user-profile-section {
        justify-content: center;
    }
    
    .user-info-right {
        padding: 6px 10px;
    }
    
    .login-btn-right {
        padding: 6px 12px;
        font-size: 0.85em;
    }
    
    .message-content table th,
    .message-content table td {
        max-width: 150px; /* Smaller max width on mobile */
        min-width: 60px; /* Smaller min width on mobile */
        font-size: 0.8em; /* Slightly smaller text */
        padding: 3px 6px; /* Reduce padding on mobile */
    }
    
    .table-scroll-wrapper table {
        min-width: 250px !important; /* Smaller minimum width for mobile */
    }
}

/* Chat Area Styles (Middle Column) - ENHANCED */
.chat-area {
    grid-area: chat;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-chat);
    overflow: hidden;
    margin-left: 0;
    position: relative;
    min-width: 0; /* Allow shrinking below content size */
    min-height: 100vh;
    /* Add max-height to prevent overflow */
    max-height: 100vh;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    background: var(--color-bg-card);
    border: none;
    box-shadow: none;
    gap: 16px;
    height: 84px;
    box-sizing: border-box;
    flex-shrink: 0; /* Prevent header from shrinking */
}

.chat-title-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-title-section .main-title {
    margin: 0;
    font-size: 2rem;
    font-weight: 600;
    color: var(--color-accent);
    line-height: 1.2;
}

.chat-header h3 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 400;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.8;
}

.chat-header button {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.chat-header button:hover {
    background: var(--color-hover);
    color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Chatbox improvements for better scrolling */
.chatbox {
    flex-grow: 1;
    padding: 40px; /* Increased padding for even more breathing room */
    overflow-y: auto;
    background: transparent;
    display: flex;
    flex-direction: column;
    scrollbar-width: 6px;
    scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
    min-height: 0; /* Allow chatbox to shrink if needed */
    /* Improved height calculation */
    max-height: calc(100vh - 172px); /* Header (84px) + Input area (88px) */
    /* Add padding-bottom to prevent content from being hidden behind input */
    padding-bottom: 20px;
}

.chatbox::-webkit-scrollbar {
    width: 6px;
}

.chatbox::-webkit-scrollbar-track {
    background: transparent;
}

.chatbox::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3);
    border-radius: 3px;
}

.chatbox::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.5);
}

/* Message Styles */
.message {
    display: flex;
    align-items: flex-start;
    gap: clamp(16px, 3vw, 20px); /* Increased gap */
    max-width: 100%;
    width: 100%; /* Force full width for all messages */
    position: relative;
    margin-bottom: clamp(20px, 4vw, 28px); /* Increased spacing between messages */
}

.user-message {
    flex-direction: row; /* Changed from column to row for left alignment */
    align-items: flex-start; /* Changed from flex-end to flex-start */
    margin-left: 0; /* Changed from auto to 0 for left alignment */
    margin-right: auto; /* Added for left alignment */
    max-width: 100%; /* Full width for maximum space */
}

.user-message .message-content {
    background: var(--color-accent);
    color: white;
    border: 1px solid transparent; /* Add transparent border to match agent message structure */
    border-radius: 8px 28px 28px 28px; /* Changed to match agent style but mirror */
    box-shadow: 0 4px 20px rgba(29, 126, 253, 0.25);
    word-wrap: break-word;
    overflow-wrap: break-word;
    font-weight: 450;
    line-height: 1.7; /* Increased line height */
    max-width: none; /* Remove max-width constraint */
    width: auto; /* Let it expand naturally within the flex container */
    flex: 1; /* Take up all available space in the flex container */
    overflow: hidden;
    min-height: 52px; /* Increased minimum height */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth hover effect */
}

.user-message .message-content:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(29, 126, 253, 0.3);
}

.agent-message {
    flex-direction: row; /* Same as user message for consistent layout */
    align-items: flex-start; /* Same as user message */
    margin-left: 0; /* Same as user message for left alignment */
    margin-right: auto; /* Same as user message */
    max-width: 100%; /* Full width for maximum space - same as user message */
}

.user-icon {
    width: clamp(40px, 6vw, 48px);/* Same size as agent icon */
    height: clamp(40px, 6vw, 48px);/* Same size as agent icon */
    font-size: clamp(1.1em, 2vw, 1.3em);
    border-radius: 50%;
    background: var(--color-bg-secondary); /* Same background as agent icon */
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em; /* Slightly larger icon */
    color: #9caf88; /* More vibrant green color for the icon */
    flex-shrink: 0;
    margin-top: 4px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08); /* Same shadow as agent */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth hover effect */
}

.user-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); /* Same hover shadow as agent */
}

.agent-icon {
    width: 48px; /* Same size */
    height: 48px; /* Same size */
    border-radius: 50%;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3em; /* Increased to match user icon */
    color: var(--color-accent);
    flex-shrink: 0;
    margin-top: 4px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth hover effect */
}

.agent-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Dark theme adjustments for icons */
body.dark-theme .user-icon {
    background: var(--color-bg-secondary); /* Same as agent in dark theme */
    color: #9caf88; /* More vibrant green color for the icon */
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08); /* Same shadow as agent */
}

body.dark-theme .user-icon:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); /* Same hover shadow as agent */
}

.message-content {
    /*padding: 14px 20px;*/ /* Increased default padding */
    border-radius: 20px; /* Increased default rounding */
    word-wrap: break-word;
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    /*font-size: 1.05rem;*/
    /*line-height: 1.7;*/ 
    padding: clamp(14px, 3vw, 24px);
    font-size: clamp(0.875rem, 2.5vw, 1.125rem);
    line-height: clamp(1.4, 2vw, 1.7);
}

/* Markdown table styles for chat messages - Enhanced Responsive */
.message-content table {
    border-collapse: collapse;
    margin: 0;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem); /* Responsive font size */
    border: none; /* Border handled by wrapper */
    width: max-content; /* Take only the space needed for content */
    table-layout: auto; /* Allow natural column sizing */
    min-width: clamp(300px, 80vw, 100%); /* Responsive minimum width */
    max-width: 100%; /* Prevent table from exceeding container */
}

.message-content table th,
.message-content table td {
    padding: clamp(6px, 1.5vw, 12px); /* Responsive padding */
    text-align: left;
    border: 1px solid #ddd;
    word-wrap: break-word; /* Allow text wrapping to prevent overlapping */
    overflow-wrap: break-word; /* Handle long words */
    max-width: clamp(150px, 25vw, 250px); /* Responsive max width */
    min-width: clamp(60px, 15vw, 150px); /* Responsive minimum width */
    vertical-align: top; /* Align content to top of cell */
    font-size: clamp(0.75rem, 1.8vw, 0.9rem); /* Individual cell font scaling */
}

.message-content table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    z-index: 1;
}

.message-content table tr:nth-child(even) {
    background-color: #f9f9f9;
}

/* Style for the JavaScript-created table wrapper - Enhanced Responsive */
.table-scroll-wrapper {
    overflow-x: auto !important;
    overflow-y: visible !important;
    margin: clamp(8px, 2vw, 12px) 0 !important; /* Responsive margin */
    border: 1px solid #ddd !important;
    border-radius: clamp(4px, 1vw, 8px) !important; /* Responsive border radius */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    contain: layout !important;
    font-size: clamp(0.75rem, 1.8vw, 0.9rem); /* Table container font scaling */
}

/* Ensure tables within scroll wrapper don't exceed available space */
.table-scroll-wrapper table {
    min-width: 300px !important; /* Ensure readability */
    max-width: none !important; /* Allow horizontal scroll if needed */
}
.agent-message .message-content {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    color: var(--color-text-primary);
    border-radius: 8px 28px 28px 28px; /* Larger border radius to match user */
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.7;
    box-shadow: 0 4px 20px var(--color-shadow);
    font-weight: 450;
    max-width: none; /* Remove max-width constraint */
    width: auto; /* Let it expand naturally within the flex container */
    flex: 1; /* Take up all available space in the flex container */
    overflow: hidden;
    min-height: 52px; /* Increased minimum height to match user */
    transition: transform 0.2s ease, box-shadow 0.2s ease; /* Smooth hover effect */
}

.agent-message .message-content:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px var(--color-shadow);
}
body.dark-theme .message-content table tr:nth-child(even) {
    background: var(--color-bg-secondary);
}


/* Chat message code block styles */
.message-content pre {
    max-height: 300px;
    overflow-y: auto;
    /*overflow-x: auto;*/
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 16px;
    margin: 12px 0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: var(--color-text-primary);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.message-content pre::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.message-content pre::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 3px;
}

.message-content pre::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.message-content pre::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

.message-content code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    background: var(--color-bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--color-text-primary);
}

/* Chat message list styles */
.message-content ol {
    counter-reset: list-counter;
    padding-left: 0;
    margin: 12px 0;
    list-style: none;
}

.message-content ol > li {
    display: block;
    margin: 8px 0;
    padding-left: 2em;
    position: relative;
    counter-increment: list-counter;
}

.message-content ol > li:before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    color: var(--color-accent);
}

/* Nested lists inside ordered list items */
.message-content ol li ul {
    counter-reset: none;
    padding-left: 1.5em;
    margin: 8px 0;
    list-style: none;
}

.message-content ol li ul li {
    margin: 4px 0;
    padding-left: 1em;
    position: relative;
    counter-increment: none;
}

.message-content ol li ul li:before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-text-secondary);
    font-weight: normal;
}

/* Regular unordered lists */
.message-content ul {
    padding-left: 1.5em;
    margin: 12px 0;
    list-style: none;
}

.message-content ul li {
    margin: 6px 0;
    padding-left: 1em;
    position: relative;
}

.message-content ul li:before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-text-secondary);
}

.message-content h3 {
    margin: 16px 0 8px 0;
    color: var(--color-text-primary);
    font-weight: 600;
}

.message-content h4 {
    margin: 12px 0 6px 0;
    color: var(--color-text-primary);
    font-weight: 500;
}
/* Loading animation for agent messages */
.loading .agent-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.8;
    }
}

/* Suggestion Buttons and Interactive Elements */
.suggestion-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 87, 184, 0.2); /* Bayer Blue */
    color: #0057B8; /* Bayer Blue */
    padding: 10px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.suggestion-btn:hover {
    background: linear-gradient(135deg, #0057B8 0%, #0073e6 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 87, 184, 0.3);
}

/* Message Feedback and References */
.message-feedback {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.feedback-btn,
.reference-toggle {
    background: rgba(248, 250, 252, 0.8);
    border: 1px solid rgba(203, 213, 225, 0.6);
    border-radius: 18px;
    padding: 6px 12px;
    cursor: pointer;
    color: #64748b;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.feedback-btn:hover,
.reference-toggle:hover {
    background: rgba(226, 232, 240, 0.8);
    color: #475569;
}

.reference-toggle {
    margin-left: auto;
    color: #1d7efd;
    border-color: rgba(29, 126, 253, 0.2);
}

.references {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    font-size: 0.85em;
}

.references ul {
    list-style: none;
    padding-left: 0;
}

.references li {
    margin-bottom: 6px;
    color: #64748b;
}

.suggested-questions {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}


/* Input Area Styles - IMPROVED */
.input-area {
    display: flex;
    padding: clamp(16px, 2vw, 24px);
    background: var(--color-bg-chat);
    border: none;
    align-items: flex-end;
    gap: clamp(8px, 2vw, 16px);
    box-shadow: none;
    flex-shrink: 0;
    position: sticky; /* Changed from relative to sticky */
    bottom: 0; /* Stick to bottom */
    z-index: 1;
    min-height: 88px;
    /* Add these new properties for better positioning */
    width: 100%;
    box-sizing: border-box;
    margin-top: auto; /* Push to bottom */
    min-height: clamp(76px, 10vh, 100px);
}

/* Layout stable states - improved */
.layout-stable .input-area,
.app-container .input-area {
    display: flex;
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    /* Force recalculation when layout changes */
    transform: translateZ(0);
}

.layout-stable .chat-area,
.app-container .chat-area {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-height: 100vh;
}

/* Layout updating state improvements */
.layout-updating {
    visibility: hidden;
    /* Prevent flicker during transitions */
    transition: none !important;
}

.layout-updating * {
    pointer-events: none;
    transition: none !important;
}

/* Add specific styles for when right panel is toggling */
.app-container.panel-transitioning .input-area {
    /* Ensure input area stays at bottom during transitions */
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
}

/* Notification System */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    pointer-events: none;
}

.notification {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    pointer-events: auto;
    min-width: 300px;
}

.notification-show {
    opacity: 1;
    transform: translateX(0);
}

.notification-hide {
    opacity: 0;
    transform: translateX(100%);
}

.notification-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 12px;
}

.notification-message {
    flex: 1;
    color: var(--color-text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    padding: 0;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

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

/* Notification Types */
.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-error .notification-message {
    color: #dc2626;
}

.notification-warning {
    border-left: 4px solid #f59e0b;
}

.notification-warning .notification-message {
    color: #d97706;
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-success .notification-message {
    color: #059669;
}

.notification-info {
    border-left: 4px solid var(--color-accent);
}

.notification-info .notification-message {
    color: var(--color-accent);
}

/* Dark theme adjustments */
body.dark-theme .notification {
    background: var(--color-bg-secondary);
    border-color: var(--color-border-sidebar);
}

body.dark-theme .notification-error .notification-message {
    color: #fca5a5;
}

body.dark-theme .notification-warning .notification-message {
    color: #fbbf24;
}

body.dark-theme .notification-success .notification-message {
    color: #6ee7b7;
}

body.dark-theme .notification-info .notification-message {
    color: #93c5fd;
}

/* Improved textarea styling */
#userInput {
    flex-grow: 1;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: clamp(20px, 3vw, 24px);
    padding: clamp(14px, 3vw, 20px);
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: var(--color-text-primary);
    resize: none;
    overflow-y: auto;
    min-height: clamp(44px, 8vw, 48px);
    max-height: clamp(80px, 15vh, 120px);
    line-height: clamp(1.4, 2vw, 1.7);
    transition: all 0.3s ease;
    font-family: inherit;
    box-shadow: 0 2px 4px var(--color-shadow);
    /* Ensure proper box model */
    box-sizing: border-box;
    width: 100%;
}

#userInput:focus {
    outline: none;
    border-color: var(--color-accent);
    background: var(--color-bg-card);
    box-shadow: 0 0 0 3px rgba(29, 126, 253, 0.1), 0 4px 12px var(--color-shadow);
}

#userInput::placeholder {
    color: var(--color-text-placeholder);
    font-weight: 400;
}

#sendButton {
    background: var(--color-accent);
    color: white;
    border: none;
    border-radius: 50%;
    width: clamp(44px, 8vw, 48px);
    height: clamp(44px, 8vw, 48px);
    font-size: clamp(1em, 2vw, 1.2em);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1em;
    transition: all 0.3s ease;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 87, 184, 0.3); /* Bayer Blue */
}

#sendButton:hover {
    background: #003a75; /* Darker Bayer Blue */
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 87, 184, 0.4);
}

#sendButton:active {
    transform: translateY(0);
}

#sendButton i {
    font-size: 1em;
}

/* Loading Indicator Styles */
.loading .message-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 4px 20px 20px 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.dot-flashing {
    position: relative;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #0057B8; /* Bayer Blue */
    color: #0057B8; /* Bayer Blue */
    animation: dotFlashing 1.4s infinite linear alternate;
    animation-delay: 0.5s;
    margin-right: 4px;
}

.dot-flashing::before,
.dot-flashing::after {
    content: '';
    display: inline-block;
    position: absolute;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #0057B8; /* Bayer Blue */
    color: #0057B8; /* Bayer Blue */
}

.dot-flashing::before {
    left: -12px;
    animation: dotFlashing 1.4s infinite alternate;
    animation-delay: 0s;
}

.dot-flashing::after {
    left: 12px;
    animation: dotFlashing 1.4s infinite alternate;
    animation-delay: 1s;
}

@keyframes dotFlashing {
    0% {
        background-color: #0057B8; /* Bayer Blue */
        opacity: 1;
    }
    50%,
    100% {
        background-color: #94a3b8;
        opacity: 0.3;
    }
}

/* Add more specific styles as needed for icons, active states, etc. */


/* New Right Panel Styles */
.right-panel {
    grid-area: right;
    display: flex;
    flex-direction: column;
    background: var(--color-bg-right-panel);
    border: none;
    padding: 0;
    /*overflow: hidden;*/
    scrollbar-width: 6px;
    scrollbar-color: var(--color-border) transparent;
    position: relative;
    transition: width 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    /* RESPONSIVE SCALING - Allow expansion on large screens */
    width: 100%;
    flex: 1;
}

.right-panel.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    opacity: 0;
    overflow: visible !important; /* Changed from hidden to visible so button shows */
    padding: 0 !important;
    border: none;
}

.right-panel::-webkit-scrollbar {
    width: 6px;
}

.right-panel::-webkit-scrollbar-track {
    background: transparent;
}

.right-panel::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 3px;
}

.right-panel::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-placeholder);
}

.accordion-container {
    background: var(--color-bg-card);
    border: none;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s ease;
    flex: 1;
    height: 100%;
}

.accordion-container:hover {
    box-shadow: none;
    transform: none;
}

.accordion-header {
    padding: clamp(12px, 2vw, 20px); /* Responsive padding */
    background: var(--color-bg-secondary);
    border: none;
    font-weight: 600;
    font-size: clamp(0.9rem, 2vw, 1rem); /* Responsive font size */
    color: var(--color-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px); /* Responsive gap */
    transition: all 0.3s ease;
}

.accordion-header:hover {
    background: var(--color-hover);
}

.accordion-header i {
    color: var(--color-accent);
    font-size: 1.1em;
}

.accordion-content {
    padding: clamp(16px, 3vw, 24px); /* Responsive padding */
    background: var(--color-bg-card);
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    font-size: clamp(0.875rem, 1.8vw, 1rem); /* Responsive content font size */
}

/* --- SQL/Visualization Viewer Area Sizing & Alignment --- */
.accordion-content.tab-content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 20px;
    background: var(--color-bg-card);
    border-radius: 0;
    box-shadow: none;
    overflow: hidden; /* Prevent double scrollbars - let child elements handle scrolling */
}

/* Optional: Make tab panes fill the area */
.tab-pane.active {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: normal;
    height: 100%;
}

/* Scrollable SQL query container */
.sql-query-container {
    flex: 1;
    min-height: 0; /* Allow flex child to shrink below its content size */
    overflow-y: auto;
    overflow-x: hidden; /* Let the pre element handle horizontal scrolling */
    border: none; /* Let the pre element handle borders */
    border-radius: 0; /* Let the pre element handle border radius */
    background: transparent; /* Let the pre element handle background */
    box-shadow: none; /* Let the pre element handle shadows */
    margin: 0;
    position: relative;
}

.sql-query-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sql-query-container::-webkit-scrollbar-track {
    background: var(--color-bg-secondary);
    border-radius: 4px;
}

.sql-query-container::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: 4px;
}

.sql-query-container::-webkit-scrollbar-thumb:hover {
    background: var(--color-text-secondary);
}

/* Style for the SQL query pre/code block */
.sql-query-container pre {
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    padding: 20px;
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: none;
    box-shadow: 0 4px 16px var(--color-shadow);
    margin: 0;
    height: auto; /* 50% of viewport height */
    min-height: 200px; /* Minimum height for usability */
    max-height: 80vh; /* Maximum height to prevent overflow */
    overflow-y: auto; 
}

/* Legacy support for direct SQL display without container */
.accordion-content#sqlQueryDisplay pre {
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre;
    word-wrap: normal;
    border: 1px solid var(--color-border);
    box-shadow: 0 4px 16px var(--color-shadow);
    margin: 0;
}

/* Style for the plot display area */
.accordion-content#plotDisplay {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    height: 100%;
    background: var(--color-bg-card);
    border-radius: 12px;
    color: var(--color-text-secondary);
    font-style: italic;
    border: 1px solid var(--color-border);
}

/* New styles for the visualization tabs */
.visualization-content {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.visualization-tabs {
    display: flex;
    border: none;
    background: transparent;
    margin-bottom: 16px;
    gap: 8px;
}

.tab-button {
    position: relative; /* Add this to enable absolute positioning for the dot */
    padding: clamp(8px, 2vw, 12px) clamp(12px, 3vw, 20px); /* Responsive padding */
    border: none;
    background: var(--color-bg-secondary);
    border-radius: clamp(16px, 3vw, 20px); /* Responsive border radius */
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text-secondary);
    transition: all 0.3s ease;
    flex-grow: 0;
    font-size: clamp(0.8rem, 1.8vw, 0.9rem); /* Responsive font size */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-border);
}

.tab-button:hover {
    background: var(--color-hover);
    color: var(--color-text-primary);
    transform: translateY(-1px);
}

.tab-button.active {
    background: var(--color-accent);
    color: white;
    box-shadow: 0 4px 12px rgba(29, 126, 253, 0.3);
    border-color: var(--color-accent);
}

.tab-button.active i {
    color: white !important;
}

.tab-button i {
    color: var(--color-text-secondary);
    transition: color 0.3s ease;
    margin-right: 8px;
}

.tab-button:hover i {
    color: var(--color-text-primary);
}

/* Notification dot for visualization tab */
.tab-button .notification-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border-radius: 50%;
    border: 2px solid var(--color-bg-card);
    animation: pulse-notification 2s infinite;
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 999;
    pointer-events: none; /* Prevent interference with tab clicking */
}

.tab-button .notification-dot.visible {
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* Subtle pulsing animation for the notification dot */
@keyframes pulse-notification {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.3);
        opacity: 0.7;
    }
}

/* Hide notification dot when tab is active */
.tab-button.active .notification-dot {
    opacity: 0 !important;
    transform: scale(0) !important;
}

/* Data table styling */
.data-table-container {
    width: 100%;
    overflow-x: auto;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    border-radius: 12px;
    overflow: hidden;
}

.data-table th {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #334155;
    border: none;
    position: sticky;
    top: 0;
    z-index: 1;
}

.data-table td {
    padding: 10px 16px;
    border: none;
    color: #475569;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}

.data-table tr:nth-child(even) {
    background: rgba(248, 250, 252, 0.5);
}

body.dark-theme .data-table tr:nth-child(even) {
    background: var(--color-bg-secondary);
}

.data-table tr:last-child td {
    border-bottom: none;
}

/* Ensure plot containers fit */
.plot-container {
    width: 100%;
    height: auto;
}

/* Restored Data Indicator */
.restored-data-indicator {
    background: rgba(108, 117, 125, 0.1);
    border-left: 3px solid #6c757d;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 0 4px 4px 0;
    font-size: 0.875rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
}

.restored-data-indicator i {
    opacity: 0.7;
}

body.dark-theme .restored-data-indicator {
    background: rgba(108, 117, 125, 0.15);
    color: #adb5bd;
}

.dev-mode-note {
    font-size: 0.8em;
    color: var(--color-text-placeholder);
    font-style: italic;
    text-align: center;
    padding: 4px 0;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px 18px;
    white-space: nowrap;
    border-top: 1px solid var(--color-border-sidebar);
    margin-top: auto;
    background: var(--color-bg-sidebar);
}

.sidebar-footer .theme-toggle {
    width: 100%;
    min-height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    cursor: pointer;
    border: none;
    padding: 0 15px;
    white-space: nowrap;
    color: var(--color-sidebar-text);
    background: var(--color-bg-sidebar);
    transition: 0.3s ease;
}

.sidebar-footer .theme-toggle:hover {
    background: var(--color-hover);
}

.sidebar.collapsed .theme-toggle :where(.nav-label, .theme-toggle-track) {
    opacity: 0;
    width: 0;
    transition: all 0.2s ease;
}

.theme-toggle .theme-toggle-track {
    height: 24px;
    width: 48px;
    border-radius: 999px;
    margin-left: auto;
    background: var(--color-border);
    position: relative;
    transition: opacity 0.4s 0.2s ease, background-color 0.3s ease;
}

body.dark-theme .theme-toggle-track {
    background: var(--color-accent);
}

.theme-toggle-track .theme-toggle-indicator {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

body.dark-theme .theme-toggle-indicator {
    transform: translateX(24px);
}

/* Theme Toggle as Nav Item - Force same styling as other nav items */
.nav-item .theme-toggle {
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    /* Override any different layout - force same as nav-link */
    display: flex;
    gap: 12px;
    white-space: nowrap;
    border-radius: 8px;
    padding: 11px 15px;
    align-items: center;
    text-decoration: none;
    border: 1px solid transparent;
    transition: 0.4s ease;
    color: var(--color-text-primary);
    /* Force flex-start to align icon and text to the left like other nav items */
    justify-content: flex-start !important;
}

.nav-item .theme-toggle:hover {
    color: var(--color-accent);
    background: var(--color-sidebar-nav-hover);
}

/* Force theme toggle nav-label to match other nav-labels exactly */
.nav-item .theme-toggle .nav-label {
    font-weight: 650 !important;
    font-size: 1.08rem !important; /* Slightly larger font */
    color: var(--color-text-secondary) !important;
    transition: opacity 0.3s ease;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    /* Ensure no flex-grow that might affect sizing */
    flex-grow: 0;
    flex-shrink: 0;
}

/* Enlarge the theme icon and adjust its position */
.theme-toggle .theme-icon {
    font-size: 1.2em;
    width: 20px;
    text-align: center;
    margin-left: -4px; /* Move icon to the left */
}

/* Theme toggle track positioning - move to end like other nav items */
.nav-item .theme-toggle .theme-toggle-track {
    margin-left: auto;
    opacity: 1;
    width: 48px;
    flex-shrink: 0;
}

.sidebar.collapsed .nav-item .theme-toggle .theme-toggle-track {
    opacity: 0;
    width: 0;
    transition: all 0.2s ease;
}

/* Right Panel Collapse Button - Styled to match sidebar toggle */
.right-panel-collapse-btn {
    position: fixed;
    right: 40vw;
    top: 50%;
    transform: translate(12px, -50%);
    width: 35px;
    height: 35px;
    background: var(--color-sidebar-nav-hover);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-slow);
    z-index: 1000;
    color: var(--color-sidebar-text);
    opacity: 1 !important;
    visibility: visible !important;
}

.right-panel-collapse-btn:hover {
    background: var(--color-hover);
    color: var(--color-accent);
    transform: translate(8px, -50%) translateY(-1px);
    box-shadow: var(--shadow-md);
}

.right-panel-collapse-btn i {
    font-size: 1.2rem;
    color: inherit;
    transition: all var(--transition-slow);
}

.right-panel-collapse-btn.collapsed {
    right: 0;
    transform: translate(-12px, -50%);
}

.right-panel-collapse-btn.collapsed:hover {
    transform: translate(-8px, -50%) translateY(-1px);
}

/* Dark theme support for right panel collapse button */
body.dark-theme .right-panel-collapse-btn {
    background: var(--color-sidebar-nav-hover);
    color: var(--color-sidebar-text);
}

body.dark-theme .right-panel-collapse-btn:hover {
    background: var(--color-hover);
    color: var(--color-accent);
}

/* Fix the icon direction logic - when collapsed show left arrow, when open show right arrow */
.right-panel-collapse-btn.collapsed i {
    transform: rotate(180deg); /* Right arrow when collapsed (pointing left to open) */
}

.right-panel-collapse-btn:not(.collapsed) i {
    transform: rotate(0deg); /* Left arrow when open (pointing right to close) */
}

/* Adjust button position when sidebar is collapsed */
.app-container:has(.sidebar.collapsed) .right-panel-collapse-btn:not(.collapsed) {
    right: 40vw;
}

/* Adjust app container grid for collapsed state */
.app-container:has(.right-panel.collapsed) {
    grid-template-columns: 270px 1fr 0;
}

.app-container:has(.right-panel.collapsed):has(.sidebar.collapsed) {
    grid-template-columns: 85px 1fr 0;
}

/* List styling within message content */
.message-content ol,
.message-content ul {
    margin: 8px 0;
    padding-left: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-content ol {
    counter-reset: list-counter;
    list-style: none;
}

.message-content ol li {
    counter-increment: list-counter;
    margin-bottom: 4px;
    padding-left: 35px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.message-content ol li::before {
    content: counter(list-counter) ".";
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 600;
    color: var(--color-accent);
    min-width: 30px;
    text-align: left;
}

.message-content ul {
    list-style: none;
}

.message-content ul li {
    margin-bottom: 4px;
    padding-left: 20px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.message-content ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--color-accent);
    font-weight: bold;
}

/* Nested list handling */
.message-content ol ol,
.message-content ul ul,
.message-content ol ul,
.message-content ul ol {
    margin: 4px 0;
    padding-left: 20px;
}

.message-content ol ol li::before {
    content: counter(list-counter, lower-alpha) ".";
}

.message-content ul ul li::before {
    content: "◦";
}

/* Legacy Info Card Styles - REPLACED BY INFO MODALS */
/* Old info card functionality has been replaced by modal implementation */
/* See Info Modal Styles section below for current implementation */

/* Info Modal Styles - Modern popup modals for Data Knowledge and Help */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.info-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(2px);
}

.info-modal {
    background: var(--color-bg-card);
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    box-shadow: 0 10px 30px var(--color-shadow);
    animation: slideIn 0.3s ease-out;
    border: 1px solid var(--color-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.info-modal-header {
    background: var(--color-bg-secondary);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.info-modal-header i {
    color: var(--color-accent);
    font-size: 1.3em;
}

.info-modal-title {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text-primary);
    flex-grow: 1;
}

.info-modal-close {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-modal-close:hover {
    background: var(--color-hover);
    color: var(--color-text-primary);
    transform: scale(1.05);
}

.info-modal-content {
    padding: 24px;
    color: var(--color-text-primary);
    line-height: 1.6;
    font-size: 1rem;
    overflow-y: auto;
    flex-grow: 1;
}

.info-modal-content h1,
.info-modal-content h2,
.info-modal-content h3,
.info-modal-content h4 {
    color: var(--color-text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.info-modal-content h1:first-child,
.info-modal-content h2:first-child,
.info-modal-content h3:first-child,
.info-modal-content h4:first-child {
    margin-top: 0;
}

.info-modal-content ul,
.info-modal-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.info-modal-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.info-modal-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.info-modal-content code {
    background: var(--color-bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
}

.info-modal-content pre {
    background: var(--color-bg-secondary);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    margin: 1rem 0;
}

/* Link styling for better visibility in both light and dark modes */
.info-modal-content a {
    color: var(--color-accent);
    text-decoration: underline;
    transition: color 0.2s ease;
    font-weight: 500;
}

.info-modal-content a:hover {
    color: var(--color-accent-secondary);
    text-decoration: none;
}

.info-modal-content a:visited {
    color: var(--color-accent);
    opacity: 0.8;
}

/* Dark theme support for info modal */
body.dark-theme .info-modal-overlay {
    background: rgba(0, 0, 0, 0.7);
}

/* Dark theme specific link colors for better visibility */
body.dark-theme .info-modal-content a {
    color: #60a5fa; /* Light blue - much more visible on dark background */
}

body.dark-theme .info-modal-content a:hover {
    color: #93c5fd; /* Even lighter blue on hover */
}

body.dark-theme .info-modal-content a:visited {
    color: #60a5fa;
    opacity: 0.9;
}

/* Mobile responsiveness for info modal */
@media (max-width: 768px) {
    .info-modal {
        width: 95%;
        max-height: 85vh;
        margin: 20px;
    }
    
    .info-modal-header {
        padding: 16px 20px;
    }
    
    .info-modal-content {
        padding: 20px;
        font-size: 0.95rem;
    }
}

/* Loading spinner for modal content */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--color-text-secondary);
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    border: 2px solid var(--color-border);
    border-top: 2px solid var(--color-accent);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

/* Visual state for active nav links */
.nav-item.info-modal-active > .nav-link {
    background: var(--color-sidebar-nav-hover);
    color: var(--color-accent);
}

/* Hide old info card container - use new modal instead */
.info-card-container {
    display: none !important; /* Hide old info cards */
}

/* Align SQL feedback and info card text with chat message styles */
#sqlFeedbackButtons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
#sqlFeedbackButtons span {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-primary);
    line-height: 1.5;
}
#sqlFeedbackButtons button {
    background: none;
    border: none;
    outline: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}
#sqlFeedbackButtons i {
    font-size: 1.2em;
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
}
#sqlFeedbackButtons button:hover {
    background-color: var(--color-hover);
}
#sqlFeedbackButtons button:hover i {
    color: var(--color-text-primary);
}

/* Specific hover effects for thumbs up and thumbs down */
#sqlFeedbackButtons button#thumbs-up:hover {
    background-color: rgba(34, 197, 94, 0.1); /* Green background with opacity */
}
#sqlFeedbackButtons button#thumbs-up:hover i {
    color: #22c55e; /* Green color for thumbs up */
}

#sqlFeedbackButtons button#thumbs-down:hover {
    background-color: rgba(239, 68, 68, 0.1); /* Red background with opacity */
}
#sqlFeedbackButtons button#thumbs-down:hover i {
    color: #ef4444; /* Red color for thumbs down */
}
/* Active/clicked states for feedback buttons */
#sqlFeedbackButtons button.clicked {
    background-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(0, 87, 184, 0.3);
    border: 1px solid var(--color-accent);
}

#sqlFeedbackButtons button.clicked i {
    color: white !important;
}

#sqlFeedbackButtons button#thumbs-up.clicked {
    background-color: #22c55e !important; /* Green for thumbs up */
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    border: 1px solid #22c55e;
}

#sqlFeedbackButtons button#thumbs-down.clicked {
    background-color: #ef4444 !important; /* Red for thumbs down */
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    border: 1px solid #ef4444;
}

/* User Response Feedback Buttons - similar to SQL feedback but for chat messages */
.userResponseFeedbackButtons {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 8px;
    /* border-top: 1px solid var(--color-border); */
}

/* View Results Button Container */
.view-results-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.view-results-container:empty {
    display: none;
}

/* View Results Button */
.view-results-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-secondary) 100%);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 87, 184, 0.2);
}

.view-results-btn:hover {
    background: linear-gradient(135deg, var(--color-accent-secondary) 0%, var(--color-accent) 100%);
    box-shadow: 0 4px 12px rgba(0, 87, 184, 0.3);
    transform: translateY(-1px);
}

.view-results-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 87, 184, 0.2);
}

.view-results-btn i {
    font-size: 1.1em;
}

body.dark-theme .view-results-btn {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-secondary) 100%);
    box-shadow: 0 2px 8px rgba(0, 87, 184, 0.4);
}

body.dark-theme .view-results-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 87, 184, 0.5);
}

/* User Message Actions Container */
.userMessageActions {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.userResponseFeedbackButtons span {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--color-text-secondary);
    line-height: 1.5;
}

.userResponseFeedbackButtons button {
    background: none;
    border: none;
    outline: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.userResponseFeedbackButtons i {
    font-size: 1.1em;
    color: var(--color-text-secondary);
    transition: color 0.2s ease;
}

.userResponseFeedbackButtons button:hover {
    background-color: var(--color-hover);
}

.userResponseFeedbackButtons button:hover i {
    color: var(--color-text-primary);
}

/* Specific hover effects for user response feedback */
.userResponseFeedbackButtons button.response-thumbs-up:hover {
    background-color: rgba(34, 197, 94, 0.1); /* Green background with opacity */
}

.userResponseFeedbackButtons button.response-thumbs-up:hover i {
    color: #22c55e; /* Green color for thumbs up */
}

.userResponseFeedbackButtons button.response-thumbs-down:hover {
    background-color: rgba(239, 68, 68, 0.1); /* Red background with opacity */
}

.userResponseFeedbackButtons button.response-thumbs-down:hover i {
    color: #ef4444; /* Red color for thumbs down */
}

/* Active/clicked states for user response feedback buttons */
.userResponseFeedbackButtons button.clicked {
    background-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(0, 87, 184, 0.3);
    border: 1px solid var(--color-accent);
}

.userResponseFeedbackButtons button.clicked i {
    color: white !important;
}

.userResponseFeedbackButtons button.response-thumbs-up.clicked {
    background-color: #22c55e !important; /* Green for thumbs up */
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
    border: 1px solid #22c55e;
}

.userResponseFeedbackButtons button.response-thumbs-down.clicked {
    background-color: #ef4444 !important; /* Red for thumbs down */
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
    border: 1px solid #ef4444;
}

/* User Message Regenerate Button */
.userMessageRegenerateButton {
    display: flex;
    align-items: center;
}

.user-regenerate-btn {
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
}

.user-regenerate-btn:hover {
    background: var(--color-hover);
    color: var(--color-text-primary);
    border-color: var(--color-accent);
}

.user-regenerate-btn i {
    font-size: 0.9em;
    transition: transform 0.2s ease;
}

.user-regenerate-btn:hover i {
    transform: rotate(180deg);
}

.user-regenerate-btn span {
    font-weight: 500;
}

.user-regenerate-btn .ask-again-text {
    font-size: 0.60rem;
    font-weight: 400;
}

/* Copy Button Styles */
.sql-header {
    position: relative;
    margin-bottom: 8px;
}

.sql-copy-button {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 0.85em;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.sql-copy-button:hover {
    background: var(--color-hover);
    color: var(--color-text-primary);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.sql-copy-button.copied {
    background: var(--color-accent);
    color: white;
    border-color: var(--color-accent);
}

.sql-copy-button.copied i {
    color: white !important;
}

/* Ensure the SQL display container has relative positioning for absolute button */
#sqlQueryDisplay {
    position: relative;
}

#sqlQueryDisplay pre {
    position: relative;
    padding-top: 30px; /* Make room for the copy button */
}

.info-card-content,
.info-card-content p,
.info-card-content ul,
.info-card-content li {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text-primary);
    line-height: 1.5;
}

/* Session Expired Styling */
.session-expired .message-content {
    background: #fff3cd;
    border-left: 4px solid #f39c12;
    padding: 1rem;
    border-radius: 4px;
    color: #856404;
}

.dark-theme .session-expired .message-content {
    background: #3d2914;
    border-left: 4px solid #f39c12;
    color: #ffc107;
}

.session-expired .agent-icon i {
    color: #f39c12;
}

/* Login Prompt Modal */
.login-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-in-out;
}

.login-prompt-modal {
    background: var(--color-bg-card);
    border-radius: 8px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.3s ease-in-out;
    border: 1px solid var(--color-border);
}

.login-prompt-content h3 {
    margin-top: 0;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.login-prompt-content h3 i {
    color: #f39c12;
}

.login-prompt-content p {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.login-prompt-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    flex: 1;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--color-accent-secondary);
}

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

.btn-secondary:hover {
    background: var(--color-hover);
}

/* Session Expired Styles */
.session-expired .message-content {
    background: #fff3cd;
    border-left: 4px solid #f39c12;
    padding: 1rem;
    border-radius: 4px;
    color: #856404;
}

body.dark-theme .session-expired .message-content {
    background: #2d2a1f;
    border-left: 4px solid #f39c12;
    color: #ffc107;
}

.login-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease-out;
}

.login-prompt-modal {
    background: var(--color-bg-card);
    border-radius: 8px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px var(--color-shadow);
    animation: slideIn 0.3s ease-out;
}

.login-prompt-content h3 {
    margin-top: 0;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.login-prompt-content p {
    color: var(--color-text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.login-prompt-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: var(--color-accent);
    color: white;
}

.btn-primary:hover {
    background: var(--color-accent-secondary);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    background: var(--color-hover);
}

/* ADD AT THE END OF THE FILE */

/* Horizontal scroll fallback for extreme small screens */
@media (max-width: 320px) {
    body {
        min-width: 320px;
        overflow-x: auto;
    }
    
    .app-container {
        min-width: 320px;
        overflow-x: auto;
        scroll-behavior: smooth;
    }
    
    /* Ensure content doesn't break below minimum width */
    .sidebar {
        min-width: 200px;
        flex-shrink: 0;
    }
    
    .chat-area {
        min-width: 280px;
        flex-shrink: 0;
    }
    
    .right-panel {
        min-width: 250px;
        flex-shrink: 0;
    }
    
    /* Show horizontal scrollbar when needed */
    .chatbox {
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .message-content {
        white-space: normal; /* Allow text to wrap normally */
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 250px; /* Prevent messages from being too wide */
    }
}

/* Utility class for using dynamic scaling */
.dynamic-scale {
    transform: scale(var(--dynamic-scale, 1));
    transform-origin: center;
}

.width-responsive {
    width: calc(100% * var(--width-scale, 1));
}

.height-responsive {
    height: calc(100% * var(--height-scale, 1));
}

/* ========================================
   LOGIN PAGE STYLES
   ======================================== */

.login-page {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: var(--spacing-2xl);
    position: relative;
    z-index: 10;
}

.login-card {
    background: var(--color-bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: var(--spacing-3xl) var(--spacing-2xl);
    text-align: center;
    position: relative;
    z-index: 20;
    animation: fadeInUp 0.6s ease-out;
}

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

.login-logo {
    margin-bottom: var(--spacing-2xl);
    text-align: center;
}

.login-logo img {
    max-width: 180px;
    height: auto;
    display: inline-block;
    background-color: white;
}

.login-header {
    margin-bottom: var(--spacing-2xl);
}

.login-header h1 {
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: var(--spacing-sm);
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: var(--text-base);
    color: var(--color-text-secondary);
    font-weight: 500;
}

.login-message {
    margin-bottom: var(--spacing-3xl);
    padding: 0 var(--spacing-md);
}

.login-message p {
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.login-action {
    margin-bottom: var(--spacing-2xl);
}

.azure-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    background: var(--color-accent);
    color: white;
    padding: var(--spacing-lg) var(--spacing-3xl);
    border-radius: var(--radius-md);
    text-decoration: none;
    font-size: var(--text-base);
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 87, 184, 0.3);
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 30;
}

.azure-login-button:hover {
    background: var(--color-accent-secondary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 87, 184, 0.4);
}

.azure-login-button:active {
    transform: translateY(0);
}

.azure-login-button i {
    font-size: 1.25rem;
}

.login-flash-messages {
    margin-top: var(--spacing-lg);
    text-align: left;
}

.login-flash-messages .alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    font-size: var(--text-sm);
}

.login-flash-messages .alert-info {
    background-color: #e3f2fd;
    color: #0d47a1;
    border-left: 4px solid #1976d2;
}

.login-flash-messages .alert-danger {
    background-color: #ffebee;
    color: #b71c1c;
    border-left: 4px solid #d32f2f;
}

.login-flash-messages .alert-success {
    background-color: #e8f5e9;
    color: #1b5e20;
    border-left: 4px solid #388e3c;
}

.login-footer {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.login-help-text {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
}

.login-help-text i {
    color: var(--color-accent);
}

/* Request Access Section */
.request-access-section {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 2px solid var(--color-border);
}

.divider-text {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.divider-text span {
    font-size: var(--text-base);
    font-weight: 600;
    color: var(--color-text-primary);
    background: var(--color-bg-primary);
    padding: 0 var(--spacing-md);
}

.request-access-button {
    width: 100%;
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: var(--text-lg);
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, #00b4d8 0%, #0077b6 100%);
    border: none;
    border-radius: var(--border-radius-lg);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-md);
    box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
}

.request-access-button:hover {
    background: linear-gradient(135deg, #0096c7 0%, #005f8a 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 119, 182, 0.4);
}

.request-access-button:active {
    transform: translateY(0);
}

.request-access-button i {
    font-size: var(--text-xl);
}

.request-help-text {
    margin-top: var(--spacing-md);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
    text-align: center;
}

/* Background decoration */
.login-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.login-bg-shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out;
}

.login-bg-shape.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.login-bg-shape.shape-2 {
    width: 400px;
    height: 400px;
    bottom: -150px;
    right: -150px;
    animation-delay: 5s;
}

.login-bg-shape.shape-3 {
    width: 200px;
    height: 200px;
    top: 50%;
    right: 10%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-30px) scale(1.05);
    }
}

/* Dark theme support for login page */
[data-theme="dark"] .login-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

[data-theme="dark"] .login-card {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .login-header h1 {
    color: #e2e8f0;
}

[data-theme="dark"] .login-subtitle {
    color: #94a3b8;
}

[data-theme="dark"] .login-message p {
    color: #94a3b8;
}

[data-theme="dark"] .login-help-text {
    color: #94a3b8;
}

[data-theme="dark"] .login-footer {
    border-top-color: #334155;
}

[data-theme="dark"] .request-access-section {
    border-top-color: #334155;
}

[data-theme="dark"] .divider-text span {
    background: #0f172a;
}

[data-theme="dark"] .request-help-text {
    color: #94a3b8;
}

/* Responsive design for login page */
@media (max-width: 768px) {
    .login-container {
        max-width: 90%;
        padding: var(--spacing-lg);
    }
    
    .login-card {
        padding: var(--spacing-2xl) var(--spacing-lg);
    }
    
    .login-logo img {
        max-width: 140px;
        height: auto;
        display: inline-block;
        background-color: white;
    }
    
    .login-header h1 {
        font-size: var(--text-lg);
    }
    
    .azure-login-button {
        width: 100%;
        padding: var(--spacing-md) var(--spacing-xl);
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: var(--spacing-md);
    }
    
    .login-card {
        padding: var(--spacing-xl) var(--spacing-md);
    }
    
    .login-logo img {
        max-width: 120px;
        height: auto;
        display: inline-block;
        background: white;
    }
    
    .login-bg-shape.shape-1,
    .login-bg-shape.shape-2,
    .login-bg-shape.shape-3 {
        display: none; /* Hide decorative shapes on very small screens */
    }
}