body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #ffffff;
    color: #000000;
    height: 100vh;
    min-width: 100vw;
    overflow-x: hidden;
    padding: 0;
}

html {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100%;   
    position: relative;
}

/* PRIMARY NAVIGATION BAR - REDUCED HEIGHT */
.header {
    padding: 8px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #0a1e42; /* Changed from transparent */
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
}

.header h2 {
    display: none; /* Remove if you had a title */
}

/* USER ICON - FIXED ALIGNMENT */
.header-icons {
    width: 32px;  /* Reduced from 36px */
    height: 32px;  /* Reduced from 36px */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;  /* Reduced from 22px */
    color: #ffffff;
    cursor: pointer;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    flex-shrink: 0;  /* Prevents shrinking */
}

.header-icons:hover {
    background: rgba(239, 68, 68, 0.2); /* Red accent */
    border-color: #ef4444;
    transform: scale(1.05);
}


/* ============================================
   TOOLBAR STYLES - Main toolbar container
   ============================================ */

/* ACTION TOOLBAR - REDUCED HEIGHT */
/* ACTION TOOLBAR - Distinct from header */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: linear-gradient(180deg, #0e2d52 0%, #0c2547 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-bottom: 1px solid rgba(0, 0, 0, 0.2);
    min-height: 40px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Toolbar Actions Container */
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;  /* Reduced from 8px */
}

/* Action Group - REDUCED PADDING */
.action-group {
    display: flex;
    align-items: center;
    gap: 8px;  /* Reduced from 4px */
    padding: 3px;  /* Reduced from 4px */
}



/* Toolbar Icons - Updated */
.toolbar-icon {
    color: #ffffff;
    font-size: 16px;  /* Reduced from 18px */
    cursor: pointer;
    padding: 6px;  /* Reduced from 8px */
    border-radius: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;  /* Reduced from 36px */
    min-height: 30px;  /* Reduced from 36px */
}

.toolbar-icon:hover {
    background: rgba(239, 68, 68, 0.15); /* Red glow */
    border-color: #ef4444;
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.3);
}

.toolbar-icon:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Toolbar Icon with Label */
.toolbar-icon-labeled {
    display: flex;
    align-items: center;
    gap: 5px;  /* Reduced from 6px */
    padding: 6px 10px;  /* Reduced from 8px 12px */
    font-size: 12px;  /* Reduced from 13px */
    font-weight: 500;
}

.toolbar-icon-labeled span {
    color: #ffffff;
    opacity: 0.95;
}

/* ============================================
   PROJECT DROPDOWN STYLES
   ============================================ */

/* PROJECT DROPDOWN - REDUCED SIZE */
.project-dropdown {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
    min-width: 180px;  /* Reduced from 200px */
    max-width: 260px;  /* Reduced from 280px */
    backdrop-filter: blur(10px);
}

.selected-option-container {
    cursor: pointer;
    background: transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
}


.selected-option-container.disabled .dropdown-arrow {
    color: #cbd5e1 !important;
}

.selected-option-container.disabled span {
    color: #94a3b8 !important;
}


.selected-option-container:hover {
    background: rgba(255, 255, 255, 0.1);
}

.selected-option-container.selected-animation {
    animation: selectPulse 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes selectPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); box-shadow: 0 6px 20px rgba(168, 85, 247, 0.2); }
    100% { transform: scale(1); }
}

/* Selected Option Display */
.selected-option {
    display: flex;
    align-items: center;
    padding: 6px 10px;  /* Reduced from 8px 12px */
    gap: 6px;
}
.selected-option span {
    color: #1e293b;
    font-size: 12px;  /* Reduced from 13px */
    font-weight: 600;
    flex: 1;
}

.selected-option span.project-placeholder {
    color: #2563eb;
    font-weight: 500;
    font-style: italic;
}

.dropdown-arrow {
    color: #64748b;
    font-size: 14px;  /* Reduced from 16px */
    transition: transform 0.3 ease;
}

.dropdown-arrow.rotated {
    transform: rotate(180deg);
}

/* Options Container */
.options-container {
    position: fixed;
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(203, 213, 225, 0.3);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.2);
    max-height: 320px;
    overflow-y: auto;
    z-index: 999999;
}

.options-container.opening {
    animation: slideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-15px) scaleY(0.8);
        transform-origin: top;
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        transform-origin: top;
    }
}

/* Individual Option Items */
.dropdown-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(203, 213, 225, 0.2);
}

.dropdown-option:last-child {
    border-bottom: none;
    border-radius: 0 0 10px 10px;
}

.dropdown-option:hover {
    background: rgba(59, 130, 246, 0.08);
    padding-left: 18px;
}

.dropdown-option:active {
    transform: translateX(1px) scale(0.98);
}

.dropdown-option span {
    color: #374151;
    font-size: 13px;
    font-weight: 500;
}

.dropdown-option:hover span {
    color: #000000;
    font-weight: 600;
}

/* Add Project Option Special Styling */
.add-project-option {
    /* background: linear-gradient(135deg, #10b981 0%, #059669 100%); */
    color: #000000;
    font-weight: 600;
    /* margin-top: 4px; */
}

/* .add-project-option:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateX(5px) scale(1.02);
} */

.add-project-option span {
    color: #374151;
}

/* Delete Icon */
.delete-icon {
    color: #000000;
    font-size: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    opacity: 0;
}

.dropdown-option:hover .delete-icon {
    opacity: 1;
    color: #fecaca;
}

.delete-icon:hover {
    color: #000000;
    background: rgba(248, 113, 113, 0.2);
    transform: scale(1.2);
}

.delete-icon:active {
    transform: scale(0.9);
}



/* ============================================
   UPWARD DROPDOWN POSITIONING STYLES
   ============================================ */

/* Options Container - Upward Opening */
.options-container.upward {
    top: auto;
    bottom: 100%;
    border-top: 1px solid #cbd5e1;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    transform-origin: bottom;
}

.options-container.upward.opening {
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px) scaleY(0.8);
        transform-origin: bottom;
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        transform-origin: bottom;
    }
}

/* Dropdown Options - Upward Styling */
.dropdown-option.upward:first-child {
    border-radius: 10px 10px 0 0;
}

.dropdown-option.upward:last-child {
    border-radius: 0;
    border-bottom: 1px solid rgba(203, 213, 225, 0.5);
}

/* Override the last-child border removal for upward dropdowns */
.options-container.upward .dropdown-option:last-child {
    border-bottom: 1px solid rgba(203, 213, 225, 0.5);
}

.options-container.upward .dropdown-option:first-child {
    border-bottom: 1px solid rgba(203, 213, 225, 0.5);
}

/* ============================================
   TABLE DROPDOWN STYLES
   ============================================ */
