/* =================================================== */
/* VeraCita - Configure Sources CATEGORIES Styles     */
/* File 3 of 6: Ready, PDFs, Links, Uncited Sections  */
/* =================================================== */

/* ============================================= */
/* Success/Ready Section                        */
/* ============================================= */

.cs-success-section {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

.cs-success-section:not(.expanded) {
    background: rgba(16, 185, 129, 0.03);
}

.cs-success-section.expanded {
    background: rgba(16, 185, 129, 0.05);
}

.cs-success-section .cs-source-list {
    display: flex;
    flex-direction: column;
    /* gap property removed to switch to margin-based spacing */
}

.cs-success-section .cs-source-item {
    display: grid;
    grid-template-columns: 60px 1fr 80px;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--vc-bg-input);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    transition: all 0.2s ease;
    min-height: 80px;
    margin-bottom: 12px; /* ADDED: This ensures consistent spacing with other cards */
}

/* ADDED: This rule removes the margin from the last card in the list for clean alignment */
.cs-success-section .cs-source-item:last-child {
    margin-bottom: 0;
}


.cs-success-section .cs-source-item:hover {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.3);
    transform: translateX(4px);
}

.cs-success-section .cs-source-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.cs-success-section .cs-doc-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--vc-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-success-section .cs-source-url {
    display: inline-flex;
    align-items: center;
    color: var(--vc-text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
}

.cs-success-section .cs-source-url:hover {
    color: var(--vc-status-supported);
    text-decoration: underline;
}

.cs-success-section .cs-source-link {
    display: block;
    color: var(--vc-text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 4px 0;
}

.cs-success-section .cs-source-link:hover {
    color: var(--vc-status-supported);
    text-decoration: underline;
    text-decoration-color: rgba(16, 185, 129, 0.5);
}

.cs-status-badge.cs-status-success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--vc-status-supported);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(16, 185, 129, 0.25);
    white-space: nowrap;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 70px;
    height: 32px;
    text-align: center;
}

/* ============================================= */
/* Action Required Section                      */
/* ============================================= */

.cs-action-section {
    background: transparent;
    border-color: rgba(245, 158, 11, 0.2);
    overflow: visible;
    margin-bottom: 24px;
}

.cs-action-section.all-configured {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.2);
}

.cs-action-section .cs-section-header h3.all-configured {
    color: var(--text-primary);
}

.cs-action-section .cs-section-header h3.all-configured ~ .cs-section-icon {
    color: var(--vc-status-supported);
}

.cs-action-section .cs-section-desc {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.cs-action-section .cs-section-header {
    margin-bottom: 16px;
}

/* ============================================= */
/* Dead Links Section                           */
/* ============================================= */

.cs-dead-links-section {
    background: rgba(239, 68, 68, 0.03);
    border-color: rgba(239, 68, 68, 0.2);
}

.cs-dead-links-actions {
    margin: 16px 0 24px 0;
}

.cs-action-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(67, 132, 255, 0.05);
    border: 1px solid rgba(67, 132, 255, 0.15);
    border-radius: 10px;
    font-size: 13px;
    color: var(--vc-text-secondary);
    line-height: 1.5;
}

.cs-action-hint svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #4384ff;
}

.cs-action-hint strong {
    color: var(--vc-text-primary);
    font-weight: 600;
}

/* ============================================= */
/* Uncited Sources Section                      */
/* ============================================= */

.cs-uncited-section {
    background: rgba(245, 158, 11, 0.03);
    border-color: rgba(245, 158, 11, 0.15);
}

.cs-uncited-description {
    margin-bottom: 20px;
}

.cs-uncited-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 10px;
}

.cs-download-audit-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.cs-download-audit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
    background: linear-gradient(135deg, var(--vc-status-partial), #f59e0b);
}

.cs-download-audit-btn svg {
    flex-shrink: 0;
}

.cs-download-format-hint {
    font-size: 12px;
    color: var(--vc-text-muted);
    font-style: italic;
}

.cs-uncited-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

