/* ==========================================================================
   Patient Success Stories - Frontend CSS
   Matches exact client mockups and specifications
   ========================================================================== */

/* Main Container */
.pss-widget-container {
    width: 100%;
    margin: 0 auto;
    font-family: 'Noto Sans', sans-serif;
    box-sizing: border-box;
}

.pss-widget-container * {
    box-sizing: border-box;
}

/* ==========================================================================
   TOPIC FILTER PILLS (Center aligned, pill shaped)
   ========================================================================== */
.pss-tab-filters {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 auto 36px;
    padding: 0;
}

.pss-tab-pill {
    background: #E8E0FE !important;
    color: #595594 !important;
    border: none !important;
    outline: none ;
    cursor: pointer;
    padding: 8px 16px !important;
    border-radius: 9999px !important;
    font-family: 'Noto Sans', sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 100% !important;
    letter-spacing: 0% !important;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease !important;
    user-select: none !important;
    -webkit-appearance: none !important;
}

.pss-tab-pill:hover {
    background: #E2D9FF !important;
    color: #5521EB !important;
}

/* Active Pill State */
.pss-tab-pill.is-active,
.pss-tab-pill[aria-selected="true"] {
    background: #6531FB !important;
    color: #FFFFFF !important;
    font-weight: 600 !important;
}

.pss-tab-pill.is-active:hover {
    background: #5020D0 !important;
    color: #FFFFFF !important;
}

/* ==========================================================================
   STORIES GRID & PANES
   ========================================================================== */
.pss-panes-container {
    width: 100%;
}

.pss-tab-pane {
    width: 100%;
}

.pss-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}

@media (max-width: 1024px) {
    .pss-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 640px) {
    .pss-cards-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

/* ==========================================================================
   STORY CARD (Matches exact mockup specs)
   ========================================================================== */
.pss-story-card {
    background: #F0F7FF;
    border: none;
    border-radius: 16px;
    box-shadow: 0px 8px 24px -8px #0000000D;
    padding: 28px 28px 24px 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pss-story-card:hover {
    transform: translateY(-3px);
    box-shadow: 0px 12px 28px -6px rgba(0, 0, 0, 0.08);
}

.pss-card-top-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Header Row: User Name & SVG Quote Icon */
.pss-card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.pss-card-user {
    color: #282828;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 500;
    font-size: 13px;
    line-height: 100%;
    letter-spacing: 0%;
    margin: 0;
}

.pss-quote-icon-container {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.pss-quote-icon {
    width: 34px;
    height: 26px;
    max-width: 34px;
    max-height: 26px;
    object-fit: contain;
    display: block;
}

/* Body: Italic Quote */
.pss-card-quote-row {
    margin-bottom: 22px;
    flex-grow: 1;
}

.pss-card-quote {
    color: #282828;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-style: italic;
    font-size: 16px;
    line-height: 150%;
    letter-spacing: 0%;
    margin: 0;
}

/* Bottom: Expand link */
.pss-card-footer {
    display: flex;
    align-items: center;
    padding-top: 4px;
}

.pss-expand-trigger {
    color: #6531FB;
    font-family: 'Noto Sans', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 100%;
    letter-spacing: 0%;
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.15s ease, color 0.15s ease;
    user-select: none;
}

.pss-expand-trigger:hover {
    color: #5020D0;
    opacity: 0.9;
}

/* Hidden cards for pagination */
.pss-story-card.pss-card-hidden {
    display: none !important;
}

/* ==========================================================================
   LOAD MORE BUTTON (Centered, purple, underlined)
   ========================================================================== */
.pss-load-more-wrapper {
    width: 100%;
    text-align: center;
    margin-top: 40px;
}

.pss-load-more-btn {
    background: none !important;
    border: none !important;
    outline: none !important;
    padding: 6px 12px !important;
    color: #6531FB !important;
    font-family: 'Noto Sans', sans-serif !important;
    font-weight: 400 !important;
    font-size: 16px !important;
    line-height: 100% !important;
    letter-spacing: 0% !important;
    text-decoration: underline !important;
    cursor: pointer !important;
    transition: opacity 0.15s ease , color 0.15s ease !important;
    user-select: none !important;
}

.pss-load-more-btn:hover {
    color: #5020D0 !important;
    opacity: 0.85 !important;
}

/* ==========================================================================
   TESTIMONIAL MODAL (Matches Mockup 2)
   ========================================================================== */
.custom-testimonial-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.custom-testimonial-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(145, 145, 175, 0.45);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: 1;
}

.custom-modal-card {
    position: relative;
    z-index: 2;
    background: #FFFFFF;
    border-radius: 16px;
    max-width: 580px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0px 20px 48px rgba(0, 0, 0, 0.16);
    padding: 36px 36px 28px 36px;
    display: flex;
    flex-direction: column;
    animation: pssModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@keyframes pssModalPop {
    from {
        transform: scale(0.96) translateY(8px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Modal Header: User name and circular close button */
.custom-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
}

.custom-modal-user {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #282828;
    margin: 0;
}

.custom-modal-close {
    background: #F3F4F6;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, border-color 0.15s ease;
    outline: none;
}

.custom-modal-close:hover {
    background: #E5E7EB;
    border-color: #D1D5DB;
}

/* Modal Body */
.custom-modal-body {
    overflow-y: auto;
    margin-bottom: 0;
}

.custom-modal-quote-mark {
    margin-bottom: 18px;
}

.custom-modal-quote-icon {
    width: 40px;
    height: 31px;
    max-width: 40px;
    max-height: 31px;
    object-fit: contain;
    display: block;
}

.custom-modal-description {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-size: 16px;
    line-height: 160%;
    letter-spacing: 0%;
    color: #282828;
    white-space: pre-line;
}

/* Modal Footer / Disclaimer */
.custom-modal-footer {
    border-top: 1px solid #EAEAEA;
    margin-top: 28px;
    padding-top: 20px;
}

.custom-modal-disclaimer-box {
    background: #F4F6F8;
    border-radius: 6px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.custom-modal-check-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.custom-modal-disclaimer-text {
    font-family: 'Noto Sans', sans-serif;
    font-weight: 400;
    font-size: 13px;
    line-height: 100%;
    letter-spacing: 0%;
    color: #282828;
}

@media (max-width: 640px) {
    .custom-modal-card {
        padding: 24px 20px 20px;
        max-height: 92vh;
    }

    .custom-modal-disclaimer-box {
        align-items: flex-start;
        padding: 8px 12px;
    }

    .custom-modal-disclaimer-text {
        line-height: 140%;
    }
}
