/* 
 * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
 * See LICENSE in the project root for license information.
 */

/* ═══════════════════════════════════════════════════════════
   BASE LAYOUT (original Office add-in styles preserved)
   Vendor prefixes required for Edge WebView in Office Win32
   ═══════════════════════════════════════════════════════════ */

html, body { width: 100%; height: 100%; margin: 0; padding: 0; }
ul { margin: 0; padding: 0; }
b { font-weight: bold; }

.ms-welcome__header {
    position: relative;
    padding: 20px;
    padding-bottom: 30px;
    padding-top: 100px;
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-align-items: center;
    align-items: center;
}

.ms-welcome__main {
    display: -webkit-flex;
    display: flex;
    -webkit-flex-direction: column;
    flex-direction: column;
    -webkit-flex-wrap: nowrap;
    flex-wrap: nowrap;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex: 1 0 0;
    flex: 1 0 0;
    padding: 10px 20px;
}

.ms-welcome__main > h2 { width: 100%; text-align: center; }
.ms-welcome__features { list-style-type: none; margin-top: 20px; }
.ms-welcome__features.ms-List .ms-ListItem { padding-bottom: 20px; display: flex; }
.ms-welcome__features.ms-List .ms-ListItem > .ms-Icon { margin-right: 10px; }
.ms-welcome__action.ms-Button--hero { margin-top: 30px; }

.ms-Button.ms-Button--hero .ms-Button-label { color: #0078d7; }
.ms-Button.ms-Button--hero:hover .ms-Button-label,
.ms-Button.ms-Button--hero:focus .ms-Button-label { color: #005a9e; cursor: pointer; }

/* ═══════════════════════════════════════════════════════════
   STATUS BADGES — appear next to each check button
   ═══════════════════════════════════════════════════════════ */

.tpl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.25);
    font-family: 'Segoe UI', sans-serif;
}
.tpl-btn:hover {
    background: linear-gradient(135deg, #106ebe 0%, #004578 100%);
    box-shadow: 0 4px 14px rgba(0, 120, 212, 0.35);
    transform: translateY(-1px);
}
.tpl-btn:active { transform: translateY(0); }

/* ═══════════════════════════════════════════════════════════
   CHECK SEARCH BAR — filters the check list in real time
   ═══════════════════════════════════════════════════════════ */

.checks-search-wrap {
    position: relative;
    width: 100%;
    margin-top: 14px;
    margin-bottom: 4px;
}
.checks-search-icon {
    position: absolute;
    top: 50%;
    left: 12px;
    transform: translateY(-50%);
    color: #8a8a8a;
    pointer-events: none;
    transition: color 0.2s ease;
}
.checks-search-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 34px 9px 34px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    background: #fafafa;
    font-size: 12.5px;
    font-family: 'Segoe UI', sans-serif;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.checks-search-input::placeholder { color: #a8a8a8; }
.checks-search-input:hover { border-color: #c0c0c0; background: #fff; }
.checks-search-input:focus {
    border-color: #0078d4;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.12);
}
.checks-search-wrap:focus-within .checks-search-icon { color: #0078d4; }

.checks-search-clear {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #e8e8e8;
    color: #555;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, color 0.15s ease;
}
.checks-search-clear:hover { background: #d0d0d0; color: #000; }
.checks-search-wrap.has-text .checks-search-clear { display: inline-flex; }

.checks-search-empty {
    width: 100%;
    text-align: center;
    color: #888;
    font-size: 12px;
    margin: 12px 0 4px 0;
    font-style: italic;
}

/* Hidden cards (filtered out by search) */
.ck-card.search-hidden { display: none !important; }

.select-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 4px;
    margin-top: 10px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 6px;
}
.select-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 12.5px;
    font-weight: 600;
    color: #555;
}
.select-bar-left:hover span { color: #0078d4; }

.run-sel-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 120, 212, 0.2);
}
.run-sel-btn:hover {
    box-shadow: 0 3px 10px rgba(0, 120, 212, 0.3);
    transform: translateY(-1px);
}
.run-sel-btn:disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.checks-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.ck-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-left: 3px solid #0078d4;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.ck-card:hover {
    background: #f0f6ff;
    border-left-color: #005a9e;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    transform: translateX(3px);
}
.ck-card:active {
    transform: translateX(1px);
    background: #e0ecfa;
}
.ck-card.check-running {
    border-left-color: #ffb900 !important;
    animation: cardPulse 1.2s ease-in-out infinite;
}
@keyframes cardPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 185, 0, 0.2); }
    50%      { box-shadow: 0 0 0 6px rgba(255, 185, 0, 0.08); }
}

