/* ==================================================
   UNIFIED BUTTON STYLES - ORGANIZED BY CATEGORY
   ================================================== */

/* ==================================================
   BUTTON STYLE INDEX
   ================================================== */
/*
 * CATEGORY 1: Base Button Foundation
 *   - Bootstrap overrides and base button classes
 * 
 * CATEGORY 2: Action Buttons (Search Apps)
 *   - Used in: deep_search.html, scholar_search.html, pdf_chat.html
 *   - Base .action-btn class and all variants (clear, save, download, etc.)
 * 
 * CATEGORY 3: Sort Buttons
 *   - Used in: deep_search.html, scholar_search.html, saved_search_detail.html
 *   - .sort-btn and variants
 * 
 * CATEGORY 4: Citation Buttons
 *   - Used in: citation cards within search results
 *   - .citation-btn, .link-btn, .chat-btn, .source-link-btn
 * 
 * CATEGORY 5: Authentication Buttons
 *   - Used in: login.html, register.html, password reset pages
 *   - .login-btn, .google-login-btn
 * 
 * CATEGORY 6: Dashboard Buttons
 *   - Used in: dashboard.html, profile pages
 *   - .button-container buttons, .cancel-subscription-btn, .delete-account-btn, etc.
 * 
 * CATEGORY 7: Form Buttons
 *   - Used in: forms, dialogs, modals
 *   - .btn-primary, .btn-secondary, .btn-outline-primary, .btn-outline-danger
 * 
 * CATEGORY 8: Navigation Buttons
 *   - Used in: home.html, landing pages
 *   - .start-app-btn, .pendar-btn
 * 
 * CATEGORY 9: Peruse App Buttons
 *   - Used in: multi_pdf_chat.html, report_writer.html
 *   - .remove-pdf-btn, .edit-btn, .chat-action-button
 * 
 * CATEGORY 10: Input Group Buttons
 *   - Used in: chat input areas
 *   - .input-group-button, .input-group-buttons .btn, .btn-icon-circle-sm
 * 
 * CATEGORY 12: Utility Buttons
 *   - Small utility buttons used across the app
 *   - .copy-btn, .paper-title-btn, .delete-btn (generic), .edit-btn (generic)
 * 
 * CATEGORY 13: Navigation Pills/Tabs
 *   - Used in: peruse app navigation, home page tabs
 *   - .nav-pills .nav-link, .tab-button
 * 
 * CATEGORY 14: Dark Theme Variants
 *   - All dark theme overrides grouped together
 *
 * CATEGORY 15: Unified Chat report/sources utilities
 *   - Opt-in: .uc-btn-squircle, .uc-sources-sort-btn, .uc-citation-action-btn
 */


/* ==================================================
   CATEGORY 1: BASE BUTTON FOUNDATION
   ================================================== */
/* Bootstrap button overrides and base styles */

/* Regular button styles */
.btn-primary, .btn.btn-primary {
    position: relative;
    transition: all 0.3s;
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.btn-primary:hover, 
.btn.btn-primary:hover,
.btn.btn-primary:focus,
.btn.btn-primary:active {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: #bb2d3b !important;
    border-color: #b02a37 !important;
}

/* For outlined buttons */
.btn.btn-outline-primary {
    color: #dc3545 !important;
    border-color: #dc3545 !important;
}

.btn.btn-outline-primary:hover {
    background-color: #dc3545 !important;
    color: #fff !important;
}

/* For badges */
.badge.bg-primary {
    background-color: #dc3545 !important;
}

/* KB Card button styles */
.kb-card .btn-sm {
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
}

.kb-card .btn-primary {
    background-color: #dc3545;  /* Bootstrap's danger red */
    border-color: #dc3545;
}

.kb-card .btn-primary:hover {
    background-color: #bb2d3b;  /* darker red on hover */
    border-color: #b02a37;
}


/* ==================================================
   CATEGORY 2: ACTION BUTTONS (SEARCH APPS)
   ================================================== */
/* Used in: deep_search.html, scholar_search.html, pdf_chat.html */
/* Base action button - 48x48px icon buttons */

/* Base action button styles (from deep_search and scholar_search) */
.action-btn {
    width: 48px;
    height: 48px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    background: #ffffff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0;
    min-width: 48px;
    max-width: 48px;
    min-height: 48px;
    max-height: 48px;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
}

.action-btn span {
    display: inline-block;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    overflow: hidden;
    font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",system-ui,sans-serif;
    letter-spacing: 0;
    white-space: nowrap;
}

/* Action button icon images (SVG icons) */
.action-btn-icon {
    width: 20px;
    height: 20px;
    display: block;
    object-fit: contain;
    filter: brightness(0) invert(1); /* Make icons white */
}

/* Upgrade action button icon - dark, visible on white button background */
.upgrade-action-icon {
    width: 18px;
    height: 18px;
    display: block;
    object-fit: contain;
    opacity: 0.7;
}

/* Action button hover states (varies by app) */
.action-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #9ca3af;
}

/* Scholar search specific hover */
.scholar-actions .action-btn:hover {
    background: #f7f7f8;
    border-color: #0084ff;
    transform: scale(1.05);
}

.action-btn:active {
    transform: scale(0.95);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0;
}

/* Scholar search specific disabled state */
.scholar-actions .action-btn:disabled {
    background: #e5e5e5;
    color: #999;
    border-color: #d1d5db;
    opacity: 0.6;
}

.action-btn:disabled:hover {
    background: #e5e5e5;
    border-color: #d1d5db;
    transform: none;
}

/* Custom Tooltip Styling - Black background with white bold text */
.action-btn[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: #000000;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    white-space: nowrap;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    pointer-events: none;
}

.action-btn[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 2px;
    border: 6px solid transparent;
    border-top-color: #000000;
    z-index: 1000;
    pointer-events: none;
}