.cs-uncited-list::-webkit-scrollbar {
    width: 6px;
}

.cs-uncited-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.cs-uncited-list::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.3);
    border-radius: 3px;
}

.cs-uncited-list::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.5);
}

.cs-uncited-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: var(--vc-glass-bg);
    border: 1px solid var(--vc-border-default);
    border-radius: 10px;
    transition: all 0.2s ease;
}

.cs-uncited-item:hover {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
    transform: translateX(4px);
}

.cs-uncited-number {
    color: var(--vc-text-disabled);
    font-weight: 600;
    min-width: 32px;
    font-size: 14px;
}

.cs-uncited-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cs-uncited-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--vc-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cs-uncited-link {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    color: var(--vc-text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}

.cs-uncited-link:hover {
    color: var(--vc-status-partial);
    text-decoration: underline;
}

.cs-uncited-item .cs-action-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* ============================================= */
/* Collapsible Sections                         */
/* ============================================= */

.cs-collapsible .cs-section-header {
    position: relative;
    padding-right: 40px;
}

.cs-clickable {
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
}

.cs-clickable:hover {
    opacity: 0.9;
}

.cs-expand-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.cs-expand-icon svg {
    transition: transform 0.3s ease;
}

.cs-collapsible-content {
    overflow: hidden;
    transition: all 0.3s ease;
    /* REMOVED: animation: slideDown 0.3s ease-out; - was causing grow animation on tab switch */
}

/* ============================================= */
/* Subsections (HTML Failures & PDF Sources)   */
/* ============================================= */

.cs-subsection {
    margin: 24px 0;
    padding: 20px;
    background: var(--vc-glass-bg);
    border: 1px solid var(--vc-border-default);
    border-radius: 12px;
}

.cs-html-failures-subsection {
    border-left: 3px solid rgba(67, 132, 255, 0.4);
}

.cs-pdf-sources-subsection {
    border-left: 3px solid rgba(245, 158, 11, 0.4);
}

.cs-subsection-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    cursor: pointer;
    user-select: none;
}

.cs-subsection-icon {
    font-size: 24px;
}

.cs-subsection-header h4 {
    font-size: 18px;
    font-weight: 500;
    color: var(--vc-text-primary);
    margin: 0;
    flex: 1;
}

.cs-subsection-hint {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: var(--vc-glass-bg);
    border: 1px solid var(--vc-border-default);
    border-left: 3px solid rgba(67, 132, 255, 0.3);
    border-radius: 8px;
    font-size: 13px;
    color: var(--vc-text-muted);
    line-height: 1.5;
    margin-bottom: 20px;
}

.cs-subsection-hint svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: rgba(67, 132, 255, 0.5);
    width: 16px;
    height: 16px;
}

.cs-subsection-hint strong {
    color: var(--vc-text-primary);
    font-weight: 600;
}

/* ============================================= */
/* Scrollable Lists - FLEX TO FILL SPACE       */
/* ============================================= */

.cs-scrollable-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;      /* GROW to fill available space */
    min-height: 0;       /* Allow shrinking in flex context */
    overflow-y: auto;
    padding-right: 8px;
    background: none;
    /* REMOVED: max-height: 480px - was preventing flex expansion */
}

.cs-scrollable-list::-webkit-scrollbar {
    width: 6px;
}

.cs-scrollable-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 3px;
}

.cs-scrollable-list::-webkit-scrollbar-thumb {
    background: rgba(67, 132, 255, 0.3);
    border-radius: 3px;
}

.cs-scrollable-list::-webkit-scrollbar-thumb:hover {
    background: rgba(67, 132, 255, 0.5);
}

.cs-source-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 400px;
    background: none;
}

/* Ready Section - Fully Scrollable (No Pagination) */
.cs-ready-scrollable {
    flex: 1 1 auto;    /* GROW to fill available space */
    min-height: 0;     /* Allow shrinking in flex context */
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 8px;
    /* REMOVED: max-height: 620px - was preventing flex expansion */
}