.ck-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0078d4, #005a9e);
    color: #fff;
    font-size: 11.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ck-label {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.3;
}

.check-cb {
    width: 17px;
    height: 17px;
    min-width: 17px;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: #0078d4;
    margin: 0;
}

.check-status {
    flex-shrink: 0;
    display: inline-block;
    font-size: 13px;
    min-width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}
.check-status.running { animation: badgePulse 1s ease-in-out infinite; }
.check-status.done    { color: #107c10; }
.check-status.error   { color: #d13438; }

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.3; }
}

/* ═══════════════════════════════════════════════════════════
   THIN PER-CHECK PROGRESS BAR
   Sits at the bottom edge of each card. Hidden by default.
   Becomes visible only while the card has .check-running.
   JS drives both the width and the colour (HSL hue eased from
   yellow → green) for a smooth, attractive animation.
   ═══════════════════════════════════════════════════════════ */

.ck-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.06);
    opacity: 0;
    transform: translateZ(0); /* GPU layer; smoother fade */
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.ck-card.check-running .ck-progress { opacity: 1; }

.ck-progress-fill {
    height: 100%;
    width: 0%;
    background: hsl(45, 85%, 55%); /* initial yellow; JS drives the rest */
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.55);
    transition: width 0.25s ease-out, background-color 0.25s ease-out, box-shadow 0.25s ease-out;
}

/* Subtle shimmer that rides along the leading edge while progress < 100% */
.ck-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: progressShimmer 1.4s linear infinite;
}
.ck-card.check-running .ck-progress-fill { position: relative; overflow: hidden; }
@keyframes progressShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(120%); }
}

.summary-btn {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1.5px solid #107c10;
    border-radius: 8px;
    background: #fff;
    color: #107c10;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.2s ease;
}
.summary-btn:hover {
    background: #107c10;
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   HELP ICON (top-right of header)
   ═══════════════════════════════════════════════════════════ */

.help-icon-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid #0078d4;
    color: #0078d4;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.help-icon-btn:hover {
    background: #0078d4;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.35);
    transform: scale(1.08);
}

/* ═══════════════════════════════════════════════════════════
   OVERLAY PANELS (shared by Help & Summary)
   ═══════════════════════════════════════════════════════════ */

.overlay-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #f5f7fa;
    z-index: 10000;
    overflow-y: auto;
    animation: overlayIn 0.25s ease-out;
}

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

