/* OAF Checklist — Expandable Items, Modals, and Interaction Styles */

/* =============================================================================
 * Expandable Items, Agent Notes, Ask-AI Button, Checkmark Centering
 * ============================================================================= */

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .checklist-item.category-upsell {
    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;
}

.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;
}

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

/* 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;
}

.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;
    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;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

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

[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);
}

/* =====================================================
   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);
}

/* =====================================================
   TCS Version Inline Skeleton / Pending State
   ===================================================== */

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-tcs-inline-skeleton {
    display: inline-block;
    width: 76px;
    height: 14px;
    border-radius: 6px;
    background: linear-gradient(90deg, #d9dee5 25%, #f1f4f8 50%, #d9dee5 75%);
    background-size: 200% 100%;
    animation: oaf-tcs-shimmer 1.2s ease-in-out infinite;
    vertical-align: text-bottom;
}

.workflow-widget-container:is(.workflow-oaf_script, .workflow-oaf_assistant) .oaf-tcs-reason-pending {
    color: #7b8794;
    font-style: italic;
}

@keyframes oaf-tcs-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =============================================================================
 * 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);
}

.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);
}

/* =============================================================================
 * Chat Lock Banner
 * ============================================================================= */

.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;
    width: 55rem;
}

.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;
}

/* Shared modal animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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