:root {
    --bs-body-font-family: "Archivo",
        serif;
    scroll-behavior: smooth;
    --nav-transition-timing: 0.3s ease;
}

table .orderable.desc {
    background: url("images/sort-down.bbbad99a2476.svg") no-repeat right center;
}

table .orderable.asc {
    background: url("images/sort-up.36c3ae3fb326.svg") no-repeat right center;
}

/* icons */
.bi-info-circle-fill {
    color: rgb(60, 154, 134);
    font-size: 1rem;
}

.bi-square-fill {
    color: blue;
    font-size: 1rem;
}

.landing-card {
    transition: all 0.3s
}

.landing-card:hover {
    transform: scale(1.05);
}

/* Crispy Forms */
.asteriskField {
    display: none;
}

.colour-icon {
    transition: all 0.3s !important;
}

.colour-icon:hover {
    transform: scale(1.05) !important;
}

.popover {
    max-width: 600px;
}

.color-mode-sel.square-btn {
    width: 30px;
    /* Square size */
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid grey;
    background-color: transparent;
    cursor: pointer;
    font-size: 12px;
    /* Icon size */
}


.color-mode-sel.btn-left {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
}

.color-mode-sel.btn-right {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
}


.color-mode-sel.btn-center {
    border-radius: 0;
}

/* Hover effect */
.color-mode-sel.square-btn:hover {
    background-color: #f0f0f0;
}

#main-content {
    transition: padding-left var(--nav-transition-timing);
    will-change: padding-left;
}



/* Remove all noUiSlider related CSS - Start cleanup */

/* Remove these blocks completely as we're no longer using noUiSlider */
/* noUiSlider custom styles - END */

/* Add general AG Grid related styles if needed */
.ag-theme-alpine {
    --ag-font-family: var(--bs-body-font-family);
    --ag-font-size: 14px;
}

/* Keep all other existing CSS unrelated to sliders */

/* ---------- AG GRID STYLING START ---------- */
/* Specific styles for AG Grid tables in the multi-content selection interface */

.ag-theme-alpine {
    --ag-header-background-color: #f8f9fa;
    --ag-odd-row-background-color: rgba(0, 0, 0, 0.02);
    cursor: pointer;
}

.ag-header-cell.ag-header-cell-checkbox .ag-header-select-all {
    cursor: pointer;
    margin-right: 5px;
}

.ag-row.ag-row-clickable,
.ag-row.ag-row-clickable .ag-cell {
    cursor: pointer !important;
}

.ag-row:not(.ag-row-clickable),
.ag-row:not(.ag-row-clickable) .ag-cell {
    cursor: default !important;
}

.selected-row {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.ag-checkbox-input-wrapper {
    opacity: 1 !important;
    width: 16px !important;
    height: 16px !important;
}

.transcription-link {
    color: var(--bs-primary);
    text-decoration: none;
    position: relative;
    z-index: 5;
}

.transcription-link:hover {
    text-decoration: underline;
}

/* ---------- AG GRID STYLING END ---------- */

/* Collapse indicator caret for collapsible headings (shared by framework analysis steps) */
.collapse-indicator {
    transition: transform 0.3s;
}

.collapsed .collapse-indicator {
    transform: rotate(-90deg);
}


/* Responsive typography and spacing */
/* Mobile typography adjustments */
@media (max-width: 767.98px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    h4 { font-size: 1.1rem; }
    h5 { font-size: 1rem; }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
    }
}

/* Tablet typography adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* Large screen typography enhancements */
@media (min-width: 1400px) {
    h1 { font-size: 2.75rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.875rem; }
    
    .lead {
        font-size: 1.375rem;
    }
}