.overlay-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    background: linear-gradient(135deg, #0078d4 0%, #005a9e 100%);
    color: #ffffff;
    z-index: 10001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.overlay-header-green {
    background: linear-gradient(135deg, #107c10 0%, #0b5e0b 100%);
}

.overlay-title { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: 0.2px; }

.overlay-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}
.overlay-close:hover { background: rgba(255, 255, 255, 0.3); }

.overlay-body { padding: 14px; }

/* ═══════════════════════════════════════════════════════════
   QC SUMMARY PANEL content
   ═══════════════════════════════════════════════════════════ */

.summary-stats {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.summary-stat {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.summary-stat-num {
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-run     { color: #0078d4; }
.stat-pass    { color: #107c10; }
.stat-pending { color: #888; }

.summary-stat-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.summary-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 4px;
    background: #fff;
    border-radius: 6px;
    border-left: 3px solid #ddd;
}

.summary-row.done    { border-left-color: #107c10; }
.summary-row.error   { border-left-color: #d13438; }
.summary-row.pending { border-left-color: #ddd; }

.summary-row-num {
    width: 22px;
    font-weight: 700;
    font-size: 12px;
    color: #0078d4;
}

.summary-row-label { flex: 1; font-size: 12.5px; color: #333; }
.summary-row-status { font-size: 11px; font-weight: 600; }
.summary-row-time { font-size: 11px; color: #999; min-width: 48px; text-align: right; }

/* ═══════════════════════════════════════════════════════════
   HELP PANEL: SEARCH BAR
   ═══════════════════════════════════════════════════════════ */

.help-search-wrap {
    position: sticky;
    top: 52px;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.help-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 13px;
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    background: transparent;
}
.help-search-input::placeholder { color: #bbb; }

/* ═══════════════════════════════════════════════════════════
   HELP PANEL: ACCORDION CARDS
   ═══════════════════════════════════════════════════════════ */

.help-content {
    padding: 12px 14px 30px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.help-card {
    background: #ffffff;
    border-radius: 8px;
    border-left: 4px solid #0078d4;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}
.help-card:hover { box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1); }
.help-card.hidden { display: none; }

.help-card-template { border-left-color: #107c10; }
.help-card-tip { border-left-color: #ffb900; }

/* Header (clickable) */
.help-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    cursor: pointer;
    user-select: none;
}

.help-card-header:hover { background: #f8f9fb; }

.help-card-num {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0078d4, #005a9e);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-card-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-card-title {
    flex: 1;
    font-size: 13.5px;
    font-weight: 600;
    color: #1a1a1a;
}

.help-card-arrow {
    flex-shrink: 0;
    font-size: 10px;
    color: #999;
    transition: transform 0.25s ease;
}
.help-card-arrow.open { transform: rotate(180deg); }

/* Detail (collapsed by default) */
.help-card-detail {
    max-height: 0;
    overflow: hidden;
    padding: 0 14px;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.help-card-detail.open {
    max-height: 400px;
    padding: 0 14px 14px 14px;
}

.help-card-detail p {
    margin: 0 0 8px 0;
    font-size: 12.5px;
    line-height: 1.55;
    color: #444;
}

/* Tags */
.help-tag-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }

.help-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 10px;
    background: #e8f0fe;
    color: #0078d4;
    letter-spacing: 0.2px;
}

/* Before / After box */
.help-ba {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-top: 4px;
    background: #f8f9fb;
    border-radius: 6px;
    border: 1px dashed #d0d0d0;
    font-size: 11.5px;
    color: #555;
}

.ba-before, .ba-after { flex: 1; line-height: 1.4; }
.ba-before strong { color: #d13438; }
.ba-after strong { color: #107c10; }
.ba-arrow { flex-shrink: 0; font-size: 16px; color: #0078d4; font-weight: 700; }

/* Tips list */
.help-tips-list {
    margin: 0;
    padding-left: 18px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #444;
}
.help-tips-list li { margin-bottom: 2px; }
.help-tips-list strong { color: #1a1a1a; }

/* ═══════════════════════════════════════════════════════════
   QC SUMMARY: ACCORDION CARDS + GO TO NAVIGATION
   Append this entire block to the END of your taskpane.css
   ═══════════════════════════════════════════════════════════ */

.sr-card {
    background: #fff;
    border-radius: 8px;
    border-left: 3px solid #0078d4;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}
.sr-card.done    { border-left-color: #107c10; }
.sr-card.error   { border-left-color: #d13438; }
.sr-card.pending { border-left-color: #ccc; opacity: 0.7; }

/* Header row (clickable when has details) */
.sr-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 12.5px;
}
.sr-clickable { cursor: pointer; }
.sr-clickable:hover { background: #f5f8fc; }

.sr-num {
    flex-shrink: 0;
    width: 22px;
    font-weight: 700;
    font-size: 12px;
    color: #0078d4;
    text-align: center;
}
.sr-name { flex: 1; font-weight: 500; color: #1a1a1a; }
.sr-right { display: flex; align-items: center; gap: 6px; }
.sr-icon { font-size: 13px; }
.sr-time { font-size: 10.5px; color: #999; }
.sr-chev {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s ease;
}
.sr-chev.up { transform: rotate(180deg); }

/* Expandable detail body */
.sr-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.sr-body.open {
    max-height: 2000px;
    overflow-y: auto;
}

.sr-body-title {
    padding: 8px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #333;
    background: #f8f9fb;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* Stat rows (count + note, no navigation) */
.sr-body-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.sr-body-row:last-child { border-bottom: none; }

.sr-body-label { color: #555; flex: 1; }
.sr-body-vals { display: flex; align-items: center; gap: 6px; }

.sr-body-count {
    display: inline-block;
    background: #0078d4;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sr-body-note {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* Navigation rows (clickable Go To) */
.sr-nav-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0f6ff;
    border-bottom: 1px solid #dde8f8;
    cursor: pointer;
    transition: background 0.15s ease;
}
.sr-nav-row:last-child { border-bottom: none; }
.sr-nav-row:hover      { background: #d8eaff; }
.sr-nav-row.sr-nav-active { background: #b3d4ff; }

.sr-nav-arrow {
    flex-shrink: 0;
    color: #0078d4;
    font-size: 12px;
    font-weight: 700;
}

.sr-nav-text {
    flex: 1;
    font-size: 11.5px;
    color: #1a1a1a;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sr-nav-note {
    flex-shrink: 0;
    font-size: 10.5px;
    color: #0078d4;
    font-weight: 600;
    background: #deeafc;
    border-radius: 8px;
    padding: 1px 7px;
}

.sr-nav-btn {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #0078d4;
    border-radius: 6px;
    padding: 2px 7px;
    transition: background 0.15s ease;
}
.sr-nav-row:hover .sr-nav-btn { background: #005a9e; }