/**
 * WIZ v2: Sales Rep Profile Widget — Card Wrapper Styles
 */

/* ── Outer Widget Wrapper ─────────────────────────────────────────────── */
.wiz-srp {
    box-sizing: border-box;
    font-family: var(--wiz-font-family, inherit);
    position: relative;
    width: 100%;
    overflow: visible;
}

.wiz-srp *,
.wiz-srp *::before,
.wiz-srp *::after {
    box-sizing: inherit;
}

/* Guarantee [hidden] always wins */
.wiz-srp [hidden] {
    display: none !important;
}

/* ── State base wrappers ──────────────────────────────────────────────── */
.wiz-srp__state,
.wiz-srp__state--loading {
    width: 100%;
    position: relative;
}

/* Pagination fetch overlay — keeps found/slider visible underneath */
.wiz-srp--paginating .wiz-srp__state--loading {
    position: absolute;
    inset: 0;
    z-index: 20;
    background-color: rgba(255, 255, 255, 0.88);
}

/* ── Shimmer Animation ────────────────────────────────────────────────── */
@keyframes wiz-srp-shimmer {
    0%   { background-position: -400px 0; }
    100% { background-position: 400px 0; }
}

.wiz-srp__skeleton-line,
.wiz-srp__skeleton-avatar,
.wiz-srp__skeleton-divider {
    background: linear-gradient(90deg, #e0e0e0 25%, #ebebeb 50%, #e0e0e0 75%);
    background-size: 800px 100%;
    animation: wiz-srp-shimmer 1.4s infinite linear;
    border-radius: 3px;
}

.wiz-srp__skeleton-line--long   { height: 12px; width: 100%; }
.wiz-srp__skeleton-line--medium { height: 12px; width: 65%; margin: 0 auto; }
.wiz-srp__skeleton-line--name   { height: 14px; width: 55%; margin: 0 auto 4px; }
.wiz-srp__skeleton-line--email  { height: 11px; width: 70%; margin: 0 auto; }
.wiz-srp__skeleton-line--phone  { height: 11px; width: 50%; margin: 0 auto; }

.wiz-srp__skeleton-divider {
    width: 100%;
    height: 1px;
    border-radius: 0;
    margin: 12px 0;
}

.wiz-srp__skeleton-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-bottom: 16px;
}

/* ═══════════════════════════════════════════════════════════════════════
   STATE 1 — INITIAL (face carousel + heading + 2 skeleton lines)
   ═══════════════════════════════════════════════════════════════════════ */
.wiz-srp__state--initial {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 0 auto;
    background-color: #f5f5f5;
    border: none;
    border-radius: 0;
    padding: 24px 16px 32px;
    box-sizing: border-box;
    overflow: hidden;
}

.wiz-srp__initial-img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 24px;
}

.wiz-srp__initial-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 10px;
    padding: 0 16px;
}

.wiz-srp__placeholder-heading {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: #888;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0;
    text-align: center;
}

.wiz-srp__initial-placeholder .wiz-srp__skeleton-line--1 {
    height: 12px;
    width: 180px;
    max-width: 70%;
    border-radius: 3px;
}

.wiz-srp__initial-placeholder .wiz-srp__skeleton-line--2 {
    height: 10px;
    width: 120px;
    max-width: 45%;
    border-radius: 3px;
}

/* Disable shimmer on initial skeleton lines for a static placeholder look */
.wiz-srp__state--initial .wiz-srp__skeleton-line {
    animation: none;
    background: #e0e0e0;
}

.wiz-srp__placeholder-icon {
    display: none;
}

.wiz-srp__placeholder-subheading {
    display: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   LOADING STATE
   ═══════════════════════════════════════════════════════════════════════ */
.wiz-srp__state--loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    /* max-width: 480px; */
    margin: 0 auto;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 32px;
    box-sizing: border-box;
}

/* Skeleton card — initial/loading states only */
.wiz-srp__card--skeleton {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════════════════
   FOUND STATE — Rep surface (single rep + slider slides)
   ═══════════════════════════════════════════════════════════════════════ */
.wiz-srp {
    width: 100%;
    max-width: 100%;
    /* Don't stretch with sibling columns when card height settles — reduces page flicker */
    align-self: flex-start;
    box-sizing: border-box;
}

.wiz-srp__state--found,
.wiz-srp__slide {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 32px;
    box-sizing: border-box;
    height: auto; /* content-sized — JS equalizes to tallest card */
    /* Cached by JS across virtualization remounts — prevents height jerks */
    min-height: var(--wiz-srp-slide-min-height, auto);
}

.wiz-srp__state--found {
    overflow: visible;
}

.wiz-srp__results-count {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
    font-weight: 600;
    margin-bottom: 16px;
    text-align: left;
}

/* Slider viewport — clips track; adjacent slides peek via center-mode offset */
.wiz-srp__slider-viewport {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    --wiz-srp-peek-width: 60px;
    --wiz-srp-side-opacity: 0.6;
    /* Locked to tallest card so virtual remounts don't collapse the viewport */
    min-height: var(--wiz-srp-slide-min-height, 0);
}

/* Track — flex row that translates */
.wiz-srp__track {
    display: flex;
    align-items: stretch;
    will-change: transform;
    transition: transform 0.4s ease;
}

.wiz-srp__slide {
    flex-shrink: 0;
}

/* Center-mode: adjacent slides same size as active, translucent only */
.wiz-srp--center-mode .wiz-srp__slide {
    opacity: var(--wiz-srp-side-opacity, 0.6);
    transition: opacity 0.4s ease;
    z-index: 1;
}

.wiz-srp--center-mode .wiz-srp__slide--active {
    opacity: 1;
    z-index: 3;
}

.wiz-srp--center-mode .wiz-srp__slide--adjacent {
    opacity: var(--wiz-srp-side-opacity, 0.6);
    z-index: 2;
}

.wiz-srp--center-mode .wiz-srp__slide--distant {
    opacity: calc(var(--wiz-srp-side-opacity, 0.6) * 0.5);
    z-index: 1;
}

.wiz-srp__profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Avatar */
.wiz-srp__avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--srp-avatar-mb, 16px) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ddd;
    flex-shrink: 0;
}