/* Clear Button - Green */
.clear-btn {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.clear-btn:hover:not(:disabled) {
    background: #218838;
    border-color: #1e7e34;
}

.clear-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Save Button - Gray with Blue Gradient Outline */
.action-btn.save-btn,
.save-btn {
    background: #6c757d !important;
    border: 1px solid #6c757d !important;
    border-radius: 50% !important;
    color: white !important;
    position: relative;
}

.action-btn.save-btn:hover:not(:disabled),
.save-btn:hover:not(:disabled),
.action-btn.save-btn:active:not(:disabled),
.save-btn:active:not(:disabled),
.action-btn.save-btn:focus:not(:disabled),
.save-btn:focus:not(:disabled) {
    background: #6c757d !important;
    border-color: #6c757d !important;
    /* Blue gradient outline effect using box-shadow */
    box-shadow: 0 0 0 2px #6c757d,
                0 0 0 4px #0084ff,
                0 0 0 6px rgba(102, 126, 234, 0.6),
                0 0 0 8px rgba(0, 132, 255, 0.3) !important;
}

/* Download Button - Gray with Blue Gradient Outline */
.download-btn {
    background: #6c757d !important;
    border: 1px solid #6c757d !important;
    border-radius: 50% !important;
    color: white !important;
    position: relative;
}

.download-btn:hover:not(:disabled),
.download-btn:active:not(:disabled),
.download-btn:focus:not(:disabled) {
    background: #6c757d !important;
    border-color: #6c757d !important;
    /* Blue gradient outline effect using box-shadow */
    box-shadow: 0 0 0 2px #6c757d,
                0 0 0 4px #0084ff,
                0 0 0 6px rgba(102, 126, 234, 0.6),
                0 0 0 8px rgba(0, 132, 255, 0.3) !important;
}

/* Citations Button - Gray with Blue Gradient Outline */
.citations-btn {
    background: #6c757d !important;
    border: 1px solid #6c757d !important;
    border-radius: 50% !important;
    color: white !important;
    position: relative;
}

.citations-btn:hover:not(:disabled),
.citations-btn:active:not(:disabled),
.citations-btn:focus:not(:disabled) {
    background: #6c757d !important;
    border-color: #6c757d !important;
    /* Blue gradient outline effect using box-shadow */
    box-shadow: 0 0 0 2px #6c757d,
                0 0 0 4px #0084ff,
                0 0 0 6px rgba(102, 126, 234, 0.6),
                0 0 0 8px rgba(0, 132, 255, 0.3) !important;
}

/* Start Over Button - Gray with Blue Gradient Outline */
.start-over-btn {
    background: #6c757d !important;
    border: 1px solid #6c757d !important;
    border-radius: 50% !important;
    color: white !important;
    overflow: visible !important;
    position: relative;
    max-width: 48px !important;
    max-height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    outline: none !important;
    box-shadow: none !important;
}

.start-over-btn:focus {
    outline: none !important;
    box-shadow: 0 0 0 2px #6c757d,
                0 0 0 4px #0084ff,
                0 0 0 6px rgba(102, 126, 234, 0.6),
                0 0 0 8px rgba(0, 132, 255, 0.3) !important;
}

.start-over-btn:hover:not(:disabled),
.start-over-btn:active:not(:disabled),
.start-over-btn:focus:not(:disabled) {
    background: #6c757d !important;
    border-color: #6c757d !important;
    /* Blue gradient outline effect using box-shadow */
    box-shadow: 0 0 0 2px #6c757d,
                0 0 0 4px #0084ff,
                0 0 0 6px rgba(102, 126, 234, 0.6),
                0 0 0 8px rgba(0, 132, 255, 0.3) !important;
    outline: none !important;
}

/* Help Button - Red, Circular */
.action-btn.help-btn {
    background: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
    border-radius: 50% !important;
    font-weight: bold;
    font-size: 20px;
    position: relative;
}

.action-btn.help-btn:hover:not(:disabled) {
    background: #c82333 !important;
    border-color: #bd2130 !important;
}

.action-btn.help-btn span {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    color: white !important;
}

/* Help Button Glow Animation */
.action-btn.help-btn.animate-help {
    animation: helpButtonGlow 2s ease-in-out infinite;
}

@keyframes helpButtonGlow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(220, 53, 69, 0.5),
                    0 0 10px rgba(220, 53, 69, 0.3),
                    0 0 15px rgba(220, 53, 69, 0.2);
        background-color: #dc3545 !important;
    }
    50% {
        box-shadow: 0 0 10px rgba(255, 100, 0, 0.7),
                    0 0 20px rgba(255, 100, 0, 0.5),
                    0 0 30px rgba(255, 100, 0, 0.3);
        background-color: rgba(255, 100, 0, 0.9) !important;
    }
}

/* Upgrade Button - Blue, Wider */
.action-btn.upgrade-btn {
    background: #2196F3 !important;
    color: white !important;
    border-color: #2196F3 !important;
    border-radius: 8px !important;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    width: auto !important;
    min-width: 140px;
    max-width: none !important;
    height: 48px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn.upgrade-btn:hover {
    background: #1976D2 !important;
    border-color: #1565C0 !important;
    transform: scale(1.05);
}

.action-btn.upgrade-btn span {
    font-size: 14px !important;
    line-height: 1 !important;
    color: white !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    text-align: center !important;
    overflow: visible !important;
    white-space: nowrap !important;
}

/* Submit Button - Blue (Scholar Search) */
.submit-btn {
    background: #0084ff;
    color: white;
    border-color: #0084ff;
}

.submit-btn:hover {
    background: #0073e6;
    border-color: #0073e6;
}

.submit-btn:hover:not(:disabled) {
    background: #218838;
    border-color: #1e7e34;
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}


/* ==================================================
   CATEGORY 3: SORT BUTTONS
   ================================================== */
/* Used in: deep_search.html, scholar_search.html, saved_search_detail.html */

.sort-btn {
    background: #0084ff;
    border: 1px solid #0084ff;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    color: #ffffff;
    flex: 1;
    min-width: 100px; /* Minimum width to prevent text chopping */
    justify-content: center;
    white-space: nowrap;
}

.sort-btn .emoji-icon {
    font-size: 12px;
    line-height: 1;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
}

.sort-btn:hover {
    background: #0073e6;
    border-color: #0073e6;
}

.sort-btn.active {
    background: #0073e6;
    color: white;
    border-color: #0073e6;
}

/* Scholar search specific sort button active state */
.sort-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ==================================================
   Sort button tooltip — small black box / white text.
   Renders via [data-tooltip] so it can replace the native
   browser tooltip and never gets clipped by toolbar parents.
   ================================================== */
.sort-btn[data-tooltip] {
    position: relative;
    overflow: visible;
}
/* The actual tooltip is rendered by sort_tooltip.js as a fixed,
   body-level element so it cannot be clipped by ancestors with
   overflow:hidden (e.g. .panel-body). The pseudo-element is left
   empty as a no-op so the visible-but-clipped fallback never paints. */

/* Ensure no toolbar ancestor clips the tooltip. Scoped narrowly
   so adjacent scrollable lists keep their overflow behaviour. */
.citations-sort,
.citations-sort-buttons,
#citations-toolbar,
#citations-toolbar .citations-sort {
    overflow: visible;
}


/* ==================================================
   CATEGORY 4: CITATION BUTTONS
   ================================================== */
/* Used in: citation cards within search results */

.citation-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    color: #495057;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    white-space: nowrap; /* Prevent text wrapping */
    flex-shrink: 0; /* Prevent buttons from shrinking */
}

.citation-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
}

