/* ==========================================================================
   How It Works Page Styles
   ========================================================================== */

/* ---- Hero Navigation ---- */
.hiw-nav-wrapper {
    position: sticky;
    top: 73px;
    z-index: 1020;
    transition: all var(--wc-ease);
}

[data-bs-theme="dark"] .hiw-nav-scroll {
    background: rgba(10, 10, 16, 0.85);
}

.hiw-nav-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-radius: 12px;
}

.hiw-nav-scroll::-webkit-scrollbar {
    display: none;
    /* Safari and Chrome */
}

.hiw-nav {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0;
    min-width: max-content;
}

.hiw-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-muted);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    transition: all var(--wc-ease);
}

.hiw-nav-link svg {
    width: 16px;
    height: 16px;
}

.hiw-nav-link:hover,
.hiw-nav-link.active {
    background: var(--color-primary-light2);
    color: var(--color-primary);
}

/* ---- Workflow Overview (Section 2) ---- */
.hiw-flow {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.hiw-flow-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    z-index: 2;
    transition: all var(--wc-ease);
    text-align: center;
}

.hiw-flow-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-primary);
    box-shadow: var(--wc-shadow);
}

.hiw-flow-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--wc-grad-soft);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.hiw-flow-icon svg {
    width: 28px;
    height: 28px;
}

.hiw-flow-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 8px;
}

.hiw-flow-desc {
    font-size: 0.85rem;
    color: var(--color-muted);
    margin: 0;
}

/* Connectors for Workflow */
.hiw-flow-arrow {
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--color-muted);
    opacity: 0.5;
}

.hiw-flow-arrow svg {
    width: 24px;
    height: 24px;
}

@media (min-width: 992px) {
    .hiw-flow {
        flex-direction: row;
        align-items: stretch;
    }

    .hiw-flow-card {
        flex: 1;
    }

    .hiw-flow-arrow {
        transform: rotate(-90deg);
        /* Point right instead of down */
    }
}

/* ---- Alternating Blocks (Section 3) ---- */
.hiw-stage-block {
    scroll-margin-top: 100px;
    padding: 80px 0;
}

.hiw-stage-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-primary);
    background: var(--color-primary-light2);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    margin-bottom: 16px;
}

.hiw-stage-img-wrapper {
    position: relative;
    border-radius: var(--radius-xl);
    background: var(--wc-grad-soft);
    padding: 24px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

@media (min-width: 992px) {
    .hiw-stage-img-wrapper {
        aspect-ratio: 4 / 3;
    }
}

.hiw-placeholder-svg {
    width: 100%;
    height: auto;
    opacity: 0.8;
}

.hiw-feature-list {
    margin-top: 24px;
    display: grid;
    gap: 16px;
}

.hiw-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.hiw-feature-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(131, 7, 222, 0.1);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.hiw-feature-icon svg {
    width: 14px;
    height: 14px;
}

.hiw-feature-text {
    font-size: 0.95rem;
    color: var(--color-body);
    line-height: 1.4;
}

.hiw-feature-text strong {
    color: var(--color-heading);
    display: block;
}

/* ---- Approval Gate Deep Dive (Section 4) ---- */
.hiw-approval-gate {
    background: #0B051D;
    /* Deep premium dark for contrast */
    color: #fff;
    border-radius: var(--radius-xl);
    padding: 60px 40px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(131, 7, 222, 0.25);
    border: 1px solid rgba(131, 7, 222, 0.3);
}

.hiw-approval-gate::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--wc-grad);
}

.hiw-approval-gate::after {
    content: "";
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(131, 7, 222, 0.2) 0%, transparent 70%);
    top: -200px;
    right: -100px;
    border-radius: 50%;
    pointer-events: none;
}

.hiw-approval-heading {
    color: #fff !important;
}

/* Comparison Cards inside Approval Gate */
.hiw-compare-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 30px;
    height: 100%;
}

.hiw-compare-card.with-approval {
    background: rgba(131, 7, 222, 0.08);
    border: 1px solid rgba(131, 7, 222, 0.4);
    box-shadow: inset 0 0 40px rgba(131, 7, 222, 0.1);
}

.hiw-compare-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 1.25rem;
    font-weight: 700;
}