.wiz-srp__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wiz-srp__avatar-initials {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
    line-height: 1;
}

/* Name */
.wiz-srp__name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--srp-name-mb, 6px) !important;
    line-height: 1.25;
}

/* Contact Block */
.wiz-srp__contact {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--srp-contact-mb, 16px) !important;
}

.wiz-srp__email,
.wiz-srp__phone {
    font-size: 0.875rem;
    color: #444;
    line-height: 1.5;
    text-decoration: none;
    display: block;
}

.wiz-srp__email {
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--srp-email-mb, 4px) !important;
}

.wiz-srp__phone {
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--srp-phone-mb, 0px) !important;
}

.wiz-srp__email:hover {
    text-decoration: underline;
}

/* Divider line */
.wiz-srp__divider {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
    width: 100%;
}

/* Bio — ~4.5 lines; half of last line peeks to hint scroll */
.wiz-srp__bio-section {
    width: 100%;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wiz-srp__bio {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: #555;
    text-align: center;
    margin: 0;
    width: 100%;
    max-height: calc(1.65em * 4.5);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* Slider navigation arrows */
.wiz-srp__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.18s ease, opacity 0.18s ease;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.wiz-srp__arrow:hover:not(:disabled) {
    background: #f5f5f5;
}

.wiz-srp__arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Float absolute arrows outside slider wrapper bounds */
.wiz-srp__arrow--prev { left: -18px; }
.wiz-srp__arrow--next { right: -18px; }

.wiz-srp__arrow svg {
    display: block;
    flex-shrink: 0;
    stroke: #000;
}

/* Slider pagination dots — widget-level, outside state containers */
.wiz-srp__pagination,
.wiz-srp__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.wiz-srp__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    flex-shrink: 0;
}

.wiz-srp__dot--active {
    background: #000;
    transform: scale(1.25);
}

/* Slider progress bar */
.wiz-srp__progress-bar {
    width: 100%;
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 20px;
    overflow: hidden;
}

.wiz-srp__progress-fill {
    height: 100%;
    width: 0;
    background: #000;
    border-radius: 2px;
    transition: width 0.35s ease;
}

/* ═══════════════════════════════════════════════════════════════════════
   STATE 3 — EMPTY
   ═══════════════════════════════════════════════════════════════════════ */
.wiz-srp__state--empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    /* max-width: 480px; */
    margin: 0 auto;
    background-color: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 32px;
    box-sizing: border-box;
    text-align: center;
}

/* Icon circle — matching the design */
.wiz-srp__empty-icon-wrap {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #fde8e0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    flex-shrink: 0;
}

.wiz-srp__empty-icon-wrap svg,
.wiz-srp__empty-icon-wrap i {
    color: #d94f2a;
    stroke: #d94f2a;
}

.wiz-srp__empty-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 12px;
    line-height: 1.3;
}

.wiz-srp__empty-desc {
    font-size: 0.9375rem;
    color: #666;
    margin: 0;
    line-height: 1.6;
    /* max-width: 340px; */
}

/* ── Responsive breakpoints ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .wiz-srp__slider-viewport {
        --wiz-srp-peek-width: 32px;
    }
}

@media (max-width: 767px) {
    .wiz-srp__slider-viewport {
        --wiz-srp-peek-width: 14px;
    }

    .wiz-srp__state--initial,
    .wiz-srp__state--empty {
        padding: 28px 16px;
    }
    
    .wiz-srp__state--found,
    .wiz-srp__slide {
        padding: 20px 16px !important; /* beat Elementor desktop card padding on mobile */
    }

    .wiz-srp__state--loading {
        padding: 16px;
    }
    
    .wiz-srp__placeholder-icon {
        width: 48px;
        height: 48px;
    }
    
    .wiz-srp__skeleton-avatar {
        width: 72px;
        height: 72px;
        margin-bottom: 16px;
    }
    
    .wiz-srp__avatar {
        width: 72px;
        height: 72px;
        margin-bottom: 14px;
    }
    
    .wiz-srp__name {
        font-size: 1.125rem;
        margin-bottom: 8px;
    }

    .wiz-srp__contact {
        gap: 4px;
    }

    .wiz-srp__bio {
        font-size: 0.875rem;
    }

    .wiz-srp__divider {
        margin: 14px 0;
    }
    
    .wiz-srp__arrow {
        width: 32px;
        height: 32px;
    }

    .wiz-srp__arrow--prev { left: 4px; }
    .wiz-srp__arrow--next { right: 4px; }
}