/* Link Button - Green */
.citation-btn.link-btn,
.link-btn {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

.citation-btn.link-btn:hover,
.link-btn:hover {
    background: #059669;
    border-color: #059669;
    transform: translateY(-1px);
}

/* Chat Button - Blue */
.citation-btn.chat-btn,
.chat-btn {
    background: #0084ff;
    color: white;
    border-color: #0084ff;
}

.citation-btn.chat-btn:hover,
.chat-btn:hover {
    background: #0073e6;
    color: white;
    border-color: #0073e6;
}

/* PDF Button */
.pdf-btn:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Source Link - final report prose (bare SVG icons; size matches unified_chat Sources) */
.source-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    margin: 0 2px;
    min-width: 0;
    min-height: 0;
    box-sizing: content-box;
    border: none;
    background: transparent;
    border-radius: 0;
    text-decoration: none !important;
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    vertical-align: middle;
    transition: opacity 120ms ease;
}

.source-link-btn:hover {
    opacity: 0.85;
    transform: none;
    box-shadow: none;
}

.source-link-btn:focus-visible {
    outline: 2px solid #6366f1;
    outline-offset: 2px;
    opacity: 1;
}

.source-link-btn .source-link-icon {
    width: calc(28px * 0.8);
    height: calc(28px * 0.8);
    max-width: calc(28px * 0.8);
    max-height: calc(28px * 0.8);
    vertical-align: middle;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    filter: none;
    opacity: 0.95;
}
/* ==================================================
   CATEGORY 5: AUTHENTICATION BUTTONS
   ================================================== */
/* Used in: login.html, register.html, password reset pages */

.login-btn {
    width: auto;
    min-width: 120px;
    padding: 10px 24px;
    background-color: #0d6efd;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

/* Ensure anchor tags with login-btn class are styled as buttons */
a.login-btn {
    text-decoration: none;
    color: white;
}

a.login-btn:hover {
    color: white;
    text-decoration: none;
}

.login-btn:hover {
    background-color: #0b5ed7;
}

/* Google login button - transparent with blue border */
.google-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 4px;
    background-color: transparent;
    color: #4285F4;
    border: 2px solid #4285F4;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1.2rem;
}

.google-login-btn:hover {
    background-color: rgba(66, 133, 244, 0.1);
    border-color: #357ae8;
    color: #357ae8;
}

.google-login-btn svg {
    margin-right: 0;
    width: 22px;
    height: 22px;
}

/* Delete button variant - red version of login-btn */
button.login-btn.delete-btn,
button.delete-btn,
.login-btn.delete-btn {
    background-color: #dc3545 !important;
    color: white !important;
    border-color: #dc3545 !important;
}

button.login-btn.delete-btn:hover,
button.delete-btn:hover,
.login-btn.delete-btn:hover {
    background-color: #c82333 !important;
    border-color: #c82333 !important;
    color: white !important;
}

button.login-btn.delete-btn:focus,
button.login-btn.delete-btn:active,
button.delete-btn:focus,
button.delete-btn:active,
.login-btn.delete-btn:focus,
.login-btn.delete-btn:active {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

/* Profile edit buttons */
.profile-buttons .login-btn {
    flex: 0 0 auto;
    min-width: 140px;
}

.cancel-btn {
    background-color: #6c757d !important;
}

.cancel-btn:hover {
    background-color: #5a6268 !important;
}


/* ==================================================
   CATEGORY 6: DASHBOARD BUTTONS
   ================================================== */
/* Used in: dashboard.html, profile pages */

/* Button container - make all buttons equal width matching "Manage Subscription" */
.button-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.button-container .login-btn,
.button-container a.login-btn,
.button-container button.login-btn {
    width: 270px; /* Fixed width to accommodate "♻️ Reactivate Subscription" button text */
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
    padding: 10px 24px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none !important;
    color: white !important;
    border-radius: 8px;
    border: 2px solid #a78bfa;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
    cursor: pointer;
}

.button-container .login-btn::before,
.button-container a.login-btn::before,
.button-container button.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.button-container .login-btn:hover,
.button-container a.login-btn:hover,
.button-container button.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(124, 58, 237, 0.4);
    border-color: #c4b5fd;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
    color: white !important;
    text-decoration: none !important;
}

.button-container .login-btn:active,
.button-container a.login-btn:active,
.button-container button.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

/* Button container with margin top */
.button-container-margin-top {
    margin-top: 10px;
}

/* New Dashboard Button Style - Oval with white background and border on hover/click */
.dashboard-btn {
    width: 270px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none !important;
    color: #495057 !important;
    border-radius: 50px; /* Very rounded, almost oval */
    border: 2px solid transparent;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    box-sizing: border-box;
    line-height: 1.4;
}

.dashboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #212529 !important;
    border-color: #6c757d;
}

.dashboard-btn:active,
.dashboard-btn:focus {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: #495057;
}

/* Icon styling in dashboard buttons */
.dashboard-btn i {
    font-size: 1.1rem;
    line-height: 1;
}

.dashboard-btn img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}

/* Unified action row on library item detail pages (Back / Share / Download / Delete) */
.library-item-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.library-item-detail-actions .dashboard-btn {
    width: 148px;
    min-width: 148px;
    max-width: 148px;
    padding: 10px 14px;
    font-size: 0.92rem;
}

/* Button container for dashboard buttons */
.button-container .dashboard-btn,
.button-container a.dashboard-btn,
.button-container button.dashboard-btn {
    width: 270px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem !important; /* Ensure consistent font size regardless of parent */
}

/* Delete account button with dashboard-btn style - red border on hover/click */
.dashboard-btn.delete-account-btn {
    background: #ffffff !important;
    color: #dc3545 !important;
    border: 2px solid transparent;
}

.dashboard-btn.delete-account-btn:hover {
    color: #c82333 !important;
    background: #fff5f5 !important;
    border-color: #dc3545;
}

.dashboard-btn.delete-account-btn:active,
.dashboard-btn.delete-account-btn:focus {
    border-color: #c82333;
}

/* Cancel button with dashboard-btn style - green border on hover/click */
.dashboard-btn.cancel-btn {
    background: #ffffff !important;
    color: #28a745 !important;
    border: 2px solid transparent;
}

.dashboard-btn.cancel-btn:hover {
    color: #218838 !important;
    background: #f0fff4 !important;
    border-color: #28a745;
}

.dashboard-btn.cancel-btn:active,
.dashboard-btn.cancel-btn:focus {
    border-color: #218838;
}

/* Delete form buttons with dashboard-btn */
.delete-form-buttons .dashboard-btn {
    width: 270px;
}

/* Update existing delete-account-btn to exclude dashboard-btn */
.button-container .delete-account-btn:not(.dashboard-btn),
.button-container a.delete-account-btn:not(.dashboard-btn),
.button-container button.delete-account-btn:not(.dashboard-btn),
#delete-initial .delete-account-btn:not(.dashboard-btn) {
    border: 2px solid #ef4444 !important;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%) !important;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3) !important;
}

