/* OAF Checklist Specific Styles */
/* ALL styles scoped using :is() for both oaf_script and oaf_assistant workflows */

:root {
    /* Light theme variables */
    --background-color: #e7e5dc;
    --oaf-widget-card-bg: #e7e9ec;
    --item-background: rgba(244, 243, 243, 0.84);
    --expanded-item-bg: #d7dee4;
    --completed-item-bg: rgb(105 137 119 / 46%);
    --completed-item-bg-hover: rgb(46 204 113 / 15%);
    --oaf-widget-header-bg: #e9ecef; 
    --widget-progress-bar: #f3f4f5; 
    --oaf-controls-button-bg: #dee2e5;
    --text-color: #101010;
    --expanded-bg: #ffffff;
    --oaf-widget-border-color: #e0e0e0;
    --key-note-title: #938706;
}

body.dark-theme {
    /* Dark theme variables */
    --background-color: #1a1a1a;
    --oaf-widget-card-bg: #1e222f;
    --item-background: rgb(82 83 89 / 64%);
    --expanded-item-bg: rgb(98 97 97 / 39%);
    --completed-item-bg: rgba(46, 204, 113, 0.15);
    --completed-item-bg-hover: rgba(46, 204, 113, 0.25);
    --oaf-widget-header-bg: #2c2c3a;
    --widget-progress-bar: #fff;
    --oaf-controls-button-bg: #2f3b44;
    --text-color: #fff;
    --expanded-bg: rgb(255 255 255 / 11%);
    --oaf-widget-border-color: rgba(255, 255, 255, 0.1);
    --key-note-title: #b0b421;
}

