/* ── Shell header ──
   The prototype's top bar is a solid purple gradient with white text
   (not the plain white bar described in the handoff's prose), so the
   colours below follow the rendered .dc.html prototype, per the
   handoff's own fidelity rule ("match the colours ... shown in the
   prototype"). */
.iafwzcai-shell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    /* Deeper purple than the buttons' gradient so the white text and icons stand out (about 7:1 contrast). */
    background: linear-gradient(90deg, #5a3fd8 0%, #4a2fc4 50%, #3b23a6 100%);
    box-shadow: 0 6px 18px -10px rgba(59, 35, 166, 0.75);
    flex-wrap: wrap;
}

.iafwzcai-shell-tabs {
    display: flex;
    align-items: stretch;
    height: 100%;
    gap: 28px;
    padding-left: 20px;
    flex-wrap: wrap;
}

.iafwzcai-tab {
    position: relative;
    display: flex;
    align-items: center;
    height: 48px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.86);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.iafwzcai-tab {
    gap: 8px;
    /* Underline starts at the icon; a little extra on the right so it doesn't stop short of the last letter. */
    padding-right: 6px;
}

/* Plugin logo at the far left of the top bar, before the tabs. */
.iafwzcai-shell-tabs { align-items: center; gap: 28px; }
.iafwzcai-shell-tabs .iafwzcai-tab { align-self: stretch; }
.iafwzcai-shell-logo {
    /* White rounded tile (same treatment as the Zoho logo tile on the right):
       the logo is dark line-art on a transparent background, so it needs a
       light backing to stay legible on the purple bar. */
    box-sizing: border-box;
    width: 34px;
    height: 34px;
    padding: 5px;
    margin-right: 14px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 10px -4px rgba(30, 20, 90, .45);
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

/* Thin vertical divider between the logo and the first tab (centred in the 42px logo→tab space). */
.iafwzcai-shell-tabs a.iafwzcai-tab:first-of-type::before {
    content: "";
    position: absolute;
    left: -21px;
    top: 13px;
    bottom: 13px;
    width: 1px;
    background: rgba(255, 255, 255, 0.35);
}

.iafwzcai-tab-icon {
    flex-shrink: 0;
}

.iafwzcai-tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: transparent;
}

.iafwzcai-tab:hover {
    color: #fff;
}

.iafwzcai-tab-active {
    color: #fff;
}

.iafwzcai-tab-active::after {
    background: #fff;
}

/* WordPress draws a blue box-shadow focus ring on every clicked link; on the header tabs it
   showed as an outer border after a click. A mouse click gets no ring; keyboard focus keeps
   a visible (white) one. */
.iafwzcai-shell-tabs a.iafwzcai-tab:focus,
.iafwzcai-shell-tabs a.iafwzcai-tab:active,
.iafwzcai-shell-tabs a.iafwzcai-tab:visited {
    box-shadow: none;
    outline: none;
    color: rgba(255, 255, 255, 0.86);
}

/* WP's `a:hover/a:focus/a:active { color: blue }` out-ranks a lone class, so the tab
   turned blue on click. Re-assert white on every state (higher specificity). */
.iafwzcai-shell-tabs a.iafwzcai-tab:hover,
.iafwzcai-shell-tabs a.iafwzcai-tab:hover:focus,
.iafwzcai-shell-tabs a.iafwzcai-tab:active:focus,
.iafwzcai-shell-tabs a.iafwzcai-tab.iafwzcai-tab-active,
.iafwzcai-shell-tabs a.iafwzcai-tab.iafwzcai-tab-active:focus,
.iafwzcai-shell-tabs a.iafwzcai-tab.iafwzcai-tab-active:active,
.iafwzcai-shell-tabs a.iafwzcai-tab.iafwzcai-tab-active:visited {
    color: #fff;
    box-shadow: none;
    outline: none;
}