/* Responsive table improvements */
@media (max-width: 767.98px) {
    .table-responsive {
        border: none;
    }
    
    .table {
        font-size: 0.875rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
}

/* Form responsive improvements */
@media (max-width: 767.98px) {
    .form-control,
    .form-select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .input-group {
        flex-wrap: wrap;
    }
    
    .input-group .btn {
        margin-top: 0.5rem;
    }
}

/* Card responsive spacing */
@media (max-width: 767.98px) {
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

@media (min-width: 1400px) {
    .card-body {
        padding: 2rem;
    }
}

/* Modal responsive improvements */
@media (max-width: 767.98px) {
    .modal-dialog {
        margin: 0.5rem;
    }
    
    .modal-content {
        border-radius: 0.375rem;
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }
}

/* Toast: override Bootstrap's translucent background */
.toast {
    --bs-toast-bg: #fff;
}

/* Toast positioning for mobile */
@media (max-width: 767.98px) {
    .toast-container {
        position: fixed !important;
        top: 70px !important; /* Below mobile nav button */
        left: 15px !important;
        right: 15px !important;
        width: auto !important;
    }
    
    .toast {
        max-width: none;
    }
}

/* Prevent text selection on clickable table rows (double-click flash) */
.dev-task-row {
    user-select: none;
}

/* Analysis Catalog Styles */
.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: rgba(var(--bs-primary-rgb), 0.05);
}

.focus-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Chevron rotation animation for collapsible cards */
.btn[aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

.bi-chevron-down {
    transition: transform 0.2s ease-in-out;
}

/* Navigation hover effects */
.vertical-navbar .nav-link:hover {
    background-color: var(--bs-primary-bg-subtle);
    color: var(--bs-primary);
    font-weight: bold;
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.vertical-navbar .nav-link[href*="admin"]:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

/* Make checkboxes more visible with darker borders */
.form-check-input {
    border-color: #495057 !important;
    border-width: 2px !important;
}

.form-check-input:focus {
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25) !important;
}

.form-check-input:checked {
    background-color: #0d6efd !important;
    border-color: #0d6efd !important;
}

.cursor-help {
    cursor: help;
}

/* ---------- MULTI-ANALYSIS STYLING START ---------- */

/* Section headings - subtle left accent instead of full bottom border */
.analysis-section-heading {
    font-weight: 600;
    border-left: 3px solid var(--bs-primary);
    padding-left: 0.75rem;
    margin-bottom: 1rem;
    color: var(--bs-body-color);
}

/* Overview card - white bg, left accent, subtle shadow */
.analysis-overview-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.analysis-overview-card .card-body p {
    margin-bottom: 0.5rem;
}

.analysis-overview-card .card-body p:last-child {
    margin-bottom: 0;
}

/* Sessions list in job detail */
.analysis-sessions-list .list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.5rem 0.75rem;
}

.analysis-sessions-list .list-group-item:first-child {
    border-top: none;
}

/* Cross-session insights and development synthesis markdown content */
.cross-session-insights-content strong,
.development-synthesis-content strong {
    font-weight: 700;
}

.cross-session-insights-content em,
.development-synthesis-content em {
    font-style: italic;
}

.cross-session-insights-content p,
.development-synthesis-content p {
    margin-bottom: 1rem;
}

/* Synthesis/insights card - primary left border, white body */
.analysis-synthesis-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.375rem;
}

/* Turning point / pattern evolution cards - standardized text */
.analysis-turning-point .card-body p {
    color: var(--bs-body-color);
}

/* Accordion - lighter alerts inside */
.analysis-accordion .alert {
    border: none;
    font-size: 0.9rem;
}

.analysis-accordion .alert strong {
    font-weight: 600;
}

/* Practice swaps side-by-side backgrounds */
.practice-swap-replace {
    border-left: 3px solid var(--bs-danger);
    padding-left: 0.75rem;
}

.practice-swap-with {
    border-left: 3px solid var(--bs-success);
    padding-left: 0.75rem;
}

/* Analysis reference (was emoji magnifying glass) */
.analysis-reference {
    color: var(--bs-secondary-color);
    font-size: 0.85rem;
    font-style: italic;
}

/* ---------- MULTI-ANALYSIS STYLING END ---------- */

/* ---------- ANALYSIS PERSPECTIVE MARKDOWN FORMATTING ---------- */
.analysis-perspective-content strong {
    font-weight: 700 !important;
}
.analysis-perspective-content em {
    font-style: italic !important;
}
.analysis-perspective-content p {
    margin-bottom: 1rem;
}
.analysis-perspective-content ul, .analysis-perspective-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}
.analysis-perspective-content h1, .analysis-perspective-content h2,
.analysis-perspective-content h3, .analysis-perspective-content h4,
.analysis-perspective-content h5, .analysis-perspective-content h6 {
    font-weight: 600 !important;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* ---------- HOME & ADMIN CARD HOVER ---------- */
.home-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.home-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.15) !important;
}
.home-card .card-body {
    padding-top: 1.5rem;
}
/* ---------- SELECTION CARD PATTERN ---------- */
/* Shared by analysis type and upload type card selectors */
.selection-card {
    cursor: pointer;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.selection-card:hover {
    border-color: var(--bs-primary);
}
.selection-card.active {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* ---------- JOB STATUS STYLING ---------- */
:root {
    --status-sage: #5a7d5f;
    --status-sage-light: #7a9d7f;
    --status-forest: #3d5a40;
    --status-cream: #f8f6f2;
    --status-warm-gray: #6b6b6b;
    --status-success: #2d6a4f;
    --status-error: #c1554f;
    --status-shadow: rgba(61, 90, 64, 0.08);
}

.job-status-container {
    text-align: center;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--status-cream) 0%, #ffffff 100%);
    border-radius: 12px;
    box-shadow: 0 2px 16px var(--status-shadow);
    margin-bottom: 1rem;
}

.job-status-icon-wrapper {
    margin-bottom: 1rem;
}

.job-status-heading {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--status-forest);
}