.table-dropdown {
    position: absolute;
    top: 100%;
    right: 16px;
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid #cbd5e1;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.15);
    min-width: 280px;
    max-width: 90vw;
    z-index: 1000;
    opacity: 0;
    transform: translateY(-15px) scaleY(0.8);
    transform-origin: top;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.table-dropdown.show {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    animation: tableDropdownSlideDown 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tableDropdownSlideDown {
    from {
        opacity: 0;
        transform: translateY(-15px) scaleY(0.8);
        transform-origin: top;
    }
    to {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        transform-origin: top;
    }
}

/* Table Dropdown Content - Scrollable Area */
.table-dropdown-content {
    max-height: 320px;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 8px;
}

/* Checkbox Container */
.checkbox-container {
    display: flex;
    align-items: center;
    padding: 8px 0;
    margin-left: 8px;
    transition: all 0.2s ease;
    border-radius: 6px;
    margin-bottom: 2px;
}

.checkbox-container:hover {
    background: rgba(239, 68, 68, 0.08);
}

/* Table Checkbox */
.table-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin-right: 12px;
    accent-color: #ef4444; /* Red checkboxes */
    transition: all 0.2s ease;
}

.table-checkbox:hover {
    transform: scale(1.1);
}

/* Table Label */
.table-label {
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.table-category-header {
  font-weight: bold;
  margin-top: 12px;
  margin-bottom: 8px;
  color: #333;
}

.table-subcategory-header {
  font-style: italic;
  margin-left: 6px;
  margin-top: 4px;
  color: #666;
}

.checkbox-container:hover .table-label {
    color: #7c3aed;
}

/* Generate Button */
.table-generate-btn {
    width: calc(100% - 32px);
    margin: 0 16px 16px 16px;
    padding: 12px 20px;
    background: #ef4444; /* Red background */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: sticky;
    bottom: 0;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}


.select-all-container {
    padding-top: 0px;
    margin: 0px;
}

.table-toggle-btn {
    background: transparent;
    border: none;
    font-weight: 500;
    color: #ef4444; /* Red text */
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.section-divider {
  border: none;
  border-bottom: 1px solid #ddd;
  margin: 4px 0 10px 0;
}
.table-generate-btn:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}


.table-generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

/* ============================================
   DIALOG STYLES
   ============================================ */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(10, 30, 66, 0.6); /* Navy overlay */
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in;
}


.confirm-dialog-overlay.fade-out {
    animation: fadeOut 0.3s ease;
}

.confirm-dialog {
    position: relative;
    background-color: rgba(10, 30, 66, 0.95);
    color: white;
    padding: 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(239, 68, 68, 0.3);
    max-width: 400px;
    min-width: 300px;
    animation: scaleIn 0.3s ease-out;
}

.confirm-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
}

.confirm-dialog-btn {
    padding: 10px 20px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.confirm-dialog-btn-cancel {
    background: rgba(248, 250, 252, 0.8);
    color: #64748b;
    backdrop-filter: blur(10px);
}

.confirm-dialog-btn-cancel:hover {
    background: rgba(226, 232, 240, 0.9);
    color: #475569;
}

.confirm-dialog-btn-confirm {
    background: #ef4444;
    color: white;
    border-color: transparent;
}

.confirm-dialog-btn-confirm:hover {
    background: #dc2626;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.options-container::-webkit-scrollbar-thumb,
.table-dropdown-content::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 3px;
}

/* Project Name Input */
.project-name-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 16px 0;
    transition: all 0.3s ease;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    color: #1e293b;
}

.project-name-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: rgba(248, 250, 252, 0.95);
}

.project-name-input::placeholder {
    color: #94a3b8;
}

/* ============================================
   SCROLLBAR STYLES
   ============================================ */
.options-container::-webkit-scrollbar,
.table-dropdown-content::-webkit-scrollbar,
.messages::-webkit-scrollbar {
    width: 6px;
}

.options-container::-webkit-scrollbar-track,
.table-dropdown-content::-webkit-scrollbar-track,
.messages::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.5);
    border-radius: 3px;
}

.options-container::-webkit-scrollbar-thumb,
.table-dropdown-content::-webkit-scrollbar-thumb ,
.messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border-radius: 3px;
}

.options-container::-webkit-scrollbar-thumb:hover,
.table-dropdown-content::-webkit-scrollbar-thumb:hover,
.messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    .toolbar {
        padding: 6px 12px;
        gap: 8px;
        min-height: auto;
    }
    
    .toolbar-actions {
        gap: 12px;
    }
    
    .project-dropdown {
        min-width: 180px;
        max-width: calc(100vw - 40px);
    }
    
    .selected-option,
    .dropdown-option {
        padding: 8px 12px;
    }
    
    .selected-option span,
    .dropdown-option span {
        font-size: 12px;
    }
    
    .table-dropdown {
        right: 12px;
        min-width: 260px;
        max-width: calc(100vw - 24px);
    }
    
    .table-dropdown-content {
        max-height: 250px;
        padding: 12px;
    }
    
    .confirm-dialog {
        padding: 20px;
        min-width: 300px;
        max-width: calc(100vw - 32px);
    }
}

@media (max-width: 480px) {
    .toolbar {
        padding: 4px 8px;
    }
    
    .toolbar-actions {
        gap: 8px;
    }
    
    .toolbar-icon {
        font-size: 14px;
        padding: 4px;
    }
    
    .project-dropdown {
        min-width: 160px;
    }
    
    .table-dropdown {
        min-width: 240px;
    }
}

/* ============================================
   ACCESSIBILITY & FOCUS STATES
   ============================================ */
.selected-option-container:focus-within,
.toolbar-icon:focus,
.table-checkbox:focus,
.confirm-dialog-btn:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: 2px;
}

.dropdown-option:focus {
    outline: 2px solid #8b5cf6;
    outline-offset: -2px;
    background: rgba(139, 92, 246, 0.1);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.fade-out-item {
    animation: fadeOutItem 0.3s ease forwards;
}

@keyframes fadeOutItem {
    from {
        opacity: 1;
        transform: translateX(0);
        height: auto;
        padding: 10px 14px;
        margin-bottom: 2px;
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
        height: 0;
        padding: 0 14px;
        margin-bottom: 0;
    }
}

/* Smooth box-sizing for all elements */
* {
    box-sizing: border-box;
}

/* Hide elements smoothly */
.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}
/*styles for the dropdown menu for displaying projects just below the header end*/
.messages {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    height: calc(100% - 180px);
    /* padding: 10px; */
    flex: 1;
    padding: min(24px, calc(8px + 0.5vw));
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: min(16px, calc(12px + 0.3vw));
    box-sizing: border-box;
    align-items: flex-start;
    
}

.message {
    display: flex;
    gap: min(12px, calc(8px + 0.3vw));
    max-width: min(85%, calc(85% + 0.5vw));
    box-sizing: border-box;
    margin-top: 10px;
    padding-top: 8px;
    border-radius: 8px;
    /* max-width: 80%; */
    align-items: flex-start;
    position: relative;
}

.messages::-webkit-scrollbar {
    width: 8px; /* Width of vertical scrollbar */
}