/* Keyboard focus only: a clicked tab shows no ring. */
.iafwzcai-shell-tabs a.iafwzcai-tab:focus-visible:not(:hover):not(:active) {
    color: #fff;
    outline: 2px solid #fff;
    outline-offset: -2px;
}

.iafwzcai-shell-header-right {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 20px;
}

.iafwzcai-shell-divider {
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.28);
    flex-shrink: 0;
}

.iafwzcai-shell-pro-tag {
    display: inline-flex;
    align-items: center;
    height: 26px;
    padding: 0 10px;
    border-radius: var(--iafwzcai-radius-pill, 999px);
    background: #fff1e6;
    color: #e8650a;
    font-size: 11.5px;
    font-weight: 800;
    flex-shrink: 0;
}

.iafwzcai-shell-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.iafwzcai-shell-brand-logo {
    width: 28px;
    height: 28px;
    border-radius: var(--iafwzcai-radius-sm, 8px);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.iafwzcai-shell-brand-logo img {
    width: 18px;
    height: auto;
    display: block;
}

.iafwzcai-shell-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.iafwzcai-shell-brand-name {
    font-size: 13.5px;
    font-weight: 800;
    color: #fff;
}

.iafwzcai-shell-brand-by {
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.75);
}

/* ── Shell body / tab content ── */
.iafwzcai-shell-body {
    background-color: var(--iafwzcai-page-bg, #f6f7fa);
    padding: 20px;
}

/* "Renew your license" link inside the license notices */
.iafwzcai-notice-link {
    text-decoration: underline;
    font-weight: bold;
}

.iafwzcai-tab-content {
    display: none; /* home.js shows the active one */
    height: auto;
    box-sizing: border-box;
}

/* Adjustments for better responsiveness */
@media (max-width: 768px) {
    .iafwzcai-tab {
        padding: 0 12px;
        font-size: 13px;
    }

    .iafwzcai-shell-body {
        padding: 14px;
    }
}

.iafwzcai-span-header
{
    font-size: 20px;
    font-weight: 500;
}

/* ── Help dropdown ── */
.iafwzcai-help-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.iafwzcai-help-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35);
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    box-sizing: border-box;
    transition: background 0.2s;
}

.iafwzcai-help-btn:hover,
.iafwzcai-help-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.22);
}

.iafwzcai-help-btn-icon {
    display: block;
    flex-shrink: 0;
    color: #fff;
}

.iafwzcai-help-btn-label {
    color: #fff;
    white-space: nowrap;
    line-height: 1;
}