/* Custom scrollbar for Ready section */
.cs-ready-scrollable::-webkit-scrollbar {
    width: 8px;
}

.cs-ready-scrollable::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
}

.cs-ready-scrollable::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.3);
    border-radius: 4px;
}

.cs-ready-scrollable::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.5);
}

/* ============================================= */
/* Links Toggle Navigation                      */
/* ============================================= */

/* Main container for the two toggle buttons */
.cs-links-toggle {
    display: flex;
    align-items: center;
    background-color: var(--vc-bg-input); /* A subtle background for the container */
    border-radius: 8px; /* Rounded corners for the container */
    padding: 4px; /* A little space inside the container */
    /* Removed margin-bottom and gap as they are handled by the parent flex container now */
}

/* General styling for each toggle button */
.cs-toggle-btn {
    flex: 1; /* Keep flex property */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* Space between the icon and the text */
    
    /* --- This is the key fix for the height --- */
    padding: 6px 12px; /* Reduced padding to make buttons smaller */
    height: 36px; /* Match the height of the "Run Smart Match" button */
    
    border: none; /* Remove default border */
    border-radius: 6px; /* Slightly rounded corners for the buttons */
    background-color: transparent; /* Make non-active buttons transparent */
    
    color: #a0aec0; /* A lighter color for non-active text */
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap; /* Prevent text from wrapping */
    cursor: pointer;
    
    /* Smooth transition for hover and active states */
    transition: all 0.2s ease-in-out;
}

/* Styling for the SVG icons within the buttons */
.cs-toggle-btn svg {
    flex-shrink: 0;
    width: 16px; 
    height: 16px;
    color: currentColor; /* Icon will inherit the button's text color */
    transition: all 0.2s ease-in-out;
    filter: none; /* Remove previous drop-shadow filter */
}

/* Hover state for non-active buttons */
.cs-toggle-btn:not(.cs-toggle-active):hover {
    background-color: var(--vc-border-emphasis); /* Subtle highlight on hover */
    color: var(--vc-text-primary); /* Primary text on hover */
}

/* Styling for the ACTIVE button */
.cs-toggle-btn.cs-toggle-active {
    background-color: #4f46e5; /* A vibrant color for the active state */
    color: #ffffff; /* White text for the active button */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); /* Adds a little depth */
    border-color: transparent; /* Ensure no border is visible */
}

/* Ensure the active button's SVG is white */
.cs-toggle-btn.cs-toggle-active svg {
    color: #ffffff;
}

/* ============================================= */
/* Fixed Headers for PDF & Links Categories     */
/* ============================================= */

/* --- AFTER --- */
.cs-pdf-fixed-header,
.cs-links-fixed-header {
    position: sticky;
    top: 0;
    background: transparent; /* Remove the dark background */
    /* backdrop-filter: blur(10px); --- REMOVED */
    z-index: 100;
    padding-bottom: 16px;
    margin-bottom: 0;
    border-bottom: none; /* Remove the line separator */
}

.cs-links-fixed-header .cs-content-header,
.cs-pdf-fixed-header .cs-content-header {
    background: transparent;
}

/* ============================================= */
/* Scrollable Areas                              */
/* ============================================= */

.cs-links-scrollable-area,
.cs-pdf-scrollable-area {
    position: relative;
}

.cs-source-list.cs-scrollable-list {
    flex: 1 1 auto;    /* GROW to fill available space */
    min-height: 0;     /* Allow shrinking in flex context */
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 8px 16px 0;
    margin-top: 16px;
    /* REMOVED: max-height: 550px - was preventing flex expansion */
}

/* ============================================= */
/* Custom Scrollbar Styling                      */
/* ============================================= */

.cs-source-list.cs-scrollable-list::-webkit-scrollbar {
    width: 8px;
}

.cs-source-list.cs-scrollable-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
}

.cs-source-list.cs-scrollable-list::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, rgba(67, 132, 255, 0.3), rgba(123, 66, 255, 0.3));
    border-radius: 4px;
    transition: background 0.2s ease;
}