.messages::-webkit-scrollbar-track {
    background: transparent; /* or #f0f0f0 for visible track */
}

.messages::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2); /* Scrollbar handle */
    border-radius: 10px;
    border: 2px solid transparent; /* Creates padding effect */
    background-clip: content-box;
}

.messages::-webkit-scrollbar-thumb:hover {
    background-color: rgb(255, 255, 255);
}


.message.user {
    flex-direction: row-reverse;
    align-self: flex-end;
    margin-left: auto;
    position: relative;
}

.message.assistant {
    margin-right: auto;
}

.message.assistant .outer-context-div {
    justify-content: flex-start;
    /* align-items: flex-start; */
}
.user-actions {
    position: sticky;
    top: 0;
    right: 0;
    margin-left: auto;
    margin-right: 5px;
    background: white;
    padding: 4px;
    border-radius: 6px;
    z-index: 5;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}



/* Show on hover */
.message:hover .user-actions {
    opacity: 1;
    pointer-events: auto;
    box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.1);

}

.insert-deck-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: 8px;
    border: 1px solid #27ae60;
    background-color: #edfaf1;
    color: #1e8449;
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.insert-deck-cta:hover {
    background-color: #d5f5e3;
}

.insert-deck-cta:disabled {
    opacity: 0.65;
    cursor: default;
}

.avatar {
    width: clamp(24px, calc(24px + 0.5vw), 32px);
    height: clamp(24px, calc(24px + 0.5vw), 32px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(12px + 0.2vw);
    flex-shrink: 0;
    font-size: 24px;
    min-width: 24px;
    text-align: center;
    color: #1d1777;
}

.content {
    display: flex;
    flex-direction: column;
    background: #f0f0f0;
    font-size: clamp(12.5px, 2cqw, 14px);    
    padding: clamp(9.375px, 1.5cqw, 10.5px) clamp(12px, 2cqw, 16px);
    border-radius: 8px;
    line-height: 2;
    box-sizing: border-box;
    word-wrap: break-word;
    white-space: normal;
    word-break: break-word;
    width: 100%;
    position: relative;
    overflow: visible; /* Ensure content doesn't trigger unwanted scrollbars */
}


.content p{
    margin: 0;

}
.content a{
    position: relative;
    padding: 6px 12px;
    border-radius: 16px;
    background-color: #f0f2f5;
    cursor: pointer;
    transition: background-color 0.2s ease;

}

.content code {
    background-color: #f0f0f0;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: monospace;
}

.content pre {
    background-color: #f5f5f5;
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
}

.content ul, .content ol {
    padding-left: 2em;
}

.content blockquote {
    border-left: 4px solid #ddd;
    padding-left: 1em;

    color: #666;
}

.message.user .content {
    background: #1f6feb;
    color: #ffffff;
    position: relative;
    padding-bottom: min(12px, calc(9px + 0.3vw));
}

.message.user .content a {
    background-color: transparent;
    color: #ffffff;
    text-decoration: underline;
    padding: 0;
    border-radius: 0;
}



/* Wrap table in a scroll container */
.content table {
  display: block;
  overflow-x: auto;
  white-space: nowrap;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

/* Optional: Styling for table cells */
.content th,
.content td {
  padding: 0.5rem 1rem;
  border: 1px solid #ccc;
  text-align: left;
}

/* Optional: Add background to headers */
.content thead {
  background-color: #f9f9f9;
  font-weight: bold;
}


 /*.preference-container {
    width: 95%;
    padding: min(24px, calc(8px + 0.3vw));
    box-sizing: border-box;
    background-color: rgb(224, 224, 224);
    border-top: 1px solid rgb(204, 204, 204);
    border-radius: 8px;
    gap: 12px;
    margin: 2.5%;
 }*/

.preference-container {
    width: 95%;
    padding: min(24px, calc(8px + 0.3vw));
    box-sizing: border-box;

    background-color: #f2f2f2;
    border-radius: 10px;

    /* very subtle depth */
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.8),
        inset 0 -1px 0 rgba(0, 0, 0, 0.06);

    /* quiet red accent */
    border: 1px solid rgba(239, 68, 68, 0.25);

    margin: 2.5%;

}




.input-container {
    width: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: min(12px, calc(6px + 0.2vw));
}

.input-wrapper {
    display: flex;
    gap: calc(6px + 0.2vw);
    width: 100%;
}

textarea {
    flex: 1;
    background: #ffffff; /* reminds eye it's an input */
    border: 1px solid rgba(0, 0, 0, 0.12); /* soft outline */
    border-radius: 8px;
    color: #000000;
    font-family: inherit;
    font-size: clamp(13px, calc(13px + 0.2vw), 16px);
    padding: min(12px, calc(6px + 0.2vw)) min(16px, calc(10px + 0.3vw));
    resize: none;
    box-sizing: border-box;

    /* subtle depth */
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.05);

    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    max-height: 150px;
    overflow-y: hidden;
    width: calc(100% - min(48px, calc(32px + 0.5vw)) - min(12px, calc(6px + 0.2vw)));
}



textarea:focus {
    outline: none;
    border-color: rgba(239, 68, 68, 0.6);
    box-shadow:
        inset 0 1px 2px rgba(0, 0, 0, 0.05),
        0 0 0 1px rgba(239, 68, 68, 0.25);
}


#sendButton {
    background: #f82222; /* Red button */
    border: none;
    border-radius: 6px;
    color: white;
    width: clamp(32px, calc(32px + 0.5vw), 48px);
    height: clamp(32px, calc(32px + 0.5vw), 48px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}



#sendButton:hover {
    background: #dc2626;
    transform: scale(1.05);
}

#sendButton:disabled {
    background: #404040;
    cursor: not-allowed;
    transform: none;
}


/* Update toggle container to be horizontal */
.toggle-container {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    gap: min(24px, calc(16px + 1vw));
    padding-top: min(16px, calc(8px + 0.5vw));
    width: 100%;
}

.toggle-group {
    display: flex;
    align-items: center;
    gap: min(12px, calc(8px + 0.2vw));
    min-width: fit-content;
}

/* Update toggle label for better visibility */
.toggle-label {
    font-size: clamp(11px, calc(11px + 0.1vw), 14px);
    color: #8b949e;
    white-space: nowrap;
    font-weight: bold;
}

/* Make switches more compact */
.switch {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 16px;
    flex-shrink: 0;
}

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

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #9b9b9b;
    transition: .4s;
    border: 1px solid #404040;
}

.slider:before {
    position: absolute;
    content: "";
    height: 10px;
    width: 10px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
}

.slider.round {
    border-radius: 16px;
}

.slider.round:before {
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #ef4444; /* Red toggle */
}


input:checked + .slider:before {
    transform: translateX(14px);
}

/* Add after existing styles */
.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 15px;
    padding: 20px;
    text-align: center;
}

.welcome-icon {
    width: 128px;
    height: 128px;
    object-fit: contain;
}