.iafwzcai-help-copy-btn {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: #a7aaad;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.iafwzcai-help-copy-btn:hover {
    color: var(--iafwzcai-primary-grad-end, #6a4cf0);
    border-color: var(--iafwzcai-primary-grad-end, #6a4cf0);
    background: #f3f0ff;
}

.iafwzcai-help-copy-btn.iafwzcai-copied {
    color: #00a32a;
    border-color: #00a32a;
    background: #f0faf0;
}

.iafwzcai-help-copy-btn svg {
    display: block;
    flex-shrink: 0;
}

.iafwzcai-help-copy-btn .iafwzcai-check-icon {
    display: none;
}

.iafwzcai-help-copy-btn.iafwzcai-copied .iafwzcai-copy-icon {
    display: none;
}

.iafwzcai-help-copy-btn.iafwzcai-copied .iafwzcai-check-icon {
    display: block;
}

.iafwzcai-help-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 290px;
    padding: 8px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid var(--iafwzcai-border-100, #eceef5);
    border-radius: 14px;
    box-shadow: var(--iafwzcai-shadow-menu, 0 18px 40px -12px rgba(30, 30, 70, .28));
    z-index: 99999;
}

.iafwzcai-help-dropdown[hidden] {
    display: none;
}

.iafwzcai-help-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    margin: 0 0 2px;
    border-radius: 10px;
    text-decoration: none;
    color: #1d2036;
    transition: background 0.15s;
}

.iafwzcai-help-item:hover,
.iafwzcai-help-item:focus {
    background: #f3f0ff;
    color: #1d2036;
    text-decoration: none;
    box-shadow: none;
    outline: none;
}

/* Icon sits in a soft purple tile, matching the rest of the plugin UI. */
.iafwzcai-help-item .iafwzcai-help-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: #ede9fe;
    color: var(--iafwzcai-primary-grad-end, #6a4cf0);
    font-size: 18px;
    line-height: 1;
    transition: background 0.15s, color 0.15s;
}

.iafwzcai-help-item:hover .iafwzcai-help-item-icon {
    background: linear-gradient(135deg, var(--iafwzcai-primary-grad-start, #8b6cf8), var(--iafwzcai-primary-grad-end, #6a4cf0));
    color: #fff;
}

.iafwzcai-help-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.iafwzcai-help-item-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.3;
}

.iafwzcai-help-item-sub {
    font-size: 11.5px;
    color: #7a7f99;
    line-height: 1.3;
    margin-top: 2px;
}

.iafwzcai-help-version {
    margin-top: 4px;
    padding: 8px 10px 4px;
    text-align: center;
    font-size: 11px;
    color: #9aa0b8;
    border-top: 1px solid var(--iafwzcai-border-100, #eceef5);
}

/* ── View loading skeleton (router) ──
   Shown only if a view takes longer than ~150ms to arrive; the previous view is
   hidden meanwhile and replaced as soon as the new one is ready. */
.iafwzcai-view-loading > :not(.iafwzcai-skeleton) {
    display: none !important;
}

.iafwzcai-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 360px;
}

.iafwzcai-load-spinner {
    width: 38px;
    height: 38px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 3px solid #e3dcff;
    border-top-color: var(--iafwzcai-primary-grad-end, #6a4cf0);
    animation: iafwzcai-spin 0.8s linear infinite;
}

.iafwzcai-load-label {
    font-size: 13px;
    font-weight: 600;
    color: #7a7f99;
}

@keyframes iafwzcai-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .iafwzcai-load-spinner {
        animation-duration: 2.4s;
    }
}

/* ── Narrow screens ──
   The header holds the logo, up to four tabs, Help and the brand. It does not fit below about 1100px, so
   first the brand goes, then (phones) the tab row scrolls sideways instead of wrapping out of the fixed
   header height, and Help shrinks to its icon. */
.iafwzcai-help-dropdown {
    max-width: calc(100vw - 32px);
}

@media (max-width: 1100px) {
    .iafwzcai-shell-divider,
    .iafwzcai-shell-brand {
        display: none;
    }

    .iafwzcai-shell-tabs { gap: 20px; }

    .iafwzcai-shell-tabs a.iafwzcai-tab:first-of-type::before {
        left: -17px;
    }

    .iafwzcai-shell-header-right {
        padding-right: 12px;
    }
}

@media (max-width: 782px) {
    .iafwzcai-shell-header {
        flex-wrap: nowrap;
    }

    .iafwzcai-shell-tabs {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 14px;
        padding-left: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .iafwzcai-shell-tabs::-webkit-scrollbar {
        display: none;
    }

    .iafwzcai-shell-tabs .iafwzcai-tab {
        flex: 0 0 auto;
        padding: 0 2px;
    }

    .iafwzcai-shell-logo {
        margin-right: 0;
    }

    .iafwzcai-shell-tabs a.iafwzcai-tab:first-of-type::before {
        display: none;
    }

    .iafwzcai-shell-header-right {
        flex: 0 0 auto;
        padding-right: 10px;
    }
}

@media (max-width: 480px) {
    .iafwzcai-tab-icon,
    .iafwzcai-help-btn-label {
        display: none;
    }

    .iafwzcai-help-btn {
        width: 30px;
        padding: 0;
        justify-content: center;
    }

    .iafwzcai-shell-tabs {
        gap: 12px;
    }
}