.cs-source-list.cs-scrollable-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, rgba(67, 132, 255, 0.5), rgba(123, 66, 255, 0.5));
}

/* ============================================= */
/* Audit Download Modal                         */
/* ============================================= */

.cs-audit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.cs-audit-modal-content {
    background: linear-gradient(135deg, var(--vc-bg-surface), var(--vc-bg-body));
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.cs-audit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--vc-border-emphasis);
}

.cs-audit-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--vc-text-primary);
}

.cs-audit-modal-body {
    padding: 28px;
}

.cs-audit-subtitle {
    font-size: 14px;
    color: var(--vc-text-secondary);
    margin: 0 0 24px 0;
    text-align: center;
}

.cs-format-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cs-format-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--vc-bg-input);
    border: 1px solid var(--vc-border-default);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cs-format-card:hover {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.25);
    transform: translateX(4px);
}

.cs-format-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.cs-format-info {
    flex: 1;
}

.cs-format-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--vc-text-primary);
    margin-bottom: 4px;
}

.cs-format-desc {
    font-size: 13px;
    color: var(--vc-text-muted);
}

.cs-format-arrow {
    flex-shrink: 0;
    color: var(--vc-text-disabled);
    transition: all 0.2s ease;
}

.cs-format-card:hover .cs-format-arrow {
    color: var(--vc-status-partial);
    transform: translateX(4px);
}

/* ============================================= */
/* Fix URL Modal                                */
/* ============================================= */

.cs-fix-url-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.cs-fix-url-modal .cs-modal-content {
    background: linear-gradient(135deg, var(--vc-bg-surface), var(--vc-bg-body));
    border: 1px solid rgba(67, 132, 255, 0.2);
    border-radius: 16px;
    width: 90%;
    max-width: 550px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

.cs-fix-url-modal .cs-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--vc-border-emphasis);
}

.cs-fix-url-modal .cs-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--vc-text-primary);
}

.cs-fix-url-modal .cs-modal-close {
    background: none;
    border: none;
    color: var(--vc-text-muted);
    font-size: 28px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    line-height: 1;
}

.cs-fix-url-modal .cs-modal-close:hover {
    background: var(--vc-border-emphasis);
    color: var(--vc-text-primary);
}

.cs-fix-url-modal .cs-modal-body {
    padding: 28px;
}

.cs-fix-url-modal .cs-modal-subtitle {
    font-size: 14px;
    color: var(--vc-text-secondary);
    margin: 0 0 12px 0;
}

.cs-fix-url-modal .cs-modal-subtitle strong {
    color: var(--vc-text-primary);
    font-weight: 600;
}

.cs-fix-url-modal .cs-form-group {
    margin-bottom: 20px;
}

.cs-fix-url-modal .cs-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--vc-text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cs-fix-url-modal .cs-input,
.cs-fix-url-modal .cs-input-readonly {
    width: 100%;
    padding: 12px 16px;
    background: var(--vc-bg-input);
    border: 1px solid var(--vc-border-emphasis);
    border-radius: 8px;
    color: var(--vc-text-primary);
    font-size: 14px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.cs-fix-url-modal .cs-input:focus {
    outline: none;
    border-color: rgba(67, 132, 255, 0.5);
    background: var(--vc-border-default);
    box-shadow: 0 0 0 3px rgba(67, 132, 255, 0.1);
}

.cs-fix-url-modal .cs-input-readonly {
    background: var(--vc-glass-bg);
    color: var(--vc-text-muted);
    cursor: not-allowed;
}

.cs-fix-url-modal .cs-btn-primary {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #4384ff, #7b42ff);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
}

.cs-fix-url-modal .cs-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 132, 255, 0.4);
    background: linear-gradient(135deg, #5494ff, #8452ff);
}

.cs-fix-url-modal .cs-btn-primary:active {
    transform: translateY(0);
}