.welcome-text {
    font-size: clamp(20px, calc(20px + 0.5vw), 28px);
    color: #0b1544;
    margin: 0;
    font-weight: 600;
}

.create-presentation-btn {
    padding: 12px 20px;
    background: transparent;
    color: #0b1544;
    border: 1px solid #ef4444;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: sticky;
    bottom: 0;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 200px;
    margin-left: 40px;
}


.create-presentation-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.3);
    transform: translateY(-2px);
}
.additional-btns{
    padding: 12px 20px;
    background: transparent;
    color: #0B3244;
    border: solid 1px #483D8B;
    border-radius: 10px;
    font-size: 14px;    
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: sticky;
    bottom: 0;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 200px;
    margin: 3px;
}
.confidence-filter-buttons{
    margin-left: clamp(40px, calc(40px + 0.5vw), 48px);

}

/* .create-presentation-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(23, 23, 24, 0.3);
} */

.login-container {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-radius: 8px;
    min-width: 300px;
    max-width: 300px;
}

.login-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

.login-form button:active {
    transform: scale(0.98);
}

#displayArea {
    height: 100vh;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.bx-log-out {
    cursor: pointer;
    transition: color 0.3s ease;
}


.references {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.references-title {
    font-weight: bold;
    margin-bottom: 5px;
    color: #666;
    font-size: 12px;
}

.reference-item {
    font-size: 12px;
    padding: 4px 0;
    color: #666;
    display: flex;
    gap: 8px;
    align-items: center;
}

.ref-file {
    color: #0f216e;
    font-weight: 500;
}

.ref-page {
    color: #666;
}

.ref-score {
    color: #888;
    font-size: 11px;
}

.references-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.references-bubbles:has(.slide-row) {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
}

.reference-bubble {
    position: relative;
    padding: 6px 12px;
    border-radius: 16px;
    background-color: #f0f2f5;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reference-link {
    padding: 2px 4px;
    border-radius: 50%;
    font-size: 9px;
}


.reference-bubble:hover{
    background-color: #e4e6eb;
}

.reference-bubble:hover .hover-box{
  opacity: 1;
  visibility: visible;
}
.hover-box {
    position: fixed; /* Fixed positioning instead of absolute */
    visibility: hidden;
    opacity: 0;
    width: 280px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transform: translateX(-50%);
    pointer-events: none; /* Initially no pointer events */
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.hover-box.visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto; /* Enable pointer events when visible */
}


.reference-bubble:hover .hover-box {
    display: block;
}

/* ── Slide row (edit-flow card layout) ───────────────────────── */
.slide-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: #fafbfc;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.slide-row:hover {
    background: #f8f9fb;
    border-color: rgba(0, 0, 0, 0.1);
}

.slide-row__type-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
}

.slide-row--new .slide-row__type-icon      { background: #2563eb; }
.slide-row--modified .slide-row__type-icon { background: #ef4444; }

.slide-row__title {
    flex: 1;
    font-size: 12.5px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1e293b;
}

.slide-row__apply-btn {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #b0b0b0;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.slide-row__apply-btn:hover {
    background: rgba(15, 33, 110, 0.07);
    color: #0f216e;
}

.slide-row__apply-btn--done {
    color: #0f216e !important;
    cursor: default;
    background: transparent !important;
}

.slide-list-apply-all {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
    padding: 9px 14px;
    border-radius: 8px;
    border: 1px solid rgba(15, 33, 110, 0.2);
    background: rgba(15, 33, 110, 0.05);
    color: #0f216e;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.slide-list-apply-all:hover    { background: rgba(15, 33, 110, 0.1); }
.slide-list-apply-all:disabled { background: rgba(15, 33, 110, 0.05); color: #0f216e; opacity: 0.6; cursor: default; }

.slide-row__inline-preview {
    width: 100%;
    box-sizing: border-box;
    margin: 2px 0 4px;
    padding: 10px;
    border-radius: 8px;
    background: #f5f7fa;
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 11px;
    color: #64748b;
    line-height: 1.4;
}
/* ── end slide-row ───────────────────────────────────────────── */

.hover-box-content {
    padding: 12px;
}

.hover-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.doc-icon {
    font-size: 18px;
}

.doc-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: auto;

}

.doc-name::-webkit-scrollbar {
  display: none;               /* Hide scrollbar in Chrome, Safari, and Opera */
}

.hover-details {
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
    color: #666;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-item i {
    font-size: 12px;
    color: #0f216e;
}

.hover-content {
    font-size: 13px;
    line-height: 1.5;
    max-height: 200px;
    overflow-y: auto;
    padding: 8px;
    background: #f9f9f9;
    border-radius: 4px;
}

.hover-content::-webkit-scrollbar {
    width: 3px;
}

.hover-content::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 1.5px;
}

.hover-arrow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 16px;
    height: 8px;
    overflow: hidden;
    top: -8px; /* Default position - pointing up */
}

[data-arrow-position="top"] .hover-arrow {
    top: -8px;
    bottom: auto;
}

/* Bottom arrow - when tooltip appears above the bubble */
[data-arrow-position="bottom"] .hover-arrow {
    top: auto;
    bottom: -8px;
    transform: translateX(-50%) rotate(180deg);
}

.hover-arrow:after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    background: white;
    transform: translateX(-50%) translateY(25%) rotate(45deg);
    left: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
}
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(10, 30, 66, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    animation: fadeInTop 0.3s ease-in;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.notification.fade-out {
    animation: fadeOutTop 0.3s ease-out;
}

@keyframes fadeInTop {
    from { 
        opacity: 0; 
        transform: translate(-50%, -20px); 
    }
    to { 
        opacity: 1; 
        transform: translate(-50%, 0); 
    }
}

@keyframes fadeOutTop {
    from { 
        opacity: 1; 
        transform: translate(-50%, 0); 
    }
    to { 
        opacity: 0; 
        transform: translate(-50%, -20px); 
    }
}

/* ─── Knowledge update chips ─── */
.knowledge-chips {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    padding: 0;
    border-left: 2px solid #c0c0c0;
    padding-left: 10px;
}

.knowledge-chips__header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.knowledge-chips__header svg {
    opacity: 0.6;
}

.knowledge-chips__list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.knowledge-chip {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 1.5;
    color: #333;
    background: transparent;
    border: none;
    max-width: 100%;
    word-break: break-word;
    transition: background-color 0.15s ease;
}

.knowledge-chip:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.knowledge-chip--user .knowledge-chip__label {
    color: #6b5ce7;
    background: rgba(107, 92, 231, 0.08);
}

.knowledge-chip__label {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 1px 6px;
    border-radius: 3px;
    color: #888;
    background: rgba(0, 0, 0, 0.05);
}

.knowledge-chip__text {
    flex: 1;
    min-width: 0;
    color: #444;
}

.knowledge-chip__dismiss {
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 2px;
    color: #999;
    opacity: 0;
    border-radius: 3px;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.knowledge-chip:hover .knowledge-chip__dismiss {
    opacity: 1;
}

.knowledge-chip__dismiss:hover {
    color: #e24;
}

.knowledge-chip.removing {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, height 0.2s ease, padding 0.2s ease;
}

.context-display {
    display: flex;
    align-items: center;
    /* padding: 2px 4px; */
    /* background-color: #f5f5f5; */
    border-radius: 6px; 
    /* margin-bottom: 18px; */
    font-size: 18px;
    color: #333;
    /* box-shadow: 0 1px 2px rgba(0,0,0,0.1); */
    position: relative;
    font-family: monospace;
    white-space: nowrap;
}

.clipboard-button {
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    color: #0f216e;
    transition: background-color 0.2s ease;
}

.clipboard-button:hover {
    background-color: #dcdcdc;
}

.clipboard-button i {
    font-size: 14px;
}

.clear-clipboard-button {
    background-color: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 4px;
    color: #c53030;
    transition: background-color 0.2s ease;
}

.clear-clipboard-button:hover {
    background-color: #ffdddd;
}

.clear-clipboard-button i {
    font-size: 12px;
}

.favicon {
    width: 12px;
    height: 12px;
    vertical-align: middle;
}

/* Context source indicators */
.context-sources-indicator {
    display: flex;
    margin-left: auto;
    gap: 6px;
}

.context-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
}

.clipboard-indicator {
    background-color: #ef4444; /* Red */
}

.page-indicator {
    background-color: #f97316; /* Orange */
}

.doc-indicator {
    background-color: #0a1e42; /* Navy */
}

.context-indicator i {
    font-size: 12px;
}

.reset-context-button {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: transparent;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}



.reset-context-button i {
    font-size: 12px;
}

.outer-context-div {
    display: flex;
    /* flex-direction: column; */
    justify-content: flex-end;
    /* flex-direction: column-reverse; */
    align-items: flex-end;
    width: 100%;
    position: relative;
    overflow: visible; /* Changed from overflow-y: auto */
}


.outer-context-div.user{
    flex-direction: column;

}
.outer-context-div.assistant{
    flex-direction: column;
}


.outer-context-div copy{
    justify-content: start;
    align-items: start;

}
.context-label-home {
    color: #24292f;
    font-size: 12px;
}

.context-text {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
}

/* Add to your popup.css */
.edit-button {
    position: static;
    right: -24px;
    bottom: 8px;
    background: none;
    border: none;
    color: rgba(15, 33, 110, 0.6);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 1;
    font-size: 11px;
    display: inline-block;
}


.edit-button:hover {
    color: #0f216e;
    /* background: rgba(15, 33, 110, 0.1); */
}

/* Styles of the generated answer display (concise or detailed) start*/
.answer-display-style{
    position: static;
    color: rgba(15, 33, 110, 0.6);
    padding: 4px;
    transition: all 0.2s ease;
    opacity: 1;
    font-size: 11px;
    border-radius: 4px;
}

.answer-display-style:hover {
    color: #0f216e;
    /* background: rgba(15, 33, 110, 0.1); */
}
/*Styles of the generated answer display (concise or detailed) end*/


.copy-notification {
    position: absolute;
    top: 60px;
    right: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 12px;
    animation: fadeIn 0.3s ease;
    z-index: 100;
}

.copy-notification.fadeOut {
    animation: fadeOut 0.5s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}




/* Context Card Styles */
.context-card-container {
    display: flex;
    flex-direction: column;
    background-color: #fff;

    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.context-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: min(16px, calc(8px + 0.5vw)) min(24px, calc(12px + 1vw));
    background-color: #0a1e42; /* Navy */
    color: white;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
}

.context-back-button, 
.context-copy-button, 
.reset-context-button {
    background: none;
    border: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    color: #ffffff;
    transition: background-color 0.2s;
}


.reset-context-button {
    margin-left: auto;
    color: #d32f2f;
}



.context-card-header span {
    font-size: 16px;
    font-weight: 500;
    flex-grow: 1;
}

.context-card-header i {
    margin-right: 8px;
}

.context-card-content {
    padding: 16px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Metadata section */
.context-metadata-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eaeaea;
}

.context-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #333;
}