.button-container .delete-account-btn:not(.dashboard-btn):hover,
.button-container a.delete-account-btn:not(.dashboard-btn):hover,
.button-container button.delete-account-btn:not(.dashboard-btn):hover,
#delete-initial .delete-account-btn:not(.dashboard-btn):hover {
    border-color: #f87171 !important;
    background: linear-gradient(135deg, #ef4444 0%, #f87171 50%, #fca5a5 100%) !important;
    box-shadow: 0 5px 16px rgba(220, 38, 38, 0.4) !important;
}

.button-container .delete-account-btn:not(.dashboard-btn):active,
.button-container a.delete-account-btn:not(.dashboard-btn):active,
.button-container button.delete-account-btn:not(.dashboard-btn):active,
#delete-initial .delete-account-btn:not(.dashboard-btn):active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3) !important;
}

/* Update delete form buttons to exclude dashboard-btn */
.delete-form-buttons .login-btn:not(.dashboard-btn),
.delete-form-buttons .delete-form-button:not(.dashboard-btn) {
    width: 270px; /* Match all other buttons */
    height: auto;
    padding: 10px 20px;
    box-sizing: border-box;
}

.delete-form-buttons .cancel-btn:not(.dashboard-btn),
.delete-form-buttons button.cancel-btn:not(.dashboard-btn),
.delete-form-buttons .login-btn.cancel-btn:not(.dashboard-btn) {
    border: 2px solid #28a745 !important;
    background: linear-gradient(135deg, #28a745 0%, #34ce57 50%, #48d869 100%) !important;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3) !important;
}

.delete-form-buttons .cancel-btn:not(.dashboard-btn):hover,
.delete-form-buttons button.cancel-btn:not(.dashboard-btn):hover,
.delete-form-buttons .login-btn.cancel-btn:not(.dashboard-btn):hover {
    border-color: #48d869 !important;
    background: linear-gradient(135deg, #34ce57 0%, #48d869 50%, #5ce37a 100%) !important;
    box-shadow: 0 5px 16px rgba(40, 167, 69, 0.4) !important;
}

.delete-form-buttons .cancel-btn:not(.dashboard-btn):active,
.delete-form-buttons button.cancel-btn:not(.dashboard-btn):active,
.delete-form-buttons .login-btn.cancel-btn:not(.dashboard-btn):active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3) !important;
}

.delete-form-buttons .delete-account-btn:not(.dashboard-btn),
.delete-form-buttons button.delete-account-btn:not(.dashboard-btn),
.delete-form-buttons .login-btn.delete-account-btn:not(.dashboard-btn) {
    border: 2px solid #ef4444 !important;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%) !important;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3) !important;
}

.delete-form-buttons .delete-account-btn:not(.dashboard-btn):hover,
.delete-form-buttons button.delete-account-btn:not(.dashboard-btn):hover,
.delete-form-buttons .login-btn.delete-account-btn:not(.dashboard-btn):hover {
    border-color: #f87171 !important;
    background: linear-gradient(135deg, #ef4444 0%, #f87171 50%, #fca5a5 100%) !important;
    box-shadow: 0 5px 16px rgba(220, 38, 38, 0.4) !important;
}

.delete-form-buttons .delete-account-btn:not(.dashboard-btn):active,
.delete-form-buttons button.delete-account-btn:not(.dashboard-btn):active,
.delete-form-buttons .login-btn.delete-account-btn:not(.dashboard-btn):active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3) !important;
}

/* Checkout retry button - blue background for checkout cancel page */
.checkout-retry-btn {
    background: #3b82f6 !important;
    margin: 0;
}

.checkout-retry-btn:hover {
    background: #2563eb !important;
}

/* Reactivate button - keep green but with same style structure */
.reactivate-btn {
    border: 2px solid #28a745;
    background: linear-gradient(135deg, #28a745 0%, #34ce57 50%, #48d869 100%);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

.reactivate-btn:hover {
    border-color: #48d869;
    background: linear-gradient(135deg, #34ce57 0%, #48d869 50%, #5ce37a 100%);
    box-shadow: 0 5px 16px rgba(40, 167, 69, 0.4);
}

/* Cancel subscription button - red gradient with same style structure */
.button-container .cancel-subscription-btn,
.button-container a.cancel-subscription-btn,
.button-container button.cancel-subscription-btn {
    border: 2px solid #ef4444 !important;
    background: linear-gradient(135deg, #dc2626 0%, #ef4444 50%, #f87171 100%) !important;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.3) !important;
}

.button-container .cancel-subscription-btn:hover,
.button-container a.cancel-subscription-btn:hover,
.button-container button.cancel-subscription-btn:hover {
    border-color: #f87171 !important;
    background: linear-gradient(135deg, #ef4444 0%, #f87171 50%, #fca5a5 100%) !important;
    box-shadow: 0 5px 16px rgba(220, 38, 38, 0.4) !important;
}

.button-container .cancel-subscription-btn:active,
.button-container a.cancel-subscription-btn:active,
.button-container button.cancel-subscription-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3) !important;
}

/* Delete account button - red gradient with same style structure (for non-dashboard-btn) */
/* Note: dashboard-btn.delete-account-btn styles are defined above */

/* Delete confirmation form buttons */
.delete-form-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

/* Delete form buttons styles (for non-dashboard-btn) */
/* Note: dashboard-btn styles for delete form are defined above */


/* ==================================================
   CATEGORY 7: FORM BUTTONS
   ================================================== */
/* Used in: forms, dialogs, modals */

/* Secondary button */
.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

/* Outline danger button */
.btn-outline-danger {
    background-color: #28a745; /* Green background */
    color: white;
    border: 1px solid #dc3545; /* Red border */
    transition: background-color 0.3s ease, color 0.3s ease;
}

.btn-outline-danger:hover {
    background-color: #dc3545; /* Red background on hover */
    color: white;
}


/* ==================================================
   CATEGORY 8: NAVIGATION BUTTONS
   ================================================== */
/* Used in: home.html, landing pages */

.pendar-btn {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    background-color: #4caf50; /* Green background */
    border-color: #4caf50;
    color: white;
    transition: all 0.3s ease;
}

.pendar-btn:hover {
    background-color: #388e3c; /* Darker green on hover */
    border-color: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.btn-outline-primary.pendar-btn {
    background-color: transparent;
    color: #4caf50;
    border-color: #4caf50;
}

.btn-outline-primary.pendar-btn:hover {
    background-color: #4caf50;
    color: white;
}

/* New outline danger button styling for home page */
.btn-outline-danger.pendar-btn {
    background-color: transparent;
    color: #dc3545;
    border-color: #dc3545;
    border-width: 2px;
}

.btn-outline-danger.pendar-btn:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Start App Buttons with Gradient Effect */
.start-app-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 24px;
    font-size: 1.3rem;
    font-weight: 600;
    text-decoration: none;
    color: white;
    border-radius: 8px;
    border: 2px solid #a78bfa; /* Lighter border color */
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%); /* Gradient from darker center to lighter edges */
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
    min-width: 130px;
    text-align: center;
    position: relative;
    overflow: hidden;
    line-height: 1.4;
}

.start-app-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.start-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(124, 58, 237, 0.4);
    border-color: #c4b5fd; /* Even lighter border on hover */
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
    color: white;
    text-decoration: none;
}

.start-app-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}


