/* =====================================================
   ETW - Elementor Timeline Widget
   timeline.css
   ===================================================== */

/* ── Reset & Base ─────────────────────────────────── */
.etw-timeline-wrapper *,
.etw-timeline-wrapper *::before,
.etw-timeline-wrapper *::after {
    box-sizing: border-box;
}

.etw-timeline-wrapper {
    position: relative;
    width: 100%;
}

/* =====================================================
   VERTICAL LAYOUT
   ===================================================== */
.etw-timeline-vertical {
    padding: 20px 0;
}

/* ── Center Line ─────────────────────────────────── */
.etw-timeline-vertical .etw-timeline-line-container {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    pointer-events: none;
    z-index: 0;
}

.etw-timeline-line {
    width: 100%;
    height: 100%;
    background-color: #e2e8f0;
    position: relative;
    overflow: hidden;
    border-radius: 99px;
}

.etw-timeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background-color: #6366f1;
    border-radius: 99px;
    transition: height 0.4s ease;
}

/* Dashed / dotted line styles */
.etw-line-dashed .etw-timeline-vertical .etw-timeline-line {
    background: repeating-linear-gradient(
        to bottom,
        #6366f1 0px, #6366f1 8px,
        transparent 8px, transparent 16px
    );
}
.etw-line-dotted .etw-timeline-vertical .etw-timeline-line {
    background: repeating-linear-gradient(
        to bottom,
        #6366f1 0px, #6366f1 4px,
        transparent 4px, transparent 12px
    );
}

/* ── Items ────────────────────────────────────────── */
.etw-timeline-vertical .etw-timeline-items {
    position: relative;
    z-index: 1;
}

.etw-timeline-vertical .etw-timeline-item {
    margin-bottom: 40px;
    position: relative;
}
.etw-timeline-vertical .etw-timeline-item:last-child {
    margin-bottom: 0;
}

/* ── Content Wrap (columns) ──────────────────────── */
.etw-timeline-vertical .etw-timeline-content-wrap {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
    gap: 20px;
}

/* ── Icon Column ─────────────────────────────────── */
.etw-timeline-vertical .etw-timeline-icon-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.etw-timeline-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: #6366f1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.etw-timeline-item:hover .etw-timeline-icon-wrapper {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.15);
}

.etw-timeline-icon-wrapper i {
    font-size: 18px;
    color: #ffffff;
    line-height: 1;
}
.etw-timeline-icon-wrapper svg {
    width: 18px;
    height: 18px;
    fill: #ffffff;
}

/* ── Content Sides ───────────────────────────────── */
.etw-timeline-content-side {
    display: flex;
}
.etw-content-left  { justify-content: flex-end;  }
.etw-content-right { justify-content: flex-start; }

/* ── Content Card ────────────────────────────────── */
.etw-timeline-content {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    max-width: 100%;
}

.etw-timeline-item:hover .etw-timeline-content {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* ── Arrow ───────────────────────────────────────── */
.etw-has-arrow::before {
    content: '';
    position: absolute;
    top: 22px;
    width: 0;
    height: 0;
    border-style: solid;
}

.etw-arrow-left::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #ffffff;
    filter: drop-shadow(2px 0 2px rgba(0,0,0,0.05));
}
.etw-arrow-right::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent #ffffff transparent transparent;
    filter: drop-shadow(-2px 0 2px rgba(0,0,0,0.05));
}

/* ── Label ───────────────────────────────────────── */
.etw-timeline-label {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.etw-label-below {
    margin-top: 8px;
    margin-bottom: 0;
}

/* ── Title ───────────────────────────────────────── */
.etw-timeline-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e1b4b;
    margin: 0 0 10px;
    line-height: 1.4;
}

/* ── Description ─────────────────────────────────── */
.etw-timeline-description {
    font-size: 14px;
    line-height: 1.7;
    color: #64748b;
    margin-bottom: 0;
}

.etw-timeline-description p {
    margin: 0 0 8px;
}
.etw-timeline-description p:last-child {
    margin-bottom: 0;
}

/* ── Image ───────────────────────────────────────── */
.etw-timeline-image {
    margin-bottom: 16px;
    border-radius: 8px;
    overflow: hidden;
}
.etw-timeline-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}
.etw-timeline-item:hover .etw-timeline-image img {
    transform: scale(1.03);
}

/* ── Button ──────────────────────────────────────── */
.etw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #6366f1;
    background: transparent;
    border: 1.5px solid #6366f1;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
    cursor: pointer;
}
.etw-btn:hover {
    color: #ffffff;
    background: #6366f1;
    border-color: #6366f1;
    text-decoration: none;
}

/* =====================================================
   VERTICAL – ALIGNMENT VARIANTS
   ===================================================== */

/* Left Aligned */
.etw-timeline-vertical.etw-vertical-left .etw-timeline-line-container {
    left: 26px;
    transform: none;
}
.etw-timeline-vertical.etw-vertical-left .etw-timeline-content-wrap {
    grid-template-columns: auto 1fr;
}
.etw-timeline-vertical.etw-vertical-left .etw-content-left  { display: none; }
.etw-timeline-vertical.etw-vertical-left .etw-content-right { justify-content: flex-start; }

/* Right Aligned */
.etw-timeline-vertical.etw-vertical-right .etw-timeline-line-container {
    left: auto;
    right: 26px;
    transform: none;
}
.etw-timeline-vertical.etw-vertical-right .etw-timeline-content-wrap {
    grid-template-columns: 1fr auto;
}
.etw-timeline-vertical.etw-vertical-right .etw-content-right { display: none; }
.etw-timeline-vertical.etw-vertical-right .etw-content-left  { justify-content: flex-end; }

/* Center (single column) */
.etw-timeline-vertical.etw-vertical-center .etw-timeline-line-container {
    left: 26px;
    transform: none;
}
.etw-timeline-vertical.etw-vertical-center .etw-timeline-content-wrap {
    grid-template-columns: auto 1fr;
    align-items: start;
}
.etw-timeline-vertical.etw-vertical-center .etw-content-left  { display: none; }
.etw-timeline-vertical.etw-vertical-center .etw-content-right { justify-content: flex-start; width: 100%; }
.etw-timeline-vertical.etw-vertical-center .etw-content-right .etw-has-arrow::before { display: none; }

/* =====================================================
   HORIZONTAL LAYOUT
   ===================================================== */
.etw-timeline-horizontal {
    padding: 20px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.etw-timeline-horizontal .etw-timeline-line-container {
    position: absolute;
    top: 26px;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 0;
}

.etw-timeline-horizontal .etw-timeline-line {
    width: 100%;
    height: 100%;
    background-color: #e2e8f0;
    position: relative;
    overflow: hidden;
    border-radius: 99px;
}

.etw-timeline-horizontal .etw-timeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background-color: #6366f1;
    border-radius: 99px;
    transition: width 0.4s ease;
}

.etw-timeline-horizontal .etw-timeline-items {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    position: relative;
    z-index: 1;
    min-width: max-content;
    padding: 0 20px;
}

.etw-timeline-horizontal .etw-timeline-item {
    flex: 0 0 220px;
    padding: 0 16px;
}

.etw-timeline-horizontal .etw-timeline-horizontal-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.etw-timeline-horizontal .etw-timeline-icon-column {
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.etw-timeline-horizontal .etw-timeline-content {
    text-align: center;
    width: 100%;
    margin-top: 0;
}

.etw-timeline-horizontal .etw-timeline-content .etw-timeline-label {
    display: block;
}

/* =====================================================
   SCROLL ANIMATIONS
   ===================================================== */
.etw-animate .etw-timeline-item {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.etw-animate.etw-vertical-left .etw-timeline-item,
.etw-animate.etw-vertical-center .etw-timeline-item {
    transform: translateX(-30px);
}

.etw-animate .etw-timeline-item.etw-in-view {
    opacity: 1;
    transform: translate(0, 0);
}

/* Stagger delay via nth-child */
.etw-animate .etw-timeline-item:nth-child(1) { transition-delay: 0.0s; }
.etw-animate .etw-timeline-item:nth-child(2) { transition-delay: 0.1s; }
.etw-animate .etw-timeline-item:nth-child(3) { transition-delay: 0.2s; }
.etw-animate .etw-timeline-item:nth-child(4) { transition-delay: 0.3s; }
.etw-animate .etw-timeline-item:nth-child(5) { transition-delay: 0.4s; }
.etw-animate .etw-timeline-item:nth-child(6) { transition-delay: 0.5s; }
.etw-animate .etw-timeline-item:nth-child(7) { transition-delay: 0.6s; }
.etw-animate .etw-timeline-item:nth-child(8) { transition-delay: 0.7s; }

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media ( max-width: 768px ) {
    /* Vertical: collapse to single column on mobile */
    .etw-timeline-vertical .etw-timeline-line-container {
        left: 26px;
        transform: none;
    }

    .etw-timeline-vertical .etw-timeline-content-wrap {
        grid-template-columns: auto 1fr !important;
    }

    .etw-timeline-vertical .etw-content-left  { display: none !important; }
    .etw-timeline-vertical .etw-content-right {
        display: flex !important;
        justify-content: flex-start !important;
    }

    .etw-has-arrow::before { display: none; }

    /* Horizontal: allow scroll on small screens */
    .etw-timeline-horizontal {
        overflow-x: auto;
    }

    .etw-timeline-horizontal .etw-timeline-item {
        flex: 0 0 180px;
    }
}

@media ( max-width: 480px ) {
    .etw-timeline-content {
        padding: 18px;
    }
    .etw-timeline-title {
        font-size: 15px;
    }
    .etw-timeline-description {
        font-size: 13px;
    }
    .etw-timeline-horizontal .etw-timeline-item {
        flex: 0 0 160px;
        padding: 0 10px;
    }
}