.context-url {
    font-size: 14px;
    color: #666;
    word-break: break-all;
}

.context-url a {
    color: #1976d2;
    text-decoration: none;
}

.context-url a:hover {
    text-decoration: underline;
}

/* Cursor data section */
.context-cursor-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eaeaea;
}

.context-cursor-section h3,
.context-full-document h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333;
}

.cursor-location,
.selected-text {
    margin-bottom: 16px;
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #2196f3;
}

.context-label {
    font-weight: 500;
    margin-bottom: 6px;
    color: #555;
    font-size: 12px;
}

.cursor-text,
.selected-text-content {
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    color: #333;
}

.selected-text {
    border-left-color: #4caf50;
}

/* Full document section */
.context-full-document {
    margin-bottom: 16px;
}

.document-text-container {
    background-color: #f8f9fa;
    padding: 16px;
    border-radius: 6px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Notification styles */
.copy-notification,
.global-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #323232;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 1000;
    font-size: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: fadeIn 0.3s ease;
}

.fadeOut {
    opacity: 0;
    transition: opacity 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Error message styles */
.context-error-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.error-message {
    text-align: center;
    padding: 20px;
    background-color: #fff3f3;
    border-radius: 8px;
    border: 1px solid #ffcdd2;
    max-width: 400px;
}

.error-message i {
    font-size: 48px;
    color: #d32f2f;
    margin-bottom: 16px;
}

.error-message p {
    color: #333;
    margin-bottom: 16px;
}

#error-back-button {
    background-color: #f44336;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

#error-back-button:hover {
    background-color: #d32f2f;
}




/* User Dropdown */
.dropdown {
    position: relative;
    display: flex;
    align-items: center;  /* Added for proper alignment */
}

.dropbtn {
  cursor: pointer;
}

.user-profile-icon {
    font-size: 28px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.85;
}

.user-profile-icon:hover {
    opacity: 1;
    transform: scale(1.1);
    color: #ef4444;
}

/* Dropdown Content - IMPROVED POSITIONING */
.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%; /* Reduced gap from 8px to 4px */
    background: rgba(248, 250, 252, 0.98);
    backdrop-filter: blur(20px);
    min-width: 160px;
    box-shadow: 0 8px 32px rgba(30, 58, 138, 0.2);
    border-radius: 12px;
    border: 1px solid rgba(203, 213, 225, 0.3);
    overflow: hidden;
    z-index: 1001;
    animation: dropdownSlideIn 0.3s ease;
}

.dropdown-content::after {
    content: '';
    position: absolute;
    top: -8px; /* Cover the gap */
    right: 0;
    width: 100%;
    height: 8px;
    background: transparent;
}

.dropdown-content a {
    color: #1e293b;
    padding: 10px 14px;  /* Reduced from 12px 16px */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;  /* Reduced from 14px */
    font-weight: 500;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(203, 213, 225, 0.3);
}