/* Premium Back/Edit Button */
.cs-btn-modal-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--vc-bg-input);
    border: 1px solid var(--vc-border-emphasis);
    border-radius: 10px;
    color: var(--vc-text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 12px;
}

.cs-btn-modal-back:hover {
    background: var(--vc-border-default);
    border-color: var(--vc-border-emphasis);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cs-btn-modal-back:active {
    transform: translateY(0);
}

.cs-btn-modal-back svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.cs-btn-modal-back span {
    white-space: nowrap;
}

/* Responsive: Stack buttons on mobile */
@media (max-width: 480px) {
    .cs-modal-actions {
        display: flex;
        flex-direction: column-reverse;
        gap: 12px;
    }
    
    .cs-btn-modal-back {
        width: 100%;
        margin-right: 0;
    }
    
    .cs-fix-url-modal .cs-btn-primary {
        width: 100%;
    }
}

/* Button container for side-by-side layout */
.cs-modal-button-group {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

/* Secondary action button (Edit URL) - same premium style as primary */
.cs-btn-secondary-action {
    background: linear-gradient(135deg, var(--vc-border-emphasis), var(--vc-border-default)) !important;
    border: 1px solid var(--vc-border-emphasis);
}

.cs-btn-secondary-action:hover {
    background: linear-gradient(135deg, var(--vc-border-emphasis), var(--vc-border-emphasis)) !important;
    border-color: var(--vc-border-emphasis);
}

/* Make both buttons equal width */
.cs-modal-button-group .cs-btn-primary {
    flex: 1;
    margin-top: 0;
}

/* Responsive: Stack buttons on mobile */
@media (max-width: 480px) {
    .cs-modal-button-group {
        flex-direction: column;
    }
    
    .cs-modal-button-group .cs-btn-primary {
        width: 100%;
    }
}

/* CONSENT MODAL */
/* File Upload Consent Modal Styles */
#fileUploadConsentModal .privacy-modal-content {
    max-width: 580px;
    background: linear-gradient(135deg, var(--vc-bg-surface), var(--vc-bg-body));
    border: 1px solid rgba(67, 132, 255, 0.2);
    border-radius: 16px;
}

#fileUploadConsentModal .privacy-icon {
    color: var(--vc-status-supported);
}

#fileUploadConsentModal .privacy-list {
    list-style: none;
    padding: 0;
    margin: 12px 0;
}

#fileUploadConsentModal .privacy-list li {
    padding: 8px 0;
    padding-left: 24px;
    position: relative;
    color: var(--vc-text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

#fileUploadConsentModal .privacy-list li:before {
    content: "âœ"";
    position: absolute;
    left: 0;
    color: var(--vc-status-supported);
    font-weight: bold;
}

#fileUploadConsentModal .privacy-checkbox-group {
    margin: 24px 0;
    padding: 16px;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 8px;
}

#fileUploadConsentModal .privacy-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

#fileUploadConsentModal .privacy-checkbox input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#fileUploadConsentModal .privacy-checkbox span {
    color: var(--vc-text-primary);
    font-size: 14px;
    font-weight: 500;
}

/* Modal Footer and Button Group */
#fileUploadConsentModal .privacy-modal-footer {
    padding: 20px 28px 28px;
    display: flex;
    justify-content: flex-end;
}

#fileUploadConsentModal .cs-modal-button-group {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: flex-end;
}

/* Secondary Button Style (Cancel) */
#fileUploadConsentModal .cs-btn-secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--vc-bg-input);
    border: 1px solid var(--vc-border-emphasis);
    border-radius: 10px;
    color: var(--vc-text-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#fileUploadConsentModal .cs-btn-secondary-action:hover {
    background: var(--vc-border-default);
    border-color: var(--vc-border-emphasis);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#fileUploadConsentModal .cs-btn-secondary-action:active {
    transform: translateY(0);
}

/* Primary Button Style (Continue) */
#fileUploadConsentModal .cs-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, #4384ff, #7b42ff);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#fileUploadConsentModal .cs-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 132, 255, 0.4);
    background: linear-gradient(135deg, #5494ff, #8452ff);
}