/* OAF-specific intro screen */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-intro {
    padding: 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-intro h2 {
    margin-bottom: 16px;
    color: var(--text-color, #2c3e50);
    font-size: 24px;
    font-weight: 600;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-intro p {
    color: var(--icon-color, #7f8c8d);
    margin-bottom: 32px;
    font-size: 15px;
    line-height: 1.6;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-id-input-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
    /* align-items: center; */
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-id-input {
    padding: 12px 16px;
    border: 2px solid var(--border-color, #ddd);
    border-radius: 6px;
    font-size: 16px;
    /* width: 200px; */
    transition: border-color 0.2s;
    /* background-color: var(--input-bg, white); */
    color: var(--text-color, #333);
}

/* Remove number input spinners */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-id-input::-webkit-inner-spin-button,
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-id-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-id-input[type="number"] {
    -moz-appearance: textfield;
} */

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-id-input:focus {
    outline: none;
    border-color: #3498db;
}

/* Loading indicator */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    min-height: 400px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color, #f3f3f3);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: oaf-spin 1s linear infinite;
    margin-bottom: 20px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-loading p {
    color: var(--icon-color, #7f8c8d);
    font-size: 16px;
}

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

/* OAF Checklist layout */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-checklist {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1000px;
    margin: auto;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color, #eee);
    background: var(--oaf-widget-header-bg, #f8f9fa);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgb(157 151 114 / 30%);
    z-index: 100;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-title h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-color, #2c3e50);
    font-weight: 600;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-badge {
    background-color: #c6cbd0;
    color: black;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-external-link {
    color: #3498db;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-external-link:hover {
    color: #2980b9;
    transform: scale(1.1);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-external-link i {
    font-size: 11px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-progress {
    margin-bottom: 8px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-progress span {
    font-size: 14px;
    color: var(--icon-color, #7f8c8d);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-toggle-completed {
    background: #3498db;
    color: white;
    border: none;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-toggle-completed:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-toggle-completed:active {
    transform: translateY(0);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .progress-bar {
    width: 100%;
    height: 6px;
    background: var(--widget-progress-bar);
    border-radius: 3px;
    overflow: hidden;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71 0%, #27ae60 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-controls {
    display: inline-flex;
    gap: 8px;
    float: right;
}

.workflow-widget-container .oaf-controls .btn-icon {
    background: var(--oaf-controls-button-bg);
}

/* Checklist items container */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scroll-behavior: auto; /* Changed from smooth to auto - prevents conflicts with manual scroll adjustments */
    scrollbar-width: thin;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item {
    background: var(--oaf-widget-card-bg);
    border: 1px solid var(--border-color, #eee);
    border-radius: 8px;
    padding: 16px 10px;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item:hover {
    box-shadow: 0 2px 8px var(--shadow-color, rgba(0,0,0,0.3));
    background: var(--item-background);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.completed:hover {
    background: var(--completed-item-bg-hover)!important;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.completed {
    background: var(--completed-item-bg)!important;
    box-shadow: 0 4px 12px rgb(96 118 94 / 5%);
    border-left: 4px solid green !important;
}

/* Animation for items being marked as completed */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.completing {
    animation: slideUpFadeOut 0.5s ease-out forwards;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .category-completion {
    background: linear-gradient(135deg, rgb(193 130 28 / 69%) 0%, rgb(249 175 94 / 5%) 100%);
    border-left: 4px solid #dd8f13;
}

@keyframes slideUpFadeOut {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
        max-height: 500px;
    }
    30% {
        background: rgba(46, 204, 113, 0.3);
        border-left-color: #2ecc71;
    }
    60% {
        opacity: 0.5;
        transform: translateY(-50px) scale(0.98);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.95);
        max-height: 0;
        margin-bottom: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.expanded {
    background: var(--expanded-item-bg) !important;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-check {
    background: none;
    border: none;
    font-size: 24px;
    color: #bdc3c7;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    flex-shrink: 0;
    align-self: center;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-check i:hover {
    color: white;
    box-shadow: 0 2px 4px rgba(97, 97, 97, 0.3);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-check i {
    color: #f1f1f1;
    border: 1px solid #555;
    border-radius: 50px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-content-wrapper {
    flex: 1;
    min-width: 0;
    cursor: pointer;
    padding: 4px 0;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-content-wrapper:hover {
    opacity: 0.9;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    align-self: center;
    min-width: 56px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-actions.ask-ai-hidden {
    visibility: hidden;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-check.checked {
    color: #5b9e77;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-check:hover {
    color: #3498db;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-title {
    font-weight: 600;
    color: var(--text-color, #2c3e50);
    font-size: 15px;
    padding-bottom: 5px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .badge-required {
    background: #e74c3c;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-ask-ai i {
    margin-right: 4px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    top: -5px;
    position: relative;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-title-row:hover {
    opacity: 0.85;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .badge-upsell {
    background: linear-gradient(135deg, #b9e2fe 0%, #2d6e99 100%);
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.3);
    margin-right: -65px;
    margin-top: -30px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .view-more {
    color: #3498db;
    font-size: 13px;
    font-style: italic;
    font-weight: 500;
    margin-top: 4px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-description {
    color: var(--icon-color, #7f8c8d);
    font-size: 14px;
    line-height: 1.5;
    /* margin-bottom: 8px; */
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-ask-ai {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: opacity 0.2s;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-ask-ai:hover {
    opacity: 1;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .ask-ai-label {
    font-size: 11px;
    color: var(--text-color, #2c3e50);
    font-weight: 500;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .expand-arrow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .expand-indicator {
    color: var(--icon-color, #7f8c8d);
    font-size: 14px;
    transition: transform 0.2s;
}

/* OAF Footer */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color, #eee);
    background: var(--oaf-widget-header-bg, #f8f9fa);
    box-shadow: 1px -1px 7px -2px rgba(0,0,0,0.66);
}

.workflow-widget-container .auto-notify-toggle input {
    vertical-align: middle;
}

.workflow-widget-container .auto-notify-toggle span {
    font-weight: 600;
    color: var(--text-color, #2c3e50);
    font-size: 14px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .completion-message {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1) 0%, rgba(39, 174, 96, 0.15) 100%);
    border-left: 4px solid #2ecc71;
    border-radius: 6px;
    animation: slideInUp 0.4s ease-out;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .completion-message i {
    color: #f39c12;
    font-size: 20px;
    flex-shrink: 0;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .completion-message span {
    color: var(--text-color, #2c3e50);
    font-size: 14px;
    line-height: 1.5;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-card {
    display: flex;
    align-items: center;
    flex-direction: column;
    text-align: center;
    gap: 30px;
    padding: 70px 22px;
    margin: 16px 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(123, 97, 255, 0.15) 0%, rgba(64, 186, 255, 0.18) 100%);
    border: 1px solid rgba(127, 94, 255, 0.4);
    box-shadow: 0 12px 30px rgba(74, 58, 255, 0.18);
    position: relative;
    overflow: hidden;
}

body:not(.dark-theme) .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-card {
    background: radial-gradient(circle at top, rgba(149, 124, 255, 0.25) 0%, rgba(89, 197, 255, 0.35) 55%, rgba(255, 255, 255, 0.9) 100%);
    border-color: rgba(69, 115, 255, 0.4);
    box-shadow: 0 25px 55px rgba(105, 128, 255, 0.28);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-illustration {
    width: 110px;
    height: 110px;
    position: relative;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(255, 255, 255, 0.4);
    animation: oafCelebratePulse 4s linear infinite;
}

body:not(.dark-theme) .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-ring {
    border-color: rgba(74, 58, 255, 0.3);
    box-shadow: 0 0 25px rgba(74, 58, 255, 0.25);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-badge {
    width: 64px;
    height: 64px;
    position: absolute;
    top: 23px;
    left: 23px;
    filter: drop-shadow(0 6px 10px rgba(79, 70, 229, 0.5));
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-sparkle {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0) 70%);
    animation: oafCelebrateSparkle 2.2s ease-in-out infinite;
    opacity: 0.8;
}

body:not(.dark-theme) .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-sparkle {
    background: radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(105,170,255,0.25) 70%);
    box-shadow: 0 0 20px rgba(83, 110, 255, 0.45);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .sparkle-1 { top: 6px; left: 48px; animation-delay: 0s; }
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .sparkle-2 { bottom: 4px; right: 12px; animation-delay: 0.5s; }
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .sparkle-3 { top: 18px; right: 8px; animation-delay: 1s; }

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-copy h4 {
    margin: 0 0 30px;
    font-size: 18px;
    color: var(--text-color, #1c1c1c);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-celebration-copy p {
    margin: 0;
    color: var(--icon-color, #4f566b);
    font-size: 14px;
    line-height: 1.6;
}

@keyframes oafCelebratePulse {
    0% { transform: scale(0.9); opacity: 0.6; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.05); opacity: 0.6; }
}

@keyframes oafCelebrateSparkle {
    0%, 100% { transform: scale(0.9); opacity: 0.4; }
    50% { transform: scale(1.4); opacity: 1; }
}

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

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-submit {
    width: 100%;
    background: #2ecc71;
    color: white;
    border: none;
    padding: 14px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-submit:hover:not(.disabled) {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(46, 204, 113, 0.3);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-submit.disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

/* Success screen */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-success {
    padding: 60px 40px;
    text-align: center;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .success-icon {
    font-size: 64px;
    color: #2ecc71;
    margin-bottom: 24px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-success h2 {
    color: var(--text-color, #2c3e50);
    margin-bottom: 16px;
    font-size: 24px;
    font-weight: 600;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-success p {
    color: var(--icon-color, #7f8c8d);
    margin-bottom: 12px;
    font-size: 15px;
    line-height: 1.6;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .success-actions {
    margin-top: 32px;
}

/* Collapsed panel specific to OAF */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-collapsed-panel {
    padding: 12px 8px;
}

/* Responsive adjustments for OAF */
@media (max-width: 768px) {
    .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-intro {
        padding: 30px 20px;
    }

    .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-id-input-group {
        flex-direction: column;
        width: 100%;
    }

    .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .container-id-input {
        width: 100%;
    }

    .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-ask-ai {
        align-self: flex-start;
    }
}

/* Scrollbar for OAF items container */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-items-container::-webkit-scrollbar {
    width: 8px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-items-container::-webkit-scrollbar-track {
    background: var(--scrollbar-track, #f1f1f1);
    border-radius: 4px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-items-container::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb, #bdc3c7);
    border-radius: 4px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-items-container::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* =============================================================================
 * NEW STYLES - Upsell Items, Expandable, Icons, Checkmark Centering
 * ============================================================================= */

/* Upsell category items - visual separation */
/* .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.category-upsell:hover {
    background: linear-gradient(135deg, rgba(212, 232, 246, 0.06) 0%, rgba(111, 159, 244, 0.08) 100%);
}

body.dark-theme .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.category-upsell:hover {
    background: #61697b
} */

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.category-upsell {
    /* background: linear-gradient(135deg, rgb(2 43 114 / 15%) 0%, rgb(212 238 255 / 13%) 100%); */
    border-left: 4px solid #3498db;
}

/* Priority badge */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .badge-priority {
    display: inline-block;
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 8px;
    vertical-align: middle;
}

/* Expandable items styling */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.expandable .item-title-wrapper {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    user-select: none;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.expandable .item-title-wrapper:hover {
    opacity: 0.8;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .expand-indicator {
    color: var(--icon-color, #7f8c8d);
    font-size: 14px;
    transition: transform 0.2s;
    margin-left: auto;
}

/* Expanded content area */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-expanded-content {
    margin-top: 12px;
    padding: 16px;
    background: var(--expanded-bg, rgba(0, 0, 0, 0.03));
    border-radius: 6px;
    border: 1px solid var(--border-color, #e0e0e0);
    border-left: 3px solid #3498db;
    animation: expandDown 0.3s ease-out;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: scroll;
    display: block;
    max-height: 450px;
    transition: all 0.3s ease-in-out; /* Smooth transition for collapse */
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-expanded-content.oaf-flight-itinerary {
    padding: 0;
    margin: 0;
}

@keyframes expandDown {
    from {
        opacity: 0;
        max-height: 0;
        margin-top: 0;
        padding-top: 0;
        padding-bottom: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        max-height: 450px;
        margin-top: 12px;
        padding-top: 16px;
        padding-bottom: 16px;
        transform: translateY(0);
    }
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .expanded-info h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color, #2c3e50);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .expanded-info ul {
    margin: 0;
    padding-left: 20px;
    padding-top: 5px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .expanded-info li {
    line-height: 1.4;
    color: var(--text-color, #34495e);
}

/* Agent note styling */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .agent-note {
    margin-top: 20px;
    padding: 12px;
    background: rgb(197 185 57 / 16%);
    border-left: 3px solid #cbb10e;
    border-radius: 4px;
    line-height: 1.3;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .agent-note strong {
    display: block;
    margin-bottom: 8px;
    color: var(--key-note-title);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .agent-note ul {
    margin-top: 8px;
    margin-bottom: 0;
}

/* Ask AI button with image icon */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-ask-ai {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    background: transparent;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    box-shadow: none;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-ask-ai:hover {
    transform: translateY(-3px);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .ask-ai-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .ask-ai-icon:hover {
    transform: scale(1.3) translate3d(0, 0, 0);
    transition: transform 0.2s;
}

body.dark-theme .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .ask-ai-icon:hover {
    filter: none; /* Defaults to yellow icon */
}

body.dark-theme .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .ask-ai-icon {
    filter: brightness(0) invert(1); /* Makes icon white */
}

/* Center checkmark button vertically */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    justify-content: space-between;
    align-items: center; /* KEY FIX: Centers items vertically */
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .category-upsell .item-header {
    margin-top: 5px;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .item-title-group {
    display: flex;
    align-items: center; /* KEY FIX: Centers checkmark and title */
    gap: 12px;
    flex: 1;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .btn-check {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--icon-color, #bdc3c7);
    transition: all 0.2s;
    padding: 0;
    display: flex; /* Makes icon perfectly centered */
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0; /* Prevents button from shrinking */
}

.workflow-widget-container #oafGoBackBtn {
    display: none;
}

/* Dark theme adjustments */
/* [data-theme="dark"] .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.category-upsell {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.08) 0%, rgba(155, 89, 182, 0.08) 100%);
} */


[data-theme="dark"] .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .agent-note {
    background: rgba(52, 152, 219, 0.15);
}

/* =====================================================
   Upsell Purchase Confirmation Modal
   ===================================================== */

.oaf-upsell-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease;
}

.oaf-upsell-modal {
    background: var(--oaf-widget-card-bg, #fff);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.oaf-upsell-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.oaf-upsell-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.oaf-upsell-modal-body {
    padding: 30px 24px;
}

.oaf-upsell-modal-body p {
    margin: 0;
    font-size: 16px;
    color: var(--text-color, #2c3e50);
    line-height: 1.5;
}

.oaf-upsell-modal-body strong {
    color: #667eea;
    font-weight: 600;
}

.oaf-upsell-modal-footer {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.btn-upsell-yes,
.btn-upsell-no {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-upsell-yes {
    background: #27ae60;
    color: white;
}

.btn-upsell-yes:hover {
    background: #229954;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(39, 174, 96, 0.3);
}

.btn-upsell-no {
    background: #95a5a6;
    color: white;
}

.btn-upsell-no:hover {
    background: #7f8c8d;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.3);
}

/* =====================================================
   Auto-Notify Toggle in Footer
   ===================================================== */

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .auto-notify-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 4px 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .auto-notify-toggle:not(.disabled):hover {
    background: var(--expanded-item-bg, #e9ecef);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .auto-notify-toggle.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .auto-notify-toggle span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color, #2c3e50);
}

/* Toggle Switch Styles */
.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #ccc;
    border-radius: 12px;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .toggle-switch.active {
    background: #2ecc71;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .toggle-switch.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

body.dark-theme .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .toggle-switch {
    background: #555;
}

body.dark-theme .workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .toggle-switch.active {
    background: #27ae60;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .toggle-switch.active .toggle-slider {
    transform: translateX(20px);
}

.oaf-chat-lock-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff8e6;
    border: 1px solid rgba(236, 187, 85, 0.9);
    color: #8a5a00;
    border-radius: 8px;
    padding: 10px 50px;
    margin-bottom: 10px;
    font-size: 14px;
    position: relative;
    top: 50px;
    margin: auto;
}

.oaf-chat-lock-banner i {
    color: #d48806;
}

body.dark-theme .oaf-chat-lock-banner {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    color: #f6d7a6;
}

body.dark-theme .oaf-chat-lock-banner i {
    color: #ffcf70;
}

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

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


/* =====================================================
   Decline Reason Buttons
   ===================================================== */

.oaf-decline-reason-btn {
    padding: 12px 20px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.oaf-decline-reason-btn:hover {
    background: #e9ecef;
    border-color: #6c757d;
    color: #212529;
    transform: translateX(5px);
}

.oaf-decline-reason-btn:active {
    transform: translateX(5px) scale(0.98);
}