.dropdown-content a:last-child {
    border-bottom: none;
}


.dropdown-content::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 12px;
    width: 12px;
    height: 12px;
    background: rgba(248, 250, 252, 0.98);
    border: 1px solid rgba(203, 213, 225, 0.3);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

.dropdown-content a:hover {
    background: rgba(59, 130, 246, 0.08);
    color: #1d4ed8;
    padding-left: 18px;
}

.dropdown-content a i {
    font-size: 14px;
    opacity: 0.7;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* header drop down properties end*/

/* styles for the confirmation dialog */

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

.confirm-dialog {
    position: relative;
    background-color: rgba(15, 33, 110, 0.95);
    color: white;
    padding: 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-width: 400px;
    min-width: 300px;
    animation: scaleIn 0.3s ease-out;
}

.confirm-dialog-message {
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 15px;
    white-space: pre-line;
}

.confirm-dialog-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-dialog-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.confirm-dialog-btn-cancel {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.confirm-dialog-btn-cancel:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.confirm-dialog-btn-confirm {
    background-color: #dc3545;
    color: white;
}

.confirm-dialog-btn-confirm:hover {
    background-color: #c82333;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.confirm-dialog-overlay.fade-out {
    animation: fadeOut 0.3s ease-out;
}

.confirm-dialog-overlay.fade-out .confirm-dialog {
    animation: scaleOut 0.3s ease-out;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes scaleOut {
    from { 
        opacity: 1;
        transform: scale(1);
    }
    to { 
        opacity: 0;
        transform: scale(0.9);
    }
}

/* styles for the confirmation dialog end */
/* styles for the reference filter in the message*/

.reference-filter-container {
    position: absolute;
    /* top: 40px; */
    /* right: 10px; */
    z-index: 10;
}

/* .reference-filter-button {
    border: #000000;
    color:  rgba(15, 33, 110, 0.6);
    border-radius: 6px;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
} */

/* .reference-filter-button:hover {
    color: #012f6e;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
} */

/* .reference-filter-button i {
    color: rgba(15, 33, 110, 0.6);
    font-size: 14px;
} */

.reference-filter-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 5px;
    background: #fff3f3;
    border: 1px solid #323232;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(11, 21, 68, 0.15);
    min-width: 120px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.reference-filter-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.reference-filter-dropdown::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 45px;
    width: 12px;
    height: 12px;
    background: #fff3f3;
    border: 1px solid #323232;
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

.filter-option {
    padding: 4px 8px;
    border-bottom: 1px solid rgba(50, 50, 50, 0.1);
}

.filter-option:last-child {
    border-bottom: none;
}

.filter-option label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
    color: #0b1544;
    font-weight: 500;
    position: relative;
    padding-left: 24px;
}

.filter-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    left: 0;
    top: 0;
    width: 14px;
    height: 14px;
}

.checkmark {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 16px;
    width: 16px;
    background-color: transparent;
    border: 1px solid #323232;
    border-radius: 3px;
    transition: all 0.2s ease;
}

.filter-option input[type="checkbox"]:checked ~ .checkmark {
    background-color: #1976d2;
    border-color: #1976d2;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #fff3f3;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.filter-option input[type="checkbox"]:checked ~ .checkmark:after {
    display: block;
}

.filter-option:hover {
    background-color: rgba(25, 118, 210, 0.05);
}

.filter-option:hover .checkmark {
    border-color: #1976d2;
}

/* Ensure the outer context div has relative positioning for absolute positioning of filter */
.outer-context-div {
    position: relative;
}

/* styles for the reference filter in the message end*/


/* ============================================
   PREFERENCE OPTIONS LAYOUT STYLES
   ============================================ */

.preference-options {
    display: flex;
    align-items: center;
    gap: 16px; /* Space between contextDiv and dropdown */
    padding: 8px 0;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */

}



/* Project dropdown in header */
.header .project-dropdown {
    margin: 0 auto;
    max-width: 200px;
    flex: 1;
}

/* Adjust header spacing */
.header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
}

/* Options container with scroll */
.options-container {
    max-height: 280px !important; /* ~7 items at 40px each */
    overflow-y: auto !important;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.options-container::-webkit-scrollbar {
    width: 6px;
}

.options-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.options-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.options-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Dropdown option height */
.dropdown-option {
    min-height: 40px;
    display: flex;
    align-items: center;
    padding: 8px 12px;
}




/* Shared Docs Button - Updated Style */
.shared-docs-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: #ffffff;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    backdrop-filter: blur(10px);
}

.shared-docs-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.3);
}

.shared-docs-btn:active {
    transform: translateY(0);
}

.shared-docs-btn i {
    font-size: 13px;
    opacity: 0.9;
}


/* Shared Docs Indicator - REDUCED SIZE */
/* Shared Docs Indicator - RED THEME */
.shared-docs-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #f7f4f4;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    backdrop-filter: blur(10px);
    animation: pulseGlow 2s ease-in-out infinite;
}

.shared-docs-indicator i {
    font-size: 13px;
    animation: spin 3s linear infinite;
    filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.5));
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
    }   
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
} 

/* Toolbar Spacer */
.toolbar-spacer {
    flex: 1;
    min-width: 20px;
}