#fileUploadConsentModal .cs-btn-primary:active {
    transform: translateY(0);
}

#fileUploadConsentModal .cs-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#fileUploadConsentModal .cs-btn-primary.cs-btn-enabled {
    opacity: 1;
}

/* Button Icons */
#fileUploadConsentModal .cs-btn-primary svg,
#fileUploadConsentModal .cs-btn-secondary-action svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

/* Responsive: Stack buttons on smaller screens if needed */
@media (max-width: 480px) {
    #fileUploadConsentModal .cs-modal-button-group {
        flex-direction: column;
        width: 100%;
    }
    
    #fileUploadConsentModal .cs-btn-primary,
    #fileUploadConsentModal .cs-btn-secondary-action {
        width: 100%;
    }
}

/* ========================================
   PREMIUM CONSENT MODAL STYLING 
   ======================================== */

/* New premium info grid styling */
.privacy-info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 24px 0;
}

.privacy-info-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: var(--vc-bg-input);
    border: 1px solid var(--vc-border-default);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.privacy-info-item:hover {
    background: var(--vc-bg-input);
    border-color: var(--vc-border-emphasis);
    transform: translateY(-2px);
}

.privacy-info-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 10px;
    color: #3b82f6;
}

.privacy-info-text {
    flex: 1;
}

.privacy-info-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--vc-text-primary);
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.privacy-info-desc {
    font-size: 13px;
    color: var(--vc-text-muted);
    line-height: 1.5;
}

/* Updated modal header styling */
.privacy-modal-header {
    text-align: center;
    padding: 32px 32px 24px;
    border-bottom: 1px solid var(--vc-border-default);
}

.privacy-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.15));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #3b82f6;
}

.privacy-modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.privacy-subtitle {
    font-size: 14px;
    color: var(--vc-text-muted);
    margin: 0;
    font-weight: 400;
}

/* Updated modal body */
.privacy-modal-body {
    padding: 32px;
    max-height: 60vh;
    overflow-y: auto;
}

/* Cleaner checkbox styling */
.privacy-checkbox-group {
    margin-top: 32px;
    padding: 20px;
    background: var(--vc-bg-input);
    border: 1px solid var(--vc-border-emphasis);
    border-radius: 12px;
}

.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.privacy-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #3b82f6;
}

.privacy-checkbox span {
    font-size: 14px;
    line-height: 1.6;
    color: var(--vc-text-primary);
}

/* Modal footer styling */
.privacy-modal-footer {
    padding: 24px 32px;
    border-top: 1px solid var(--vc-border-default);
    background: transparent;
}

.cs-modal-button-group {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.cs-btn-secondary-action,
.cs-btn-primary {
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
}

.cs-btn-secondary-action {
    background: var(--vc-border-emphasis);
    color: var(--vc-text-primary);
}

.cs-btn-secondary-action:hover {
    background: var(--vc-border-emphasis);
}

.cs-btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.cs-btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-1px);
}

.cs-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.cs-btn-primary.cs-btn-enabled {
    opacity: 1;
}

/* Scrollbar styling for modal body */
.privacy-modal-body::-webkit-scrollbar {
    width: 8px;
}

.privacy-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.privacy-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.privacy-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* ============================================= */
/* Responsive Design for Categories             */
/* ============================================= */