.job-status-message {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--status-warm-gray);
    margin: 0 auto 0.35rem;
    max-width: 500px;
}

.job-status-timing {
    font-size: 0.85rem;
    color: var(--status-sage-light);
    margin-top: 0.35rem;
}

.job-status-error-details {
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    background: rgba(193, 85, 79, 0.06);
    border-left: 3px solid var(--status-error);
    border-radius: 6px;
    text-align: left;
}

.job-status-error-details strong {
    color: var(--status-error);
    font-weight: 600;
}

.job-status-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(90, 125, 95, 0.1);
    border-top-color: var(--status-sage);
    border-radius: 50%;
    animation: jobStatusSpin 1s linear infinite;
    margin: 0 auto 1rem;
}

.job-status-icon {
    font-size: 3.5rem;
    display: inline-block;
}

.job-status-icon.success {
    color: var(--status-success);
}

.job-status-icon.error {
    color: var(--status-error);
}

@keyframes jobStatusSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- ONBOARDING ---------- */
.onboarding-hero {
    background: linear-gradient(135deg, #0a4a6e 0%, #0f6797 40%, #1a8bc4 100%);
    border-radius: 1rem;
    position: relative;
    overflow: hidden;
}
.onboarding-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(255,255,255,0.06) 0%, transparent 70%);
    pointer-events: none;
}
.onboarding-plan-card {
    border: 2px solid var(--bs-border-color);
    border-radius: 0.75rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}
.onboarding-plan-card:hover {
    border-color: var(--bs-primary);
    box-shadow: 0 4px 20px rgba(15, 103, 151, 0.15);
    color: inherit;
}
.onboarding-plan-card.selected {
    border-color: var(--bs-primary);
    background-color: rgba(15, 103, 151, 0.04);
    box-shadow: 0 4px 20px rgba(15, 103, 151, 0.18);
}
.onboarding-plan-card:focus-visible {
    outline: none;
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(15, 103, 151, 0.25);
}
.onboarding-plan-card.annual-card {
    border-color: var(--bs-success);
}
.onboarding-plan-card.annual-card:hover {
    border-color: var(--bs-success);
    box-shadow: 0 4px 20px rgba(25, 135, 84, 0.2);
}
.onboarding-email-section {
    border-left: 3px solid var(--bs-primary);
    background: var(--bs-light);
    border-radius: 0 0.5rem 0.5rem 0;
}
.onboarding-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--bs-secondary);
    font-size: 0.85rem;
    font-weight: 600;
}
.onboarding-divider::before,
.onboarding-divider::after {
    content: '';
    flex: 1;
    border-top: 1px solid var(--bs-border-color);
}

/* ---------- SIGNUP ---------- */
@media (min-width: 768px) {
    .border-start-md {
        border-left: 1px solid #dee2e6 !important;
    }
}
.password-help-icon {
    color: var(--bs-secondary);
    cursor: pointer;
    font-size: 0.85rem;
}
.password-help-icon:hover {
    color: var(--bs-primary);
}
@media (max-width: 767.98px) {
    .signup-card .card-body { padding: 1rem !important; }
    .signup-card .form-check label { font-size: 0.85rem; }
    .signup-card .mb-3 { margin-bottom: 0.5rem !important; }
    .signup-card :not(.form-floating) > label[for="id_email"],
    .signup-card :not(.form-floating) > label[for="id_password1"],
    .signup-card :not(.form-floating) > label[for="id_password2"] { display: none; }
}

/* ---------- AG GRID HEADER CENTERING ---------- */
.ag-header-cell-center .ag-header-cell-label {
    justify-content: center;
}