/* Control Panel Container */
.header-container {
    background: linear-gradient(135deg, #0a1e42 0%, #0c2547 50%, #0e2d52 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1000;
}


/* Navigation Section - Left Side */
.nav-section-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

/* User Controls - Right Side - FIXED ALIGNMENT */
.nav-section-right {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

/* Project Controls Group - REDUCED PADDING */
.project-controls-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;  /* Reduced from 6px 12px */
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
}


/* Vertical Divider */
.nav-divider {
    width: 1px;
    height: 24px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    margin: 0 4px;
}



/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* Responsive adjustments */
@media (max-width: 768px) {
    .header {
        padding: 6px 12px;
        min-height: 40px;
    }
    
    .toolbar {
        padding: 5px 12px;
        min-height: 36px;
    }
    
    .project-controls-group {
        padding: 3px 8px;
    }
    
    .shared-docs-btn span {
        display: none;
    }
    
    .toolbar-icon-labeled span {
        display: none;
    }
    
    .nav-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    .header {
        flex-wrap: wrap;
        min-height: auto;
    }
    
    .project-controls-group {
        order: 1;
        width: 100%;
        justify-content: space-between;
    }
    
    .nav-section-right {
        order: 2;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   DISABLED STATE
   ============================================ */

.selected-option-container.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: rgba(248, 250, 252, 0.4);
}

.selected-option-container.disabled:hover {
    background: rgba(248, 250, 252, 0.4);
    transform: none;
}

/* ============================================
   PLAN REVIEW (adapt presentation flow)
   ============================================ */

.plan-review-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.plan-review-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.plan-review-btn--approve {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.plan-review-btn--approve:hover {
    background: rgba(34, 197, 94, 0.25);
}

.plan-review-btn--feedback {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.plan-review-btn--feedback:hover {
    background: rgba(59, 130, 246, 0.2);
}

.plan-review-feedback-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.plan-review-feedback-input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(203, 213, 225, 0.5);
    background: rgba(248, 250, 252, 0.8);
    font-size: 12px;
    color: #1e293b;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.plan-review-feedback-input:focus {
    outline: none;
    border-color: rgba(59, 130, 246, 0.5);
}

.plan-rows { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }

.plan-row {
    border: 1px solid rgba(203, 213, 225, 0.4);
    border-radius: 6px;
    background: rgba(248, 250, 252, 0.6);
    overflow: hidden;
}
.plan-row__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    cursor: pointer;
    font-size: 12px;
}
.plan-row__icon { flex: 0 0 auto; color: #64748b; }
.plan-row__pos { flex: 0 0 auto; font-weight: 600; color: #1e293b; }
.plan-row__short { flex: 1 1 auto; color: #334155; }
.plan-row__chevron { flex: 0 0 auto; color: #94a3b8; font-size: 10px; }

.plan-row__details {
    display: none;
    padding: 0 10px 10px 30px;
    font-size: 11.5px;
    line-height: 1.5;
    color: #475569;
}
.plan-row--open .plan-row__details { display: block; }
.plan-row__layout { color: #94a3b8; font-size: 10.5px; margin-bottom: 4px; }
.plan-row__brief { white-space: pre-wrap; }

.plan-row--delete {
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(254, 242, 242, 0.7);
}
.plan-row--delete .plan-row__head { cursor: default; }
.plan-row--delete .plan-row__icon { color: #dc2626; }
.plan-row--delete .plan-row__pos { color: #b91c1c; text-decoration: line-through; }
.plan-row--delete .plan-row__short { color: #b91c1c; }

.plan-feedback-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    font-size: 12px;
    color: #1d4ed8;
    margin-bottom: 6px;
}

.plan-feedback-hint-cancel {
    margin-left: auto;
    background: none;
    border: none;
    color: #1d4ed8;
    font-size: 12px;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}

/* ============================================
   EDIT REVIEW (edit presentation flow)
   ============================================ */

.edit-review-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 8px 0;
}

.edit-review-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 12px;
    transition: opacity 0.3s ease;
}

.edit-review-card.accepted {
    opacity: 0.5;
    border-color: rgba(34, 197, 94, 0.4);
}

.edit-review-card.rejected {
    opacity: 0.5;
    border-color: rgba(239, 68, 68, 0.4);
}

.edit-review-header {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: #e2e8f0;
}

.edit-review-summary {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 8px;
    line-height: 1.4;
}

.edit-review-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    margin-bottom: 6px;
    margin-right: 4px;
}

.badge-selected {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.badge-consistency {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
}

.badge-flagged {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.edit-review-image {
    width: 100%;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.edit-review-buttons {
    display: flex;
    gap: 8px;
}

.edit-review-bulk-buttons {
    display: flex;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 4px;
}

.edit-review-btn {
    flex: 1;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.edit-review-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.accept-btn {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.accept-btn:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.3);
}

.reject-btn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.reject-btn:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.3);
}

/* ============================================
   SETTINGS PAGE
   ============================================ */

.settings-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: linear-gradient(135deg, #0a1628 0%, #1a2744 50%, #0f1d36 100%);
    color: #ffffff;
}

.settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-back-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.settings-back-btn:hover {
    opacity: 1;
}

.settings-title {
    font-size: 16px;
    font-weight: 600;
}

.settings-body {
    padding: 20px 16px;
    flex: 1;
    overflow-y: auto;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.settings-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 12px;
    line-height: 1.4;
}

.settings-toggle-row {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.settings-mode-btn {
    flex: 1;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-mode-btn:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.15);
}

.settings-mode-btn.active {
    background: rgba(59, 130, 246, 0.3);
    color: #ffffff;
    font-weight: 600;
}

.settings-mode-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}


/* Enhanced warning dialog styles */
.confirm-dialog.warning {
    border: 2px solid #ef4444;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.confirm-dialog.warning .confirm-dialog-message {
    color: #fee;
}

.confirm-dialog.warning .confirm-dialog-btn-confirm {
    background-color: #ef4444;
    animation: pulseWarning 2s ease-in-out infinite;
}

@keyframes pulseWarning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}


/* Disabled Create Presentation Button */
.create-presentation-btn.disabled {
    background: rgba(200, 200, 200, 0.3);
    color: #999;
    cursor: not-allowed;
    border-color: rgba(200, 200, 200, 0.5);
    opacity: 0.6;
}

.create-presentation-btn.disabled:hover {
    background: rgba(200, 200, 200, 0.3);
    box-shadow: none;
    transform: none;
}

/* Warning Message for Presentation Button */
/* ============================================
   RESPONSIVE WARNING MESSAGE STYLES
   ============================================ */

/* Responsive warning message for missing files */
.presentation-warning {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 8px;
    margin: 12px 0;
    font-size: 13px;
    color: #1e3a8a;
    animation: slideIn 0.3s ease;

    /* RESPONSIVE SIZING */
    width: calc(100% - 40px);  /* Responsive width */
    max-width: 450px;
    margin-left: clamp(36px, 5vw, 40px);  /* Responsive left margin */
    box-sizing: border-box;
}

.presentation-warning i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 16px;
    color: #2563eb;
}

.presentation-warning span {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive adjustments for different container widths */
@media (max-width: 500px) {
    .presentation-warning {
        font-size: 12px;
        padding: 10px 12px;
        gap: 8px;
        margin-left: clamp(24px, 4vw, 36px);
        width: calc(100% - 24px);
    }
    
    .presentation-warning i {
        font-size: 14px;
    }
}

@media (max-width: 400px) {
    .presentation-warning {
        font-size: 11px;
        padding: 8px 10px;
        gap: 6px;
        margin-left: clamp(16px, 3vw, 24px);
        width: calc(100% - 16px);
    }
    
    .presentation-warning i {
        font-size: 13px;
    }
}

@media (min-width: 600px) {
    .presentation-warning {
        font-size: 14px;
        padding: 14px 18px;
        margin-left: clamp(40px, 6vw, 48px);
    }
    
    .presentation-warning i {
        font-size: 17px;
    }
}


/* ============================================
   USAGE LIMIT BANNER (above chat input)
   ============================================ */
.usage-limit-banner {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(251, 146, 60, 0.10);
    border: 1px solid rgba(251, 146, 60, 0.40);
    border-radius: 8px;
    margin: 4px 0 6px 0;
    font-size: 13px;
    color: #92400e;
    width: 100%;
    box-sizing: border-box;
}

.usage-limit-banner i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 15px;
    color: #d97706;
}

.usage-limit-banner span {
    flex: 1;
    line-height: 1.5;
    word-wrap: break-word;
}

@keyframes limitBannerPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

.usage-limit-banner--pulse {
    animation: limitBannerPulse 0.3s ease-in-out 2;
}


/* ============================================
   RFP PARAMETER FORM STYLES - UPDATED
   ============================================ */

.rfp-parameter-form-container {
    background: linear-gradient(135deg, #fafbfc 0%, #f5f7f9 100%);
    border: 1px solid rgba(180, 100, 100, 0.25);
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rfp-parameter-form-container.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* Form Header */
.rfp-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(180, 100, 100, 0.2);
}

.rfp-form-header i {
    font-size: 24px;
    color: rgba(180, 100, 100, 0.6);
}

.rfp-form-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #0a1e42;
}

/* Form Description */
.rfp-form-description {
    margin: 0 0 20px 0;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

/* Form Fields Container */
.rfp-form-fields {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 20px;
}

/* Individual Form Field */
.rfp-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rfp-form-field.invalid {
    animation: shake 0.4s ease;
}

.rfp-form-field.invalid .rfp-select-input,
.rfp-form-field.invalid .rfp-toggle-container {
    border-color: rgba(200, 100, 100, 0.4) !important;
    box-shadow: 0 0 0 3px rgba(200, 100, 100, 0.1);
}

/* Field Label */
.rfp-field-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 4px;
}

.required-indicator {
    color: rgba(180, 80, 80, 0.6);
    font-size: 16px;
}

/* Field Hint */
.rfp-field-hint {
    margin: 0;
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

/* Input Container */
.rfp-input-container {
    width: 100%;
}

/* Select Input */
.rfp-select-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rfp-select-input:hover {
    border-color: #94a3b8;
}

.rfp-select-input:focus {
    outline: none;
    border-color: rgba(180, 100, 100, 0.5);
    box-shadow: 0 0 0 3px rgba(180, 100, 100, 0.1);
}

.rfp-select-input option {
    padding: 10px;
}

/* Toggle Container */
.rfp-toggle-container {
    border: 2px solid #cbd5e1;
    border-radius: 8px;
    padding: 12px;
    background: white;
    transition: all 0.2s ease;
}

.rfp-toggle-group {
    display: flex;
    gap: 12px;
}

.rfp-toggle-btn {
    flex: 1;
    padding: 8px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.rfp-toggle-btn:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.rfp-toggle-btn.active {
    border-color: rgba(180, 100, 100, 0.5);
    background: rgba(180, 100, 100, 0.08);
    color: rgba(150, 80, 80, 0.9);
}

.rfp-toggle-btn i {
    font-size: 14px;
}

/* Form Actions */
.rfp-form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid rgba(203, 213, 225, 0.5);
}

.rfp-form-submit-btn,
.rfp-form-cancel-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 90px;
    white-space: nowrap;
}

.rfp-form-submit-btn {
    background: rgba(180, 100, 100, 0.85);
    color: white;
}

.rfp-form-submit-btn:hover {
    background: rgba(170, 90, 90, 1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(180, 100, 100, 0.25);
}

.rfp-form-cancel-btn {
    background: #f1f5f9;
    color: #64748b;
}

.rfp-form-cancel-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

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

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.95);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Responsive Design */
@media (max-width: 480px) {
    .rfp-toggle-group {
        flex-direction: column;
    }
    
    .rfp-form-actions {
        flex-direction: column-reverse;
        gap: 8px;
    }
    
    .rfp-form-submit-btn,
    .rfp-form-cancel-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ─── Per-slide source attribution panel ─── */
.slide-sources {
    margin: 6px 0 8px 0;
}

/* ── Trigger: stacked avatars + count, click to expand the popover ── */
.slide-sources__trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 999px;
    padding: 3px 11px 3px 5px;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 600;
    color: #4b5563;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.slide-sources__trigger:hover {
    border-color: rgba(37, 99, 235, 0.4);
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.12);
    color: #2563eb;
}

.slide-sources__stack {
    display: inline-flex;
    align-items: center;
}

/* Each avatar overlaps the previous one, with a white ring to separate them. */
.slide-sources__stack .slide-sources__avatar {
    margin-left: -8px;
    box-shadow: 0 0 0 2px #fff;
}
.slide-sources__stack .slide-sources__avatar:first-child { margin-left: 0; }

.slide-sources__avatar {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    font-size: 10px;
    color: #fff;
    overflow: hidden;
    background: #6b7280;
}

.slide-sources__avatar--doc  { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.slide-sources__avatar--web  { background: #eef2f7; color: #6b7280; }
.slide-sources__avatar--count {
    background: #eef2f7;
    color: #4b5563;
    font-size: 9.5px;
    font-weight: 700;
}

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

.slide-sources__trigger-label { letter-spacing: 0; }

.slide-sources__chevron {
    font-size: 9px;
    opacity: 0.6;
    transition: transform 0.18s ease;
}
.slide-sources__trigger--open .slide-sources__chevron { transform: rotate(180deg); }

/* ── Popover: the expanded list ── */
.slide-sources__popover {
    margin-top: 6px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    animation: slide-sources-fade 0.16s ease;
}

@keyframes slide-sources-fade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.slide-sources__group-title {
    font-size: 10px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 6px 6px 4px 6px;
}

/* Collapsible group header (e.g. "Also consulted") */
.slide-sources__group-title--toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: color 0.15s ease;
}

.slide-sources__group-title--toggle:hover { color: #2563eb; }

.slide-sources__group-caret {
    font-size: 8px;
    transition: transform 0.18s ease;
}

.slide-sources__group-title--open .slide-sources__group-caret { transform: rotate(90deg); }

.slide-sources__group-count {
    margin-left: auto;
    font-size: 9px;
    font-weight: 700;
    color: #9ca3af;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 1px 6px;
    letter-spacing: 0;
}

.slide-sources__group-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* `display: flex` above overrides the low-specificity `hidden` attribute, so restore
   hide behaviour with a matching-specificity rule. */
.slide-sources__group-body[hidden] {
    display: none;
}

.slide-sources__item {
    border-radius: 7px;
    overflow: hidden;
    transition: background 0.15s ease;
}

.slide-sources__item:hover { background: #f5f8ff; }

.slide-sources__item--muted { opacity: 0.75; }

.slide-sources__item-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 8px;
    font-size: 12px;
    color: #374151;
}

.slide-sources__item-head .slide-sources__avatar {
    width: 20px;
    height: 20px;
    font-size: 9px;
}

.slide-sources__item-label {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
}

.slide-sources__item-sub {
    font-size: 10.5px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.slide-sources__ext {
    margin-left: auto;
    font-size: 9px;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.18s ease;
}

.slide-sources__item-head--open .slide-sources__caret { transform: rotate(180deg); }

.slide-sources__passage {
    padding: 7px 10px 9px 36px;
    font-size: 11.5px;
    line-height: 1.55;
    color: #4b5563;
    background: #fafbfc;
    border-radius: 6px;
    margin: 0 4px 4px 4px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 180px;
    overflow-y: auto;
}