/* ==================================================
   CATEGORY 9: PERUSE APP BUTTONS
   ================================================== */
/* Used in: multi_pdf_chat.html, report_writer.html */

/* Enhanced Remove PDF Button Styles */
.remove-pdf-btn {
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
    line-height: 1 !important;
    opacity: 0.8 !important;
    border: 1px solid #dc3545 !important;
    background: #dc3545 !important;
    color: white !important;
    min-width: 30px !important;
    flex-shrink: 0 !important;
}

.remove-pdf-btn:hover {
    background: #c82333 !important;
    color: white !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3) !important;
    opacity: 1 !important;
}

.remove-pdf-btn:focus {
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3) !important;
    outline: none !important;
}

.remove-pdf-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
}

/* Edit button - positioned at the bottom (Peruse app specific) */
.edit-btn {
    position: static !important; /* Override any absolute positioning */
    align-self: flex-end;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 0.25rem;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s ease;
    display: block !important; /* Force block display */
    white-space: nowrap;
    line-height: 1;
    width: auto;
    margin-top: 0.25rem !important; /* Reduced margin for more compact layout */
    top: auto !important; /* Override any top positioning */
    left: auto !important; /* Override any left positioning */
    right: auto !important; /* Override any right positioning */
    bottom: auto !important; /* Override any bottom positioning */
}

.edit-btn:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Chat action button - Multi PDF Chat */
.btn-outline-danger.chat-action-button {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.btn-outline-danger.chat-action-button:hover,
.btn-outline-danger.chat-action-button:focus {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    color: white !important;
}


/* ==================================================
   CATEGORY 11: INPUT GROUP BUTTONS
   ================================================== */
/* Used in: chat input areas */

.input-group-button {
    height: 40px;
    width: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

/* Chat action buttons: green bg, white text */
.input-group-buttons .btn {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
    font-size: 1.2rem;
    padding: 0;
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-group-buttons .btn:hover,
.input-group-buttons .btn:focus {
    background-color: #218838;
    color: #fff;
    border-color: #1e7e34;
}

.input-group-buttons .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.input-group-buttons .btn:disabled:hover {
    background-color: #28a745;
}

/* Opt-in circular hit target for small composer icons (e.g. unified_chat send/stop); pair with local sizing/color rules */
.btn-icon-circle-sm {
    box-sizing: border-box;
    border-radius: 50%;
}


/* ==================================================
   CATEGORY 12: UTILITY BUTTONS
   ================================================== */
/* Small utility buttons used across the app */

/* Edit and delete buttons (generic - small circular buttons) */
.edit-btn, .delete-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.6;
    color: white;
    font-size: 0.8rem;
}

.edit-btn:hover, .delete-btn:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.5);
}

/* Copy button */
.copy-btn {
    position: absolute !important;
    right: 10px !important;
    top: 10px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border: none !important;
    border-radius: 3px !important;
    padding: 3px 6px !important;
    cursor: pointer !important;
    font-size: 0.8rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0.6 !important;
    z-index: 5 !important;
    width: 24px !important;
    height: 24px !important;
}

.copy-btn:hover {
    opacity: 1 !important;
}

