/* Landing Page Diagram - Circular Lifecycle */

.landing-diagram-block {
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.landing-diagram-container {
    margin: 0 auto;
    max-width: 1200px;
    padding: 0 20px;
}

/* Header */
.landing-diagram-header {
    text-align: center;
    margin-bottom: 60px;
}

.landing-diagram-title {
    color: #000;
    font-family: helvetica_lt_std_condensed, Arial, Helvetica, sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 15px;
    text-transform: none;
}

.landing-diagram-subtitle {
    color: #333;
    font-family: helvetica_lt_stdlight, Arial, Helvetica, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    margin: 0 auto;
    max-width: 700px;
}

/* Diagram Wrapper */
.diagram-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 1;
    min-height: 600px;
}

/* SVG Connectors (behind cards) */
.diagram-connectors {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: visible;
}

/* SVG Arrow (on top of cards) */
.diagram-arrow {
    position: absolute;
    top: 44%;
    left: 54%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    overflow: visible;
}

.connector-arc {
    opacity: 0;
    stroke-dasharray: 8 4;
}

.landing-diagram-block.is-visible .connector-arc {
    animation: fadeIn 1s ease 0.5s forwards, flowAnimation 10s linear infinite 1.5s;
}

@keyframes flowAnimation {
    0% {
        stroke-dashoffset: 0;
    }
    100% {
        stroke-dashoffset: -120;
    }
}


/* Entering Arrowhead */
.entering-arrowhead {
    opacity: 0;
    transform-origin: 0 0;
}

.landing-diagram-block.is-visible .entering-arrowhead {
    animation: fadeIn 1s ease 0.5s forwards, arrowheadMove 2s ease-in-out infinite 1.5s;
}

.entering-arrowhead path {
    fill: #000;
}

@keyframes arrowheadMove {
    0%, 100% {
        transform: translate(288px, 20px) rotate(90deg) scale(0.049);
    }
    50% {
        transform: translate(288px, 35px) rotate(90deg) scale(0.049);
    }
}

/* Center Element */
.diagram-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    border-radius: 50%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border: 3px solid #000;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
}

.landing-diagram-block.is-visible .diagram-center {
    animation: centerPulse 0.8s ease 0.3s forwards;
}