@media (max-width: 768px) {
    .cs-stats-summary-clean {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .cs-stat-block:not(:last-child) {
        border-right: none;
        border-bottom: 1px solid var(--vc-border-default);
        padding-bottom: 16px;
    }
    
    .cs-success-section .cs-source-item {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .cs-success-reference-input {
        max-width: 100%;
    }
    
    .cs-success-section .cs-source-status {
        justify-self: start;
    }
    
    .cs-uncited-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .cs-download-audit-btn {
        width: 100%;
        justify-content: center;
    }
    
    .cs-links-toggle {
        flex-wrap: wrap;
    }
    
    .cs-toggle-btn {
        flex-shrink: 0;
        min-width: calc(50% - 6px);
    }
}

@media (max-width: 480px) {
    .cs-subsection {
        padding: 16px;
    }
    
    .cs-subsection-hint {
        font-size: 13px;
        padding: 12px 14px;
    }
    
    .cs-format-card {
        padding: 12px 16px;
    }
}

@media (max-width: 640px) {
    .privacy-modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .privacy-modal-header,
    .privacy-modal-body,
    .privacy-modal-footer {
        padding: 24px 20px;
    }
    
    .privacy-info-item {
        padding: 16px;
    }
    
    .cs-modal-button-group {
        flex-direction: column;
    }
    
    .cs-btn-secondary-action,
    .cs-btn-primary {
        width: 100%;
        justify-content: center;
    }
}


/* ================================================
   PRIVACY SETTINGS MODAL - V3 TOGGLE STYLING
   ================================================ */

/* Specific spacing fixes for Privacy Settings modal */
#fileUploadConsentModal .privacy-modal-header {
    padding-bottom: 20px;
    margin-bottom: 0;
}

#fileUploadConsentModal .privacy-modal-body {
    padding-top: 20px;
    padding-bottom: 20px;
}

#fileUploadConsentModal .privacy-consent-section {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

#fileUploadConsentModal .privacy-feature-item.privacy-info-note {
    margin-bottom: 14px;
}

/* Wider internal panels to prevent text/button overlap */
#fileUploadConsentModal .privacy-feature-item.privacy-settings-row {
    padding: 16px 24px;
    gap: 24px;
}

/* Add divider line between Uploaded Files and Privacy mode section */
#fileUploadConsentModal .privacy-features-list {
    margin-bottom: 0;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--vc-border-default);
}

/* Privacy info + checkbox grouping with spacing from divider */
#fileUploadConsentModal .privacy-info-note {
    margin-top: 20px;
}

#fileUploadConsentModal .privacy-modal-footer {
    padding-top: 20px;
    padding-bottom: 28px;
    margin-top: 0;
}

/* Settings row layout within feature items */
.privacy-feature-item.privacy-settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--vc-border-default);
}

.privacy-feature-item.privacy-settings-row:hover {
    background: var(--vc-border-subtle);
    border-color: rgba(67, 132, 255, 0.15);
}

.privacy-feature-item.privacy-settings-row .privacy-feature-text {
    flex: 1;
    min-width: 0;
}

.privacy-feature-item.privacy-settings-row .privacy-feature-text strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.privacy-feature-item.privacy-settings-row .privacy-feature-text p {
    font-size: 13px;
    margin: 0;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* Privacy info note styling */
.privacy-feature-item.privacy-info-note {
    background: linear-gradient(135deg, rgba(67, 132, 255, 0.06) 0%, rgba(123, 66, 255, 0.03) 100%);
    border: 1px solid rgba(99, 102, 241, 0.15);
    margin-top: 8px;
    margin-bottom: 0;
}

.privacy-feature-item.privacy-info-note .privacy-feature-icon {
    width: 32px;
    height: 32px;
    min-width: 32px;
}

.privacy-feature-item.privacy-info-note .privacy-feature-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.privacy-feature-item.privacy-info-note .privacy-feature-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Toggle container */
.privacy-toggle-container {
    flex-shrink: 0;
}

/* V3 Toggle Switch - Consistent with other modals */
.privacy-settings-toggle {
    position: relative;
    display: inline-flex;
    cursor: pointer;
}

.privacy-settings-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track-v3 {
    position: relative;
    display: flex;
    align-items: center;
    width: 140px;
    height: 36px;
    background: var(--vc-border-default);
    border-radius: 10px;
    border: 1px solid var(--vc-border-emphasis);
    padding: 3px;
    transition: all 0.3s ease;
}

.toggle-track-v3:hover {
    border-color: rgba(67, 132, 255, 0.3);
    background: var(--vc-border-default);
}

.toggle-label-left,
.toggle-label-right {
    flex: 1;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--vc-text-muted);
    z-index: 1;
    transition: color 0.3s ease;
    pointer-events: none;
    user-select: none;
}