/* Download button (generic) */
.download-btn {
    border: none;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.download-btn:hover {
    background-color: #28a745;
    color: white;
    transform: translateY(-2px);
}

/* Paper links buttons */
.paper-links .btn {
    padding: 0.2rem 0.4rem;
    font-size: 0.75rem;
}

.paper-title-btn {
    text-align: left;
    padding: 0 !important;
    color: #007bff;
    background: none;
    border: none;
    font-weight: 500;
    text-decoration: none;
}

.paper-title-btn:hover {
    text-decoration: underline;
    color: #0056b3;
}

/* Search button */
.btn-search {
    background-color: #28a745; /* Green background */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s ease;
}

.btn-search:hover {
    background-color: #218838; /* Darker green on hover */
}

/* Info button */
.btn-info {
    background-color: #28a745; /* Green background */
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    transition: background-color 0.3s ease;
}

.btn-info:hover {
    background-color: #218838; /* Darker green on hover */
}

/* Delete saved search button (legacy single-button style, excludes new card-action-btn) */
.delete-saved-search:not(.card-action-btn) {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.saved-search-card:hover .delete-saved-search:not(.card-action-btn) {
    opacity: 1;
}

.delete-saved-search:not(.card-action-btn):hover {
    background: #dc2626;
}


/* ==================================================
   CATEGORY 13: NAVIGATION PILLS/TABS
   ================================================== */
/* Used in: peruse app navigation, home page tabs */

/* Peruse Navigation Pills - Identical Outline Buttons */
.nav-pills .nav-link {
    border: 2px solid #6c757d !important; /* Gray outline by default */
    background-color: transparent !important;
    color: #6c757d !important;
    font-weight: 500 !important;
    padding: 0.75rem 1.5rem !important;
    margin: 0 0.25rem !important;
    border-radius: 0.5rem !important;
    transition: all 0.3s ease !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 160px !important;
    text-align: center !important;
    white-space: nowrap !important;
}

/* Hover state */
.nav-pills .nav-link:hover {
    border-color: #495057 !important;
    color: #495057 !important;
    background-color: rgba(108, 117, 125, 0.1) !important;
    transform: translateY(-1px) !important;
}

/* Active state (current page) */
.nav-pills .nav-link.active {
    border-color: #007bff !important; /* Blue outline for active state */
    color: #007bff !important;
    background-color: rgba(0, 123, 255, 0.1) !important;
    font-weight: 600 !important;
}

/* Peruse specific active state */
.nav-pills .nav-link.active {
    background-color: #28a745 !important; /* Bootstrap green */
    color: white !important;
}

/* Active hover state */
.nav-pills .nav-link.active:hover {
    border-color: #0056b3 !important;
    color: #0056b3 !important;
    background-color: rgba(0, 123, 255, 0.15) !important;
}

/* Custom hover effect for nav pills */
.nav-pills .nav-link:hover:not(.active) {
    background-color: #f0f0f0;
    color: #28a745;
}

/* Ensure emoji icons in nav links have proper spacing */
.nav-pills .nav-link .emoji-icon {
    margin-right: 0.5rem !important;
    font-size: 1rem !important;
}

/* Tab buttons (home page) */
.tab-button {
    background: transparent;
    border: none;
    padding: 15px 25px;
    font-size: 1.2rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.tab-button > span:first-child {
    font-size: 1.44rem;
}

/* Home tab SVGs: flex min-width:auto otherwise follows intrinsic 512px SVG size */
.tab-button-icon {
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    min-width: 0;
    flex: 0 0 auto;
    flex-shrink: 0;
    display: block;
    object-fit: contain;
    vertical-align: middle;
}

.tab-button:hover {
    color: #2d3748;
    background-color: #f8fafc;
}

.tab-button.active {
    color: #667eea;
    border-bottom-color: #667eea;
    font-weight: 600;
}

.tab-count {
    background-color: #e2e8f0;
    color: #64748b;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.tab-button.active .tab-count {
    background-color: #667eea;
    color: white;
}

/* Sort button (home page) */
.sort-button {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-button:hover {
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.sort-button.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
    font-weight: 600;
}


/* ==================================================
   CATEGORY 14: DARK THEME VARIANTS
   ================================================== */
/* All dark theme overrides grouped together */

.dark-theme .login-btn {
    background-color: #0d6efd;
}

.dark-theme .login-btn:hover {
    background-color: #0b5ed7;
}

.dark-theme .google-login-btn {
    color: #4285F4;
    border-color: #4285F4;
}

.dark-theme .google-login-btn:hover {
    background-color: rgba(66, 133, 244, 0.2);
    border-color: #5a9ef7;
    color: #5a9ef7;
}

.dark-theme button.login-btn.delete-btn,
.dark-theme button.delete-btn,
.dark-theme .login-btn.delete-btn {
    background-color: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
}

.dark-theme button.login-btn.delete-btn:hover,
.dark-theme button.delete-btn:hover,
.dark-theme .login-btn.delete-btn:hover {
    background-color: #c82333 !important;
    border-color: #c82333 !important;
    color: white !important;
}

.dark-theme .cancel-btn {
    background-color: #6c757d !important;
}

.dark-theme .cancel-btn:hover {
    background-color: #5a6268 !important;
}

/* Dark theme support for dashboard buttons */
.dark-theme .dashboard-btn {
    background: #2d3748;
    color: #e2e8f0 !important;
    border: 2px solid transparent;
}

.dark-theme .dashboard-btn:hover {
    color: #ffffff !important;
    background: #374151;
    border-color: #718096;
}

.dark-theme .dashboard-btn:active,
.dark-theme .dashboard-btn:focus {
    border-color: #9ca3af;
}

/* Dark theme support for delete account button - ensure red color is visible */
.dark-theme .dashboard-btn.delete-account-btn {
    background: #2d3748 !important;
    color: #fca5a5 !important;
    border: 2px solid transparent;
}

.dark-theme .dashboard-btn.delete-account-btn:hover {
    color: #fee2e2 !important;
    background: #3f1f1f !important;
    border-color: #dc3545;
}

.dark-theme .dashboard-btn.delete-account-btn:active,
.dark-theme .dashboard-btn.delete-account-btn:focus {
    border-color: #ef4444;
}

/* Dark theme support for cancel button */
.dark-theme .dashboard-btn.cancel-btn {
    background: #2d3748 !important;
    color: #86efac !important;
    border: 2px solid transparent;
}

.dark-theme .dashboard-btn.cancel-btn:hover {
    color: #dcfce7 !important;
    background: #1f3f1f !important;
    border-color: #28a745;
}

.dark-theme .dashboard-btn.cancel-btn:active,
.dark-theme .dashboard-btn.cancel-btn:focus {
    border-color: #34ce57;
}

/* Dark theme icon styling for dashboard buttons - make icons white */
.dark-theme .dashboard-btn img {
    filter: brightness(0) invert(1);
}

/* Dark theme — sort chips match dashboard-btn shadow pattern */
.dark-theme .uc-source-chip--sort,
body.dark-mode .uc-source-chip--sort {
    background: #2d3748 !important;
    border: 2px solid transparent !important;
    color: #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.dark-theme .uc-source-chip--sort:hover,
body.dark-mode .uc-source-chip--sort:hover {
    background: #374151 !important;
    border-color: #718096 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.dark-theme .uc-source-chip--sort.active,
body.dark-mode .uc-source-chip--sort.active {
    background: #374151 !important;
    border: 2px solid transparent !important;
    color: #ffffff !important;
}

.dark-theme .pendar-btn {
    border-color: #a78bfa;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.dark-theme .btn-outline-primary.pendar-btn {
    border-color: #a78bfa;
}

.dark-theme .btn-outline-primary.pendar-btn:hover {
    border-color: #c4b5fd;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

.dark-theme .start-app-btn {
    border-color: #a78bfa;
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.dark-theme .start-app-btn:hover {
    border-color: #c4b5fd;
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
}

/* Keep green buttons green in dark mode */
.dark-theme .clear-btn {
    background: #28a745 !important;
    border-color: #28a745 !important;
    color: white !important;
}

.dark-theme .clear-btn:hover:not(:disabled) {
    background: #218838 !important;
    border-color: #1e7e34 !important;
}

/* Gray buttons with blue gradient outline - same in light and dark mode */
.dark-theme .citations-btn,
.dark-theme .start-over-btn,
.dark-theme .save-btn,
.dark-theme .download-btn {
    background: #6c757d !important;
    border: 1px solid #6c757d !important;
    color: white !important;
}

.dark-theme .citations-btn:hover:not(:disabled),
.dark-theme .citations-btn:active:not(:disabled),
.dark-theme .citations-btn:focus:not(:disabled),
.dark-theme .start-over-btn:hover:not(:disabled),
.dark-theme .start-over-btn:active:not(:disabled),
.dark-theme .start-over-btn:focus:not(:disabled),
.dark-theme .save-btn:hover:not(:disabled),
.dark-theme .save-btn:active:not(:disabled),
.dark-theme .save-btn:focus:not(:disabled),
.dark-theme .download-btn:hover:not(:disabled),
.dark-theme .download-btn:active:not(:disabled),
.dark-theme .download-btn:focus:not(:disabled) {
    background: #6c757d !important;
    border-color: #6c757d !important;
    /* Blue gradient outline effect using box-shadow */
    box-shadow: 0 0 0 2px #6c757d,
                0 0 0 4px #0084ff,
                0 0 0 6px rgba(102, 126, 234, 0.6),
                0 0 0 8px rgba(0, 132, 255, 0.3) !important;
}

.dark-theme .action-button {
    color: white !important;
}

.dark-theme .action-button span {
    color: white !important;
}

.dark-theme .btn-download {
    background: #28a745;
    color: white !important;
}

.dark-theme .btn-download:hover {
    background: #218838;
    color: white !important;
}

.dark-theme .btn-delete {
    background: #ef4444;
    color: white !important;
}

.dark-theme .btn-delete:hover {
    background: #dc2626;
    color: white !important;
}

.dark-theme .btn-continue {
    background: #2196F3;
    color: white !important;
}

.dark-theme .btn-continue:hover {
    background: #1976D2;
    color: white !important;
}

.dark-theme .action-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

.dark-theme .action-btn.upgrade-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%) !important;
    color: white !important;
    border-color: #a78bfa !important;
    width: auto !important;
    min-width: 140px;
    max-width: none !important;
    padding: 0 14px;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.4);
}

.dark-theme .action-btn.upgrade-btn:hover {
    background: linear-gradient(135deg, #8b5cf6 0%, #a78bfa 50%, #c4b5fd 100%) !important;
    border-color: #c4b5fd !important;
    box-shadow: 0 5px 16px rgba(124, 58, 237, 0.5);
}

.dark-theme .action-btn.upgrade-btn span {
    font-size: 14px !important;
    line-height: 1.4 !important;
    color: white !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    overflow: visible !important;
    vertical-align: middle !important;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Android Emoji", "EmojiSymbols", "EmojiOne", "Twemoji Mozilla", sans-serif !important;
}

.dark-theme .remove-pdf-btn {
    background: #dc3545 !important;
    color: white !important;
}

.dark-theme .remove-pdf-btn:hover {
    background: #c82333 !important;
    color: white !important;
}

/* Dark theme for specific buttons in report writer */
.dark-theme #addPointBtn,
.dark-theme #clearHistoryBtn,
.dark-theme #submitReportBtn {
    color: #007bff !important;
    border-color: #007bff !important;
    background-color: transparent !important;
}

.dark-theme #addPointBtn:hover,
.dark-theme #clearHistoryBtn:hover,
.dark-theme #submitReportBtn:hover {
    color: white !important;
    background-color: #007bff !important;
    border-color: #007bff !important;
}

/* Dark theme for chat action buttons */
.dark-theme .btn-outline-danger.chat-action-button {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.dark-theme .btn-outline-danger.chat-action-button:hover,
.dark-theme .btn-outline-danger.chat-action-button:focus {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    color: white !important;
}

/* Extra high specificity for the erase button in dark mode */
.dark-theme #clearHistoryBtn.btn-outline-danger.chat-action-button,
.dark-theme button#clearHistoryBtn.btn-outline-danger,
.dark-theme .dark-theme #clearHistoryBtn.btn-outline-danger {
    background-color: #28a745 !important;
    color: white !important;
    border-color: #28a745 !important;
}

.dark-theme #clearHistoryBtn.btn-outline-danger.chat-action-button:hover,
.dark-theme #clearHistoryBtn.btn-outline-danger.chat-action-button:focus,
.dark-theme button#clearHistoryBtn.btn-outline-danger:hover,
.dark-theme button#clearHistoryBtn.btn-outline-danger:focus,
.dark-theme .dark-theme #clearHistoryBtn.btn-outline-danger:hover,
.dark-theme .dark-theme #clearHistoryBtn.btn-outline-danger:focus {
    background-color: #218838 !important;
    border-color: #1e7e34 !important;
    color: white !important;
}

/* Ensure buttons in chat are visible - Updated to blue theme */
.dark-theme .btn-outline-danger {
    color: #007bff !important;
    border-color: #007bff !important;
    background-color: transparent !important;
}

.dark-theme .btn-outline-danger:hover {
    color: white !important;
    background-color: #007bff !important;
    border-color: #007bff !important;
}

/* Dark theme sort buttons */
.dark-theme .sort-btn {
    background: #0084ff !important;
    border-color: #0084ff !important;
    color: #ffffff !important;
}

.dark-theme .sort-btn:hover {
    background: #0073e6 !important;
    border-color: #0073e6 !important;
}

.dark-theme .sort-btn.active {
    background: #0073e6 !important;
    border-color: #0073e6 !important;
    color: #ffffff !important;
}

/* Dark theme source links (report prose — icons only) */
body.dark-mode .source-link-btn,
.dark-theme .source-link-btn,
body.dark-mode .source-link-btn--pdf,
.dark-theme .source-link-btn--pdf {
    background: transparent !important;
    color: inherit !important;
    border: none !important;
}

body.dark-mode .source-link-btn:hover,
.dark-theme .source-link-btn:hover,
body.dark-mode .source-link-btn--pdf:hover,
.dark-theme .source-link-btn--pdf:hover {
    opacity: 0.88;
}

body.dark-mode .source-link-btn .source-link-icon,
.dark-theme .source-link-btn .source-link-icon {
    filter: brightness(0) invert(0.82);
}

body.dark-mode .source-link-btn:hover .source-link-icon,
.dark-theme .source-link-btn:hover .source-link-icon {
    filter: brightness(0) invert(0.95);
}

/* Dark theme tab buttons */
.dark-theme .tab-button {
    color: #a0aec0;
}

.dark-theme .tab-button:hover {
    color: #e2e8f0;
    background-color: #2d3748;
}

.dark-theme .tab-button.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
}

.dark-theme .tab-count {
    background-color: #4a5568;
    color: #a0aec0;
}

.dark-theme .tab-button.active .tab-count {
    background-color: #818cf8;
    color: white;
}

/* Dark theme sort buttons (home page) */
.dark-theme .sort-button {
    background: #2d3748;
    border-color: #4a5568;
    color: #a0aec0;
}

.dark-theme .sort-button:hover {
    border-color: #818cf8;
    color: #818cf8;
}

.dark-theme .sort-button.active {
    background: #818cf8;
    border-color: #818cf8;
    color: white;
}


/* ==================================================
   CATEGORY 15: SOURCES CHIP BUTTONS
   Reusable labeled chips for Sources sort toolbar and citation actions.
   ================================================== */

/* Base chip — icon + label, pill shape (composer-like) */
.uc-source-chip {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: auto;
    min-width: 0;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    text-decoration: none;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.25;
    white-space: nowrap;
    flex: 0 0 auto;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.uc-source-chip-label {
    pointer-events: none;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.uc-source-chip-icon,
.uc-source-chip .action-btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    object-fit: contain;
    pointer-events: none;
}

/* Sort chips — shadow edge like dashboard-btn (no visible line border) */
.uc-source-chip--sort {
    background: #ffffff !important;
    border: 2px solid transparent !important;
    color: #1f2937 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.uc-source-chip--sort .uc-source-chip-icon,
.uc-source-chip--sort .action-btn-icon {
    filter: none;
    opacity: 1;
}

.uc-source-chip--sort:hover {
    background: #ffffff !important;
    border-color: #6c757d !important;
    color: #212529 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.uc-source-chip--sort.active {
    background: #ffffff !important;
    border: 2px solid transparent !important;
    color: #1f2937 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 153, 0.2), 0 0 0 2px rgba(0, 0, 153, 0.25);
    transform: translateY(0);
}

.dark-theme .uc-source-chip--sort.active,
body.dark-mode .uc-source-chip--sort.active {
    box-shadow: 0 4px 12px rgba(100, 149, 237, 0.35), 0 0 0 2px rgba(204, 204, 255, 0.45);
}

/* Action chips — white background, dark text + visible icons */
.uc-source-chip--action {
    background: #ffffff !important;
    border: 1px solid #000000 !important;
    color: #1f2937 !important;
}

.uc-source-chip--action .uc-source-chip-label {
    color: #1f2937;
}

.uc-source-chip--action .uc-source-chip-icon,
.uc-source-chip--action .action-btn-icon {
    filter: none;
    opacity: 1;
}

.uc-source-chip--action:hover {
    background: #f3f4f6 !important;
    border-color: #000000 !important;
    color: #1f2937 !important;
    transform: scale(1.02);
}

a.uc-source-chip--action:visited {
    color: #1f2937;
}

.uc-source-chip--action.uc-source-chip--selected {
    background: #0084ff !important;
    border-color: #0084ff !important;
    color: #ffffff !important;
}

.uc-source-chip--action.uc-source-chip--selected .uc-source-chip-label {
    color: #ffffff;
}

.uc-source-chip--action.uc-source-chip--selected .uc-source-chip-icon,
.uc-source-chip--action.uc-source-chip--selected .action-btn-icon {
    filter: brightness(0) invert(1);
}

.uc-source-chip--action.uc-source-chip--selected:hover {
    background: #0073e6 !important;
    border-color: #0073e6 !important;
    color: #ffffff !important;
}

.dark-theme .uc-source-chip--action.uc-source-chip--selected,
body.dark-mode .uc-source-chip--action.uc-source-chip--selected {
    background: #0084ff !important;
    border-color: #0084ff !important;
    color: #ffffff !important;
}

/* Icon-only action chips — borderless default; chrome on click/focus/selected */
.uc-source-chip--action.uc-source-chip--icon-only {
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 8px;
    padding: 7px;
    min-width: 38px;
    min-height: 38px;
    width: auto;
    max-width: none;
    gap: 0;
    transform: none;
    box-shadow: none;
}

.uc-source-chip--action.uc-source-chip--icon-only .uc-source-chip-icon,
.uc-source-chip--action.uc-source-chip--icon-only .action-btn-icon {
    width: 22px;
    height: 22px;
    filter: none;
    opacity: 1;
}

.uc-source-chip--action.uc-source-chip--icon-only:hover {
    background: transparent !important;
    border-color: transparent !important;
    color: #1f2937 !important;
    transform: none;
    box-shadow: none;
    opacity: 0.85;
}

.uc-source-chip--action.uc-source-chip--icon-only:active,
.uc-source-chip--action.uc-source-chip--icon-only:focus-visible {
    background: #ffffff !important;
    border-color: #000000 !important;
    color: #1f2937 !important;
    opacity: 1;
    transform: none;
    box-shadow: none;
}

.uc-source-chip--action.uc-source-chip--icon-only.uc-source-chip--selected:hover {
    opacity: 1;
}

/* Literature search citation select pill — green selected + click pop */
.citation-actions .citation-select-pill.uc-source-chip--icon-only {
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.citation-actions .citation-select-pill.uc-source-chip--icon-only.uc-source-chip--selected {
    background: rgba(16, 185, 129, 0.14) !important;
    border-color: #10b981 !important;
    opacity: 1;
}

.citation-actions .citation-select-pill.uc-source-chip--icon-only.uc-source-chip--selected:hover {
    background: rgba(16, 185, 129, 0.22) !important;
    border-color: #059669 !important;
}

.citation-select-pill.citation-select-pill--pop {
    animation: citation-select-pop 0.35s cubic-bezier(0.25, 0.8, 0.35, 1);
}

@keyframes citation-select-pop {
    0%   { transform: scale(1); }
    45%  { transform: scale(1.14); }
    100% { transform: scale(1); }
}

.dark-theme .citation-actions .citation-select-pill.uc-source-chip--icon-only.uc-source-chip--selected,
body.dark-mode .citation-actions .citation-select-pill.uc-source-chip--icon-only.uc-source-chip--selected {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: #34d399 !important;
}

.dark-theme .citation-actions .citation-select-pill.uc-source-chip--icon-only.uc-source-chip--selected:hover,
body.dark-mode .citation-actions .citation-select-pill.uc-source-chip--icon-only.uc-source-chip--selected:hover {
    background: rgba(16, 185, 129, 0.28) !important;
    border-color: #6ee7b7 !important;
}

.uc-citation-action-btn.uc-source-chip--icon-only[data-tooltip] {
    position: relative;
    overflow: visible;
}

.dark-theme .uc-source-chip--action.uc-source-chip--icon-only:active,
.dark-theme .uc-source-chip--action.uc-source-chip--icon-only:focus-visible,
body.dark-mode .uc-source-chip--action.uc-source-chip--icon-only:active,
body.dark-mode .uc-source-chip--action.uc-source-chip--icon-only:focus-visible {
    background: #1f2937 !important;
    border-color: #9ca3af !important;
    color: #f3f4f6 !important;
}

/* Equal-width clusters (labeled pills only; icon-only actions are compact) */
.citation-actions .uc-source-chip--action:not(.uc-source-chip--icon-only) {
    width: 9.25rem;
    min-width: 9.25rem;
    max-width: 9.25rem;
    justify-content: center;
}

.citation-actions .uc-source-chip--action.citation-select-pill:not(.uc-source-chip--icon-only) {
    width: 11.75rem;
    min-width: 11.75rem;
    max-width: 11.75rem;
    font-size: 0.72rem;
}

.citation-actions .uc-source-chip--action.uc-source-chip--icon-only {
    width: auto;
    min-width: 38px;
    max-width: none;
    justify-content: center;
}

.citations-sort-buttons .uc-source-chip--sort[data-sort] {
    width: 7rem;
    min-width: 7rem;
    max-width: 7rem;
    justify-content: center;
}

/* Legacy aliases — map old class hooks to chip modifiers */
.uc-sources-sort-btn {
    /* inherits .uc-source-chip--sort when both classes present */
}

.uc-citation-action-btn.citation-btn,
a.uc-citation-action-btn.citation-btn,
button.uc-citation-action-btn.citation-btn {
    /* inherits .uc-source-chip--action when both classes present */
}

/* Square icon control with rounded corners (legacy; prefer .uc-source-chip) */
.uc-btn-squircle {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
}