.center-content {
    text-align: center;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.center-text {
    font-family: helvetica_lt_std_condensed, Arial, Helvetica, sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #000;
    line-height: 1.2;
}

.center-image {
    max-width: 80%;
    max-height: 80%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Diagram Footer */
.diagram-footer {
    text-align: center;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.diagram-footer-title {
    font-family: helvetica_lt_std_condensed, Arial, Helvetica, sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    color: #000;
    margin: 0 0 15px;
    line-height: 1.2;
}

.diagram-footer-description {
    font-family: helvetica_lt_stdlight, Arial, Helvetica, sans-serif;
    font-size: 16px;
    color: #333;
    margin: 0;
    line-height: 1.6;
}

.diagram-cta-button {
    margin-top: 25px;
}

.diagram-cta-button .wp-block-button__link {
    font-family: helvetica_lt_std_condensed, Arial, Helvetica, sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 14px 28px;
    border-radius: 50px;
    background-color: #000 !important;
    color: #fff !important;
    border: 2px solid #000 !important;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.diagram-cta-button .wp-block-button__link::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    background-color: #fff;
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'%3E%3C/line%3E%3Cpolyline points='7 7 17 7 17 17'%3E%3C/polyline%3E%3C/svg%3E");
    background-size: 12px;
    background-position: center;
    background-repeat: no-repeat;
    transition: background-color 0.3s ease;
}

.diagram-cta-button .wp-block-button__link:hover {
    background-color: #fff !important;
    color: #000 !important;
}

.diagram-cta-button .wp-block-button__link:hover::after {
    background-color: #000;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='7' y1='17' x2='17' y2='7'%3E%3C/line%3E%3Cpolyline points='7 7 17 7 17 17'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Steps Container */
.diagram-steps {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Individual Steps - Positioned in circle */
.diagram-step {
    position: absolute;
    width: 250px;
    height: 150px;
    opacity: 0;
    transform: scale(0.8);
    z-index: 5;
}

/* 5 steps layout (starting top center, clockwise to left) */
.diagram-step.step-1 {
    top: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.9) translateY(20px);
}

.diagram-step.step-2 {
    top: 35%;
    right: 0;
}

.diagram-step.step-3 {
    bottom: 10%;
    right: 10%;
}

.diagram-step.step-4 {
    bottom: 10%;
    left: 10%;
}

.diagram-step.step-5 {
    top: 35%;
    left: 0;
}

/* Animations triggered on scroll */
.landing-diagram-block.is-visible .diagram-step.step-1 {
    animation: stepFadeInCenter 0.7s ease-out 0.3s forwards;
}

.landing-diagram-block.is-visible .diagram-step.step-2 {
    animation: stepFadeIn 0.7s ease-out 0.5s forwards;
}

.landing-diagram-block.is-visible .diagram-step.step-3 {
    animation: stepFadeIn 0.7s ease-out 0.7s forwards;
}

.landing-diagram-block.is-visible .diagram-step.step-4 {
    animation: stepFadeIn 0.7s ease-out 0.9s forwards;
}

.landing-diagram-block.is-visible .diagram-step.step-5 {
    animation: stepFadeIn 0.7s ease-out 1.1s forwards;
}

/* 6 steps layout */
.diagram-wrapper[data-steps="6"] .diagram-step.step-1 {
    top: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
}

.diagram-wrapper[data-steps="6"] .diagram-step.step-2 {
    top: 20%;
    right: 0;
}

.diagram-wrapper[data-steps="6"] .diagram-step.step-3 {
    bottom: 20%;
    right: 0;
}

.diagram-wrapper[data-steps="6"] .diagram-step.step-4 {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
}

.diagram-wrapper[data-steps="6"] .diagram-step.step-5 {
    bottom: 20%;
    left: 0;
}

.diagram-wrapper[data-steps="6"] .diagram-step.step-6 {
    top: 20%;
    left: 0;
}

.landing-diagram-block.is-visible .diagram-wrapper[data-steps="6"] .diagram-step.step-6 {
    animation: stepFadeIn 0.7s ease-out 1.3s forwards;
}

/* 4 steps layout */
.diagram-wrapper[data-steps="4"] .diagram-step.step-1 {
    top: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
}

.diagram-wrapper[data-steps="4"] .diagram-step.step-2 {
    top: 50%;
    right: 0;
    transform: translateY(-50%) scale(0.8);
}

.diagram-wrapper[data-steps="4"] .diagram-step.step-3 {
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
}

.diagram-wrapper[data-steps="4"] .diagram-step.step-4 {
    top: 50%;
    left: 0;
    transform: translateY(-50%) scale(0.8);
}

/* 3 steps layout */
.diagram-wrapper[data-steps="3"] .diagram-step.step-1 {
    top: 5%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
}

.diagram-wrapper[data-steps="3"] .diagram-step.step-2 {
    bottom: 15%;
    right: 5%;
}

.diagram-wrapper[data-steps="3"] .diagram-step.step-3 {
    bottom: 15%;
    left: 5%;
}

/* Step Card */
.step-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e0e5eb;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 15px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.step-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    border-color: #000;
}

/* Step Number/Icon */
.step-number-wrapper {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.step-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.step-number {
    font-family: helvetica_lt_std_condensed, Arial, Helvetica, sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

/* Step Content */
.step-content {
    text-align: left;
    flex: 1;
}

.step-title {
    font-family: helvetica_lt_std_condensed, Arial, Helvetica, sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    margin: 0 0 8px;
    line-height: 1.2;
}

.step-description {
    font-family: helvetica_lt_stdlight, Arial, Helvetica, sans-serif;
    font-size: 13px;
    color: #333;
    margin: 0;
    line-height: 1.4;
}

/* Animations */
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

@keyframes centerPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes stepFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Fix transform for centered steps */
.diagram-step.step-1 {
    animation: stepFadeInCenter 0.6s ease 0.3s forwards;
}

@keyframes stepFadeInCenter {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1) translateY(0);
    }
}

/* Continuous subtle animation for center */
.diagram-center::after {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 2px solid rgba(0, 0, 0, 0.3);
    animation: pulseRing 3s ease-in-out infinite;
}

@keyframes pulseRing {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.2;
    }
}

/* Dark Mode */
body.dark-mode .landing-diagram-block {
    background-color: #000 !important;
}

body.dark-mode .landing-diagram-title {
    color: #fff;
}

body.dark-mode .landing-diagram-subtitle {
    color: #ccc;
}

body.dark-mode .diagram-footer-title {
    color: #fff;
}

body.dark-mode .diagram-footer-description {
    color: #ccc;
}

body.dark-mode .connector-arc,
body.dark-mode .entering-arrow,
body.dark-mode .exiting-arrow {
    stroke: #fff;
}

body.dark-mode .exiting-pulse {
    fill: #fff;
}

body.dark-mode .entering-arrowhead path {
    fill: #fff;
}

body.dark-mode .diagram-center {
    background: linear-gradient(135deg, #1a1a1a 0%, #000 100%);
    border-color: #fff;
    box-shadow: 0 10px 40px rgba(255, 255, 255, 0.1);
}

body.dark-mode .diagram-center::after {
    border-color: rgba(255, 255, 255, 0.3);
}

body.dark-mode .center-text {
    color: #fff;
}

body.dark-mode .step-card {
    background: #1a1a1a;
    border-color: #333;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

body.dark-mode .step-card:hover {
    border-color: #fff;
    box-shadow: 0 8px 30px rgba(255, 255, 255, 0.1);
}

body.dark-mode .step-number-wrapper {
    background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .step-number {
    color: #fff;
}

body.dark-mode .step-title {
    color: #fff;
}

body.dark-mode .step-description {
    color: #ccc;
}

/* Dark Mode - Mobile Timeline */
@media (max-width: 768px) {
    body.dark-mode .diagram-steps::before {
        background: linear-gradient(to bottom, #fff 0%, rgba(255, 255, 255, 0.3) 100%);
    }

    body.dark-mode .diagram-step::before {
        background: #fff;
        border-color: #000;
        box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
    }
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .landing-diagram-block {
        padding: 60px 0;
    }

    .landing-diagram-header {
        margin-bottom: 40px;
    }

    .diagram-wrapper {
        max-width: 700px;
        min-height: 500px;
    }

    .diagram-center {
        width: 160px;
        height: 160px;
    }

    .center-text {
        font-size: 18px;
    }

    .diagram-footer-title {
        font-size: 1.5rem;
    }

    .diagram-footer-description {
        font-size: 15px;
    }

    .diagram-step {
        width: 200px;
        height: 120px;
    }

    .step-card {
        padding: 15px;
        gap: 12px;
    }

    .step-number-wrapper {
        width: 40px;
        height: 40px;
    }

    .step-icon {
        width: 24px;
        height: 24px;
    }

    .step-number {
        font-size: 20px;
    }

    .step-title {
        font-size: 14px;
    }

    .step-description {
        font-size: 12px;
    }
}

/* Mobile Styles - Vertical Layout */
@media (max-width: 768px) {
    .landing-diagram-block {
        padding: 50px 0;
    }

    .landing-diagram-container {
        padding: 0 15px;
    }

    .landing-diagram-title {
        font-size: 1.75rem;
        margin-bottom: 12px;
    }

    .landing-diagram-subtitle {
        font-size: 16px;
    }

    .landing-diagram-header {
        margin-bottom: 30px;
    }

    /* Switch to vertical timeline on mobile */
    .diagram-wrapper {
        aspect-ratio: auto;
        min-height: auto;
        max-width: 100%;
    }

    .diagram-connectors,
    .diagram-arrow {
        display: none;
    }

    .diagram-center {
        display: none;
    }

    .center-content {
        padding: 30px 20px;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .center-text {
        font-size: 18px;
    }

    .diagram-footer-title {
        margin-bottom: 10px;
    }

    .diagram-footer-description {
        font-size: 15px;
    }

    .diagram-cta-button {
        margin-bottom: 25px;
    }

    .diagram-footer {
        margin-top: 25px;
    }

    /* Steps as vertical timeline */
    .diagram-steps {
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 20px;
        padding-left: 30px;
    }

    /* Timeline line */
    .diagram-steps::before {
        content: '';
        position: absolute;
        left: 8px;
        top: 0;
        bottom: 0;
        width: 2px;
        background: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.3) 100%);
    }

    .diagram-step {
        position: relative;
        width: 100%;
        height: auto;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
        opacity: 0;
        animation: mobileStepFadeIn 0.5s ease forwards;
    }

    .diagram-step.step-1 { animation-delay: 0.2s; }
    .diagram-step.step-2 { animation-delay: 0.3s; }
    .diagram-step.step-3 { animation-delay: 0.4s; }
    .diagram-step.step-4 { animation-delay: 0.5s; }
    .diagram-step.step-5 { animation-delay: 0.6s; }
    .diagram-step.step-6 { animation-delay: 0.7s; }

    @keyframes mobileStepFadeIn {
        0% {
            opacity: 0;
            transform: translateX(-20px);
        }
        100% {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Timeline dot */
    .diagram-step::before {
        content: '';
        position: absolute;
        left: -26px;
        top: 25px;
        width: 12px;
        height: 12px;
        background: #000;
        border-radius: 50%;
        border: 2px solid #fff;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
    }

    .step-card {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 15px;
        padding: 20px;
        height: auto;
    }

    .step-number-wrapper {
        flex-shrink: 0;
        width: 50px;
        height: 50px;
    }

    .step-content {
        text-align: left;
        flex: 1;
    }

    .step-title {
        font-size: 16px;
    }

    .step-description {
        font-size: 14px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .landing-diagram-block {
        padding: 40px 0;
    }

    .landing-diagram-title {
        font-size: 1.5rem;
    }

    .landing-diagram-subtitle {
        font-size: 15px;
    }

    .center-content {
        padding: 25px 15px;
    }

    .center-text {
        font-size: 16px;
    }

    .diagram-footer {
        margin-bottom: 25px;
    }

    .diagram-footer-description {
        font-size: 14px;
    }

    .diagram-steps {
        gap: 15px;
        padding-left: 25px;
    }

    .diagram-step::before {
        left: -21px;
        width: 10px;
        height: 10px;
    }

    .step-card {
        padding: 15px;
        gap: 12px;
    }

    .step-number-wrapper {
        width: 40px;
        height: 40px;
    }

    .step-icon {
        width: 24px;
        height: 24px;
    }

    .step-number {
        font-size: 18px;
    }

    .step-title {
        font-size: 15px;
    }

    .step-description {
        font-size: 13px;
    }
}

/* Print Styles */
@media print {
    .landing-diagram-block {
        padding: 20px 0;
    }

    .diagram-center,
    .diagram-step {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .diagram-center::after {
        display: none;
    }
}