/* Left label active when unchecked */
.privacy-settings-toggle input:not(:checked) ~ .toggle-track-v3 .toggle-label-left {
    color: var(--text-primary);
}

/* Right label active when checked */
.privacy-settings-toggle input:checked ~ .toggle-track-v3 .toggle-label-right {
    color: white;
}

/* Slider background */
.toggle-slider-v3 {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: linear-gradient(135deg, #4384ff 0%, #7b42ff 100%);
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(67, 132, 255, 0.3);
}

/* When unchecked (Standard mode) - slider on left with different color */
.privacy-settings-toggle input:not(:checked) ~ .toggle-track-v3 .toggle-slider-v3 {
    background: var(--vc-border-emphasis);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* When checked (Private mode) - slider moves to right */
.privacy-settings-toggle input:checked ~ .toggle-track-v3 .toggle-slider-v3 {
    transform: translateX(calc(100% + 3px));
    background: linear-gradient(135deg, #4384ff 0%, #7b42ff 100%);
}

/* ================================================
   LIGHT THEME SUPPORT FOR PRIVACY SETTINGS MODAL
   ================================================ */

[data-theme="light"] .privacy-feature-item.privacy-settings-row {
    background: rgba(15, 23, 42, 0.02);
    border-color: rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .privacy-feature-item.privacy-settings-row:hover {
    background: rgba(15, 23, 42, 0.04);
    border-color: rgba(67, 132, 255, 0.2);
}

[data-theme="light"] .privacy-feature-item.privacy-settings-row .privacy-feature-text strong {
    color: #1e293b;
}

[data-theme="light"] .privacy-feature-item.privacy-settings-row .privacy-feature-text p {
    color: #64748b;
}

[data-theme="light"] .privacy-feature-item.privacy-info-note {
    background: linear-gradient(135deg, rgba(67, 132, 255, 0.08) 0%, rgba(123, 66, 255, 0.04) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .privacy-feature-item.privacy-info-note .privacy-feature-text {
    color: #64748b;
}

[data-theme="light"] .privacy-feature-item.privacy-info-note .privacy-feature-text strong {
    color: #1e293b;
}

[data-theme="light"] .toggle-track-v3 {
    background: rgba(15, 23, 42, 0.06);
    border-color: rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .toggle-track-v3:hover {
    background: rgba(15, 23, 42, 0.08);
    border-color: rgba(67, 132, 255, 0.3);
}

[data-theme="light"] .toggle-label-left,
[data-theme="light"] .toggle-label-right {
    color: #94a3b8;
}

[data-theme="light"] .privacy-settings-toggle input:not(:checked) ~ .toggle-track-v3 .toggle-label-left {
    color: #1e293b;
}

[data-theme="light"] .privacy-settings-toggle input:checked ~ .toggle-track-v3 .toggle-label-right {
    color: white;
}

[data-theme="light"] .privacy-settings-toggle input:not(:checked) ~ .toggle-track-v3 .toggle-slider-v3 {
    background: rgba(15, 23, 42, 0.1);
}

/* Light theme overrides for modal elements inherited from app-landing-page.css */
[data-theme="light"] #fileUploadConsentModal .privacy-modal-content {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

[data-theme="light"] #fileUploadConsentModal .privacy-lock-icon-wrapper {
    background: linear-gradient(135deg, rgba(67, 132, 255, 0.1), rgba(123, 66, 255, 0.1));
}

[data-theme="light"] #fileUploadConsentModal .privacy-modal-header h2 {
    color: #1e293b;
}

[data-theme="light"] #fileUploadConsentModal .privacy-subtitle {
    color: #64748b;
}

[data-theme="light"] #fileUploadConsentModal .privacy-feature-icon.privacy-icon-gradient {
    background: linear-gradient(135deg, rgba(67, 132, 255, 0.12), rgba(123, 66, 255, 0.12));
}