.hiw-compare-header .hiw-ch-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hiw-compare-header .hiw-ch-icon svg {
    width: 24px;
    height: 24px;
}

.hiw-compare-card.without .hiw-ch-icon {
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
}

.hiw-compare-card.without .hiw-compare-header {
    color: #ff6b6b;
}

.hiw-compare-card.with-approval .hiw-ch-icon {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.hiw-compare-card.with-approval .hiw-compare-header {
    color: #4ade80;
}

.hiw-compare-list {
    display: grid;
    gap: 16px;
}

.hiw-compare-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.hiw-compare-list svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Approval Workflow Horizontal */
.hiw-approval-flow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 50px;
}

.hiw-af-step {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 12px 24px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.hiw-af-step.active {
    background: var(--color-primary);
    border-color: #a42cff;
    box-shadow: 0 0 20px rgba(131, 7, 222, 0.4);
}

.hiw-af-arrow {
    color: rgba(255, 255, 255, 0.3);
}

/* Diff Viewer Mockup */
.hiw-diff-viewer {
    background: #111;
    border-radius: var(--radius-md);
    border: 1px solid #333;
    overflow: hidden;
    margin-top: 40px;
    font-family: monospace;
    font-size: 0.85rem;
}

.hiw-diff-header {
    background: #222;
    padding: 10px 16px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #333;
    color: #aaa;
}

.hiw-diff-body {
    padding: 16px;
}

.hiw-diff-line {
    display: flex;
    padding: 4px 0;
}

.hiw-diff-line.removed {
    background: rgba(255, 50, 50, 0.15);
    color: #ff8888;
}

.hiw-diff-line.added {
    background: rgba(50, 255, 50, 0.15);
    color: #88ff88;
}

.hiw-diff-actions {
    padding: 16px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.hiw-diff-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity var(--wc-ease);
}

.hiw-diff-btn:hover {
    opacity: 0.8;
}

.hiw-diff-btn.reject {
    background: rgba(255, 50, 50, 0.2);
    color: #ff8888;
    border: 1px solid #ff4444;
}

.hiw-diff-btn.approve {
    background: #4ade80;
    color: #000;
}

/* ---- Alt Workflow Overview (Step Cards Process) ---- */
.hiw-steps {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 50px;
}

@media (min-width: 575px) {
    .hiw-steps {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .hiw-steps {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

.hiw-step-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 24px;
    position: relative;
    transition: all var(--wc-ease);
    text-align: left;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
    z-index: 2;
}

.hiw-step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--wc-shadow);
    border-color: var(--color-primary);
}

.hiw-step-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--wc-grad-soft);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

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

.hiw-step-num {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 32px;
    height: 32px;
    background: var(--wc-grad);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    box-shadow: 0 4px 12px rgba(131, 7, 222, 0.3);
}

.hiw-step-content {
    display: flex;
    flex-direction: column;
}

.hiw-step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-heading);
    margin-bottom: 6px;
}

.hiw-step-desc {
    font-size: 0.9rem;
    color: var(--color-muted);
    margin: 0;
    line-height: 1.4;
}

/* Accent Card for Approve */
.hiw-step-card.accent {
    background: var(--wc-grad);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 12px 30px rgba(131, 7, 222, .25);
}

.hiw-step-card.accent .hiw-step-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.hiw-step-card.accent .hiw-step-title,
.hiw-step-card.accent .hiw-step-desc {
    color: #fff;
}

.hiw-step-card.accent .hiw-step-num {
    background: #fff;
    color: var(--color-primary);
}

/* Desktop Connectors */
@media (min-width: 1024px) {
    .hiw-step-card::after {
        content: '';
        position: absolute;
        top: 50%;
        right: -16px;
        width: 10px;
        height: 2px;
        background: var(--color-border);
        z-index: 1;
    }

    .hiw-step-card:nth-child(3n)::after {
        display: none;
    }
}

@media (max-width: 991px) {
    .hiw-nav-wrapper {
        top: 60px;
    }

    .hiw-stage-block {
        padding: 40px 0;
    }
}

@media (max-width: 767px) {
    .hiw-approval-gate {
        padding: 40px 20px;
    }

    .hiw-nav-wrapper {
        top: 50px;
    }

    .hiw-step-num {
        left: 0;
    }
}