@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

*, *:before, *:after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Poppins', sans-serif;
  background: #ffffff;
  color: #333333;
}

.therapy-adherence-section {
  padding: 4vh 20px;
  max-width: 100%;
  background-color: #fcfcfc;
  background-image: url('pattern-adherence.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-top: 1px solid #eaeaea;
  border-bottom: 1px solid #eaeaea;
  height: 900px;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-header {
    text-align: center;
    margin-bottom: 4vh;
}

.section-header h2 {
    font-family: "Cairo", sans-serif;
    font-size: 36px;
    font-weight: 700;
    color: #000;
    margin: 0;
    letter-spacing: 1px;
    display: inline-block;
    position: relative;
    padding-bottom: 10px;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #D1252E;
}

.header-divider {
  height: 4px;
  width: 60px;
  background: #D1252E;
  margin: 15px auto 0;
  border-radius: 2px;
}

.cont {
  position: relative;
  /* overflow: hidden; Removed to allow hover shadows and transforms to be visible */
  flex: 1; /* Automatically fill remaining height of 100vh */
  min-height: 0; /* Important to prevent flex overflow */
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 10px; /* Added padding to give room for the hover lift */
}

.cont__inner {
  position: relative;
  height: 100%;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 20px; 
}

.el {
  position: relative;
  width: calc(33.333% - 14px);
  height: calc(50% - 10px);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), height 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease, margin 0.6s ease, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), border 0.4s;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.05);
  background: #ffffff;
  cursor: pointer;
  border: 1px solid rgba(247, 92, 116, 0.15); /* Light pinkish border */
}

.el:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 15px 35px rgba(247, 92, 116, 0.15);
  border-color: #f75c74;
}

.el:active {
  transform: translateY(-2px) scale(0.98);
  transition: transform 0.1s;
}

.cont.s--el-active {
  display: flex;
  justify-content: center;
  align-items: center;
}

.cont.s--el-active .cont__inner {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  align-content: center !important;
  height: auto !important;
  flex-wrap: nowrap !important;
  width: 100%;
}

.cont.s--el-active .el {
  cursor: default;
}

.cont.s--el-active .el:not(.s--active) {
  display: none !important;
}

.cont.s--el-active .el.s--active {
  width: var(--th-fit-w, fit-content) !important;
  height: var(--th-fit-h, fit-content) !important;
  max-width: 100% !important;
  min-width: 480px;
  flex: none;
  margin: 0 auto;
  opacity: 1;
  pointer-events: auto;
  border-radius: 30px;
  border: 2px solid #f75c74;
  box-shadow: 0 20px 50px rgba(247, 92, 116, 0.2);
  transition: border 0.4s, box-shadow 0.4s;
}

/* Phase 2: content flows into normal position */
.el.s--flow .el__content,
.el.s--flow .el__overflow,
.el.s--flow .el__inner {
  position: relative !important;
  top: auto !important;
  bottom: auto !important;
  left: auto !important;
  right: auto !important;
  height: auto !important;
  width: 100% !important;
}

.el.s--flow .el__content {
  opacity: 0;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.35s ease;
}

.el.s--flow .containerholder {
  flex: 0 1 auto !important;
  justify-content: flex-start !important;
}

/* Phase 3: fade content in */
.el.s--visible .el__content {
  opacity: 1;
}

.cont.s--el-active .el:hover {
  transform: none;
}

.el__overflow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
}

.el__inner {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  transition: transform 0.7s cubic-bezier(0.2, 1, 0.3, 1);
}

.el__bg {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background: #ffffff;
  transition: opacity 0.5s ease, background 0.5s ease;
}

/* Icons and preview styling for folded state */
.el__preview-cont {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 0 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.5s ease;
}

.preview-text-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  flex: 0 1 auto;
  z-index: 2;
  max-width: 65%;
  height: 100%;
  padding: 30px 0;
}

.el__preview-cont h3 {
  font-size: 20px;
  font-weight: 700;
  color: #333;
  margin: 0;
  text-align: left;
  line-height: 1.3;
}



/* Expanded state content */
.el__content {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 40px;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Changed from center to prevent top bleeding */
}

.containerholder {
  margin: 0;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  justify-content: center;
}

.el__content .active-title {
    font-size: 30px;
    margin-bottom: 20px;
    color: #D1252E;
    font-weight: 700;
    text-align: center;
}

/* Custom layout for unfolded content */
.content-split {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.text-box {
    flex: 1.2;
    padding: 25px 35px;
    border-radius: 24px;
}

.pink-box {
    background: #fdf1f4;
    color: #1a1a1a;
    border: 1px solid rgba(209, 37, 46, 0.08);
    box-shadow: 0 10px 30px rgba(209, 37, 46, 0.04);
}

.pink-box p {
    font-size: 18px;
    line-height: 1.6;
    font-weight: 500;
    text-align: center;
    margin: 0;
    color: #333333;
}

.image-box {
    flex: 0.8;
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-box img {
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    border-radius: 20px !important;
}

.el__close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  background: #fdf1f4;
  border-radius: 50%;
  transition: transform 0.2s, opacity 0.3s, background 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.el__close-btn:hover {
  transform: scale(1.1);
  background: #D1252E;
}

.el__close-btn::before, .el__close-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 28%;
  width: 44%;
  height: 2px;
  background: #D1252E;
  transition: background 0.3s;
}

.el__close-btn:hover::before, .el__close-btn:hover::after {
  background: #ffffff;
}

.el__close-btn::before { transform: rotate(45deg); }
.el__close-btn::after { transform: rotate(-45deg); }

.el.s--active .el__preview-cont {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -60%);
}

.el.s--active .el__content {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.4s;
}

.el.s--active .el__close-btn {
  opacity: 1;
  pointer-events: auto;
  transition-delay: 0.5s;
}

/* Responsive Design - Single Fold Accordion Mode */
@media (max-width: 992px) {
    .therapy-adherence-section {
        height: 100vh;
        padding: 2vh 15px;
    }
    .section-header {
        margin-bottom: 2vh;
    }
    .section-header h2 {
        font-size: 28px;
    }
    .cont {
        flex: 1;
        min-height: 0;
    }
    
    .cont__inner {
        flex-direction: column;
        flex-wrap: nowrap;
        gap: 10px;
    }
    
    .el {
        min-height: 80px;
        width: 100% !important;
        height: calc((100% - 50px) / 6) !important;
    }
    
    .cont.s--el-active .el.s--active {
        width: 100% !important;
        height: 100% !important;
        min-width: 0 !important;
        margin: 0;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .cont.s--el-active .el:not(.s--active) {
        height: 0 !important;
        min-height: 0;
        margin: 0;
        border: none;
        opacity: 0;
    }
    
    .el__preview-cont {
        flex-direction: row;
        gap: 12px;
        justify-content: flex-start;
        text-align: left;
        padding: 10px 16px;
        top: 0;
        left: 0;
        transform: none;
        overflow: hidden;
    }
    

    .el__preview-cont h3 {
        font-size: 15px;
        flex: 1;
        line-height: 1.3;
    }

    .click-hint {
        margin-top: 4px;
        flex-direction: row;
        gap: 6px;
        padding: 3px 8px;
        font-size: 10px;
    }

    .click-hint span {
        display: none;
    }

    .click-hint svg {
        width: 14px;
        height: 14px;
        transform: rotate(-90deg);
        animation: pulse-right 2s infinite;
    }

    @keyframes pulse-right {
        0%, 20%, 50%, 80%, 100% { transform: rotate(-90deg) translateY(0); }
        40% { transform: rotate(-90deg) translateY(6px); }
        60% { transform: rotate(-90deg) translateY(3px); }
    }
    
    .preview-text-col {
        padding: 8px 0;
        max-width: 100%;
    }

    .preview-img-col {
        height: 100%;
        flex: 0 0 90px;
    }

    .preview-img-col img {
        height: 80px !important;
        width: auto !important;
    }

    .el:nth-child(3) .preview-img-col img,
    .el:nth-child(6) .preview-img-col img {
        transform: none;
    }

    .el:nth-child(5) .preview-img-col img {
        transform: none;
    }
    
    .content-split {
        flex-direction: column-reverse; /* Image on top, text below */
        gap: 15px;
        justify-content: flex-start;
        padding-top: 10px;
    }
    
    .text-box {
        padding: 20px;
    }
    
    .image-box img {
        max-height: 180px;
    }
    
    .el__content {
        padding: 20px 20px;
    }
    
    .el__content .active-title {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .el__close-btn {
        top: 15px;
        right: 15px;
        width: 36px;
        height: 36px;
    }
}

.section-footer {
    text-align: center;
    margin-top: 20px;
}

.section-footer a {
    font-size: 14px;
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.section-footer a:hover {
    color: #D1252E;
    text-decoration: underline;
}

@media (max-width: 992px) {
    .section-footer {
        margin-top: 10px;
    }
    .section-footer a {
        font-size: 12px;
    }
}

/* Benefits Grid (Card 2) */
.benefits-grid {
    display: flex;
    justify-content: center;
    gap: 24px;
    width: 100%;
}

.benefit-card {
    background: linear-gradient(180deg, #FFFFFF 0%, #FFF5F6 100%);
    border: 1px solid #FFE4E6;
    border-radius: 18px;
    padding: 20px 24px;
    max-width: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 8px 20px rgba(225, 29, 72, 0.06);
    transition: transform 0.3s;
    text-align: center;
}

.benefit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(225, 29, 72, 0.12);
}

.benefit-card .tile-image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    width: 100%;
    margin-bottom: 12px;
}

.benefit-card .tile-image-wrapper img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.benefit-card .tile-text,
.benefit-card h4 {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    color: #1E293B;
    text-align: center;
    margin: 0;
}

@media (max-width: 992px) {
    .benefits-grid {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .benefit-card {
        max-width: 280px;
        width: 100%;
    }

    .benefit-card .tile-image-wrapper {
        height: 100px;
    }

    .benefit-card .tile-text,
    .benefit-card h4 {
        font-size: 15px;
    }
}

/* Timeline (Card 3) */
.timeline-container {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.timeline-arrow {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 40px;
    background: #d5d5df;
    transform: translateY(-50%);
    z-index: 1;
}

.timeline-arrow::after {
    content: '';
    position: absolute;
    right: -20px;
    top: -10px;
    border-top: 30px solid transparent;
    border-bottom: 30px solid transparent;
    border-left: 20px solid #d5d5df;
}

.timeline-nodes {
    position: relative;
    z-index: 2;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    width: 100%;
    flex: 1;
}

.timeline-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
    max-width: 350px;
}

.node-top {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Align elements to sit on top of the dot */
    align-items: center;
    text-align: center;
    padding: 10px;
    min-height: 0;
}

.node-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Align elements to hang immediately below the dot */
    align-items: center;
    text-align: center;
    padding: 10px;
    min-height: 0;
}

.node-dot {
    width: 24px;
    height: 24px;
    background: #25287f;
    border-radius: 50%;
    margin: 10px 0;
    box-shadow: 0 0 0 5px #ffffff;
    flex-shrink: 0;
}

.node-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    margin: 2px 0;
}

.node-heading {
    font-size: 16px;
    color: #333;
    font-weight: 700;
    margin-bottom: 4px;
}

.node-img {
    height: 100px !important;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

@media (max-width: 992px) {
    .timeline-container {
        padding: 10px 0;
    }
    
    .timeline-arrow {
        height: 20px;
    }
    
    .timeline-arrow::after {
        right: -10px;
        top: -5px;
        border-top: 15px solid transparent;
        border-bottom: 15px solid transparent;
        border-left: 10px solid #d5d5df;
    }
    
    .node-top, .node-bottom {
        min-height: 60px;
    }
    
    .node-dot {
        margin: 5px 0;
        width: 16px;
        height: 16px;
        box-shadow: 0 0 0 3px #ffffff;
    }
    
    .node-text {
        font-size: 13px;
        margin: 2px 0;
    }
    
    .node-heading {
        font-size: 14px;
        margin-bottom: 3px;
    }
    
    .node-img {
        max-height: 60px;
    }
}

/* Reasons Grid (Card 4) */
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    min-height: 0; /* important for flex shrinking */
}

.reason-card {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.3s;
    position: relative;
    padding-top: 45px; /* Space for pill */
    min-height: 0;
}

.reason-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(209, 37, 46, 0.1);
}

.reason-card img {
    width: 100%;
    height: 100% !important;
    max-height: 250px;
    object-fit: contain;
    padding: 10px;
}

.pill {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 20px;
    border-radius: 30px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.pill-blue { background: #2c73d2; }
.pill-green { background: #3f9c65; }
.pill-orange { background: #e67e22; }
.pill-purple { background: #5b4282; }

@media (max-width: 992px) {
    .reasons-grid {
        gap: 10px;
    }
    
    .pill {
        top: 8px;
        font-size: 12px;
        padding: 4px 12px;
    }
    
    .reason-card {
        padding-top: 12px;
    }
    
    .reason-card img {
        max-height: 90px;
        padding: 5px;
    }
}

/* Improve Adherence (Card 5) */
.process-arrow-container {
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
    background: #FFF0F2;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
}

.improve-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    position: relative;
    z-index: 2;
}

.improve-card {
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s;
    background: #fff;
}

.improve-card:hover {
    transform: translateY(-5px);
}

.improve-card .img-wrap {
    height: 220px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #FFD6DD;
}

.improve-card .img-wrap img {
    object-fit: contain;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
}

.card-label {
    text-align: center;
    padding: 14px 10px;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card Colors — Spec Palette */
.box-pink .img-wrap { background: #FFD6DD; }
.box-pink .card-label { background: #E75270; }

.box-purple .img-wrap { background: #D9CEFF; }
.box-purple .card-label { background: #7E63E6; }

.box-blue .img-wrap { background: #C5D7FE; }
.box-blue .card-label { background: #5374D8; }

.box-lightblue .img-wrap { background: #B8E5F8; }
.box-lightblue .card-label { background: #40A2DE; }

@media (max-width: 992px) {
    .process-arrow-container {
        padding: 15px;
    }

    .improve-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .improve-card .img-wrap {
        height: 160px;
        padding: 10px;
    }

    .improve-card .img-wrap img {
        max-height: 100%;
    }

    .card-label {
        font-size: 14px;
        padding: 10px 8px;
    }
}

@media (max-width: 576px) {
    .improve-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .improve-card {
        flex-direction: row;
        align-items: center;
    }

    .improve-card .img-wrap {
        width: 100px;
        height: 80px;
        flex: none;
        padding: 8px;
    }

    .improve-card .img-wrap img {
        max-height: 100%;
        max-width: 100%;
    }

    .card-label {
        flex: 1;
        text-align: left;
        justify-content: flex-start;
        padding-left: 16px;
        font-size: 14px;
    }

    .complications-split-layout {
        flex-direction: column !important;
        gap: 15px;
    }

    .complications-split-left {
        flex: none;
        width: 100%;
        padding-right: 0;
        text-align: center;
    }

    .complications-split-left .active-title {
        text-align: center !important;
    }

    .complications-split-right {
        width: 100%;
    }

    .complications-wrapper img {
        max-height: 250px;
    }
}

/* Complications (Card 6) */
.complications-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    width: 100%;
}

.complications-wrapper img {
    width: 100%;
    height: 100% !important;
    object-fit: contain;
    border-radius: 20px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05) !important;
}

.complications-split-layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.complications-split-left {
    flex: 0 0 45%;
    padding-right: 30px;
}

.complications-split-right {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
    min-height: 0;
}

@media (max-width: 992px) {
    .complications-wrapper {
        padding-top: 10px;
    }
}

/* Quote styling */
.hero-quote {
    text-align: center;
    font-size: 20px;
    font-style: italic;
    color: #666;
    margin-top: -10px;
    margin-bottom: 25px;
    font-weight: 500;
}

@media (max-width: 992px) {
    .hero-quote {
        font-size: 16px;
        margin-bottom: 15px;
        margin-top: -5px;
    }
}

/* Added missing styles for click-hint and preview images */
.click-hint {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: #f75c74;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-top: auto;
  opacity: 1;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 5px 12px;
  border-radius: 30px;
  background: rgba(247, 92, 116, 0.15);
  border: 1px solid rgba(247, 92, 116, 0.25);
  width: fit-content;
}

.el:hover .click-hint {
  background: rgba(247, 92, 116, 0.25);
  border-color: rgba(247, 92, 116, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(247, 92, 116, 0.15);
}

.click-hint span {
  margin-bottom: 0;
  white-space: nowrap;
}

.click-hint svg {
  width: 16px;
  height: 16px;
  stroke: #f75c74;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.el:hover .click-hint svg {
  transform: translateY(3px);
}

.preview-img-col {
  position: relative;
  height: 100%;
  width: auto;
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1;
  pointer-events: none;
  opacity: 0.95;
}

.preview-img-col img {
  width: 100% !important;
  height: 230px !important;
  object-fit: contain !important;
  transform-origin: right center;
}

.el:nth-child(3) .preview-img-col img,
.el:nth-child(6) .preview-img-col img {
  transform: scale(1.10);
}

.el:first-child .preview-img-col img {
  margin-bottom: 15px;
}

.el:nth-child(5) .preview-img-col img {
  transform: scale(1.05) translateX(15px);
}

.preview-text-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  flex: 0 1 auto;
  z-index: 2;
  max-width: 75%;
  height: 100%;
  padding: 30px 0;
}

.el__preview-cont h3 {
  font-size: 18px;
  font-weight: 800;
  color: #333;
  margin: 0;
  text-align: left;
  line-height: 1.4;
}