/* ---------- SCROLL MARGIN FOR LINKED ANALYSIS ITEMS ---------- */
[data-analysis-uuid] {
    scroll-margin-top: 100px;
}

/* ---------- ANALYSIS ADMIN SUMMARY ---------- */
.prompt-element-content {
    background-color: #f8f9fa;
}
.prompt-element:hover .prompt-element-content {
    background-color: #f1f3f4;
}
.analysis-admin-summary .card {
    border: none;
    border-radius: 8px;
}
.analysis-admin-summary .card-header {
    border-radius: 8px 8px 0 0 !important;
}
.analysis-admin-summary pre {
    margin: 0;
    tab-size: 2;
}

/* AG Grid custom tooltip used by the ethics column on the transcription list. */
.ag-tooltip.ethics-tooltip {
    max-width: 28rem;
    white-space: normal;
    line-height: 1.35;
    padding: 0.6rem 0.75rem;
}

/* ============================================================
   Walkthrough tour (driver.js) - friendly, branded popover styling.
   Uses native CSS nesting; all rules scoped under .walkthrough-popover.
   ============================================================ */

.driver-popover.walkthrough-popover {
    --wt-primary: var(--bs-primary);
    --wt-primary-rgb: var(--bs-primary-rgb);
    --wt-ink: #2c3338;
    --wt-ink-muted: #4a5560;
    --wt-rule: rgba(15, 30, 50, 0.08);
    --wt-transition: 0.15s ease;

    background: #fff;
    color: var(--wt-ink);
    border: none;
    border-radius: 14px;
    box-shadow:
        0 1px 2px rgba(15, 30, 50, 0.06),
        0 12px 32px rgba(15, 30, 50, 0.18);
    padding: 1.5rem 1.65rem 1.25rem;
    max-width: 380px;
    font-family: inherit;

    .driver-popover-title {
        display: flex;
        align-items: center;
        gap: 0.6rem;
        color: var(--wt-primary);
        font-weight: 600;
        font-size: 1.1rem;
        line-height: 1.3;
        margin: 0 0 0.6rem 0;
        padding: 0;
    }

    .walkthrough-title-icon {
        flex-shrink: 0;
        display: inline-block;
    }

    .driver-popover-description {
        color: var(--wt-ink-muted);
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1.1rem;
    }

    .driver-popover-footer {
        border-top: 1px solid var(--wt-rule);
        padding-top: 0.85rem;
        margin-top: 0;
        align-items: center;
        gap: 0.5rem;
    }

    .driver-popover-progress-text {
        color: #6c757d;
        font-size: 0.825rem;
        font-weight: 500;
    }

    .driver-popover-prev-btn,
    .driver-popover-next-btn {
        display: inline-block;
        border-radius: 999px;
        border: 1px solid transparent;
        padding: 0.45rem 1.1rem;
        font-size: 0.875rem;
        font-weight: 500;
        line-height: 1.5;
        text-shadow: none;
        cursor: pointer;
        transition:
            background-color var(--wt-transition),
            border-color var(--wt-transition),
            color var(--wt-transition),
            box-shadow var(--wt-transition),
            transform var(--wt-transition);
    }

    .driver-popover-next-btn {
        background-color: var(--wt-primary);
        color: #fff;

        &:hover {
            background-color: rgba(var(--wt-primary-rgb), 0.88);
            color: #fff;
            box-shadow: 0 3px 10px rgba(var(--wt-primary-rgb), 0.25);
            transform: translateY(-1px);
        }
    }

    .driver-popover-prev-btn {
        background-color: transparent;
        color: var(--wt-primary);
        border-color: rgba(var(--wt-primary-rgb), 0.3);

        &:hover {
            background-color: rgba(var(--wt-primary-rgb), 0.08);
            border-color: var(--wt-primary);
        }
    }

    .driver-popover-btn-disabled {
        opacity: 0.4;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .driver-popover-close-btn {
        color: #6c757d;
        font-size: 1.4rem;
        line-height: 1;
        width: 28px;
        height: 28px;
        top: 12px;
        right: 12px;
        opacity: 0.55;
        border-radius: 50%;
        transition:
            opacity var(--wt-transition),
            background-color var(--wt-transition),
            color var(--wt-transition);

        &:hover {
            opacity: 1;
            color: var(--wt-primary);
            background-color: rgba(var(--wt-primary-rgb), 0.08);
        }
    }
}