/**
 * M2Lab Horizontal Timeline Stylesheet
 * 
 * Premium visual styling, interactive hover states, micro-animations,
 * responsive design tokens, and CSS variables integration.
 * 
 * @package M2LabBricksAddons
 */

/* Default Design Tokens (Fallback values, can be overridden by Bricks CSS properties) */
.m2lab-timeline-wrapper {
    --m2lab-timeline-line-bg: #e2e8f0;
    --m2lab-timeline-line-active: #cbd5e1;
    --m2lab-timeline-line-thickness: 4px;
    --m2lab-timeline-marker-size: 44px;
    --m2lab-timeline-marker-bg: #0f172a;
    --m2lab-timeline-marker-color: #ffffff;
    --m2lab-timeline-marker-active-bg: #facc15;
    --m2lab-timeline-marker-active-color: #0f172a;
    --m2lab-timeline-card-bg: #ffffff;
    --m2lab-timeline-card-radius: 12px;
    --m2lab-timeline-card-year-color: #1e3a8a;
    --m2lab-timeline-card-desc-color: #475569;
    
    position: relative;
    width: 100%;
    margin: 40px 0;
    font-family: inherit;
    overflow: hidden;
}

/* -----------------------------------------
   1. TIMELINE NAVIGATION BAR (TOP SLIDER)
----------------------------------------- */
.m2lab-timeline-navigation {
    position: relative;
    width: 100%;
    padding: 60px 0 30px 0; /* Room for date text above markers */
    overflow: visible !important; /* Allow active scaling without clipping */
}

/* Continuous Horizontal Line Background & Progress */
.m2lab-timeline-progress-line-container {
    position: absolute;
    bottom: calc(30px + (var(--m2lab-timeline-marker-size) / 2));
    left: 0;
    right: 0;
    height: var(--m2lab-timeline-line-thickness);
    transform: translateY(50%);
    z-index: 1;
    pointer-events: none;
}

.m2lab-timeline-progress-line-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--m2lab-timeline-line-bg);
    border-radius: 4px;
}

.m2lab-timeline-progress-line-fill {
    display: none !important;
}

/* Navigation Items (Swiper Slides) */
.m2lab-timeline-items{
    padding-bottom: 24px;
    box-sizing: content-box;
}
.m2lab-timeline-nav-item {
    text-align: center;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.3s ease;
}

.m2lab-timeline-marker-wrapper {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
}

/* Date / Milestone Typography */
.m2lab-timeline-card-date-wrapper {
    position: absolute;
    bottom: calc(var(--m2lab-timeline-marker-size) + 12px);
    width: max-content;
    white-space: nowrap;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.m2lab-timeline-card-date {
    font-size: 14px;
    font-weight: 700;
    color: #64748b;
    background-color: #f8fafc;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
}

/* Circle Marker & Icons */
.m2lab-timeline-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--m2lab-timeline-marker-size);
    height: var(--m2lab-timeline-marker-size);
    background-color: var(--m2lab-timeline-marker-bg);
    color: var(--m2lab-timeline-marker-color);
    border-radius: 50%;
    border: 3px solid #ffffff;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 3;
}

.m2lab-timeline-marker .m2lab-icon {
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.m2lab-timeline-marker .m2lab-icon i,
.m2lab-timeline-marker .m2lab-icon svg {
    width: 16px;
    height: 16px;
    font-size: 16px;
    fill: currentColor;
    color: currentColor;
    display: block;
}

.m2lab-timeline-marker .m2lab-bullet {
    width: 10px;
    height: 10px;
    background-color: currentColor;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

/* -----------------------------------------
   2. HOVER AND ACTIVE NAV STATES
----------------------------------------- */
/* Hover State */
.m2lab-timeline-nav-item:hover .m2lab-timeline-marker {
    transform: scale(1.12);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.m2lab-timeline-nav-item:hover .m2lab-timeline-card-date {
    color: #0f172a;
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* Active State (Synchronized Slide) */
/*.m2lab-timeline-nav-item.swiper-slide-active .m2lab-timeline-marker {*/
/*    background-color: var(--m2lab-timeline-marker-active-bg);*/
/*    color: var(--m2lab-timeline-marker-active-color);*/
/*    transform: scale(1.22);*/
/*    border-color: #ffffff;*/
/*}*/
 
/*.m2lab-timeline-nav-item.swiper-slide-active .m2lab-timeline-marker .m2lab-icon {*/
/*    transform: scale(1.1);*/
/*}*/
 
/*.m2lab-timeline-nav-item.swiper-slide-active .m2lab-timeline-card-date {*/
/*    color: var(--m2lab-timeline-marker-active-color);*/
/*    background-color: var(--m2lab-timeline-marker-active-bg);*/
/*    border-color: var(--m2lab-timeline-marker-active-bg);*/
/*}*/

/* Navigation Arrow Controls styling */
.m2lab-timeline-navigation .swiper-button {
    position: absolute;
    bottom: calc(30px + (var(--m2lab-timeline-marker-size) / 2));
    top: auto;
    transform: translateY(50%);
    width: 36px;
    height: 36px;
    background-color: #e2e8f0;
    border: none;
    color: #0f172a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
 
.m2lab-timeline-navigation .swiper-button::after {
    font-size: 14px;
    font-weight: 700;
}

.m2lab-timeline-navigation .swiper-button i,
.m2lab-timeline-navigation .swiper-button svg {
    width: 16px;
    height: 16px;
    font-size: 16px;
    fill: currentColor;
    color: currentColor;
    display: block;
    transition: transform 0.2s ease;
}
 
.m2lab-timeline-navigation .swiper-button:hover {
    background-color: var(--m2lab-timeline-marker-active-bg);
    border-color: var(--m2lab-timeline-marker-active-bg);
    color: var(--m2lab-timeline-marker-active-color);
    box-shadow: 0 4px 6px rgba(250, 204, 21, 0.2);
}
 
.m2lab-timeline-navigation .m2lab-arrow-left {
    left: 10px;
}
 
.m2lab-timeline-navigation .m2lab-arrow-right {
    right: 10px;
}

.m2lab-timeline-navigation .swiper-button.m2lab-arrow-hidden {
    opacity: 0;
    pointer-events: none;
}

/* -----------------------------------------
   3. TIMELINE CONTENT CARDS (BOTTOM SLIDER)
----------------------------------------- */
.m2lab-timeline-content {
    width: 100%;
    overflow: hidden;
}

.m2lab-timeline-item {
    box-sizing: border-box;
    padding: 0 15px;
    transition: opacity 0.4s ease;
}

/* Inactive slide cards are fully opaque at all times */
.m2lab-timeline-content .swiper-slide:not(.swiper-slide-active) {
    opacity: 1;
}

.m2lab-timeline-card-wrapper {
    position: relative;
    padding-top: 15px; /* Spacing for the arrow pointer */
}

/* Premium Timeline Card Core Styling */
.m2lab-timeline-card {
    position: relative;
    background-color: var(--m2lab-timeline-card-bg, #ffffff);
    border: 1px solid #e2e8f0;
    border-radius: var(--m2lab-timeline-card-radius, 12px);
    padding: 24px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.01);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    display: flex;
    flex-direction: column;
}

.m2lab-timeline-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border-color: #cbd5e1;
}

/* Framed Top Image */
.m2lab-timeline-card-image-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8fafc;
}

.m2lab-timeline-card-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.m2lab-timeline-card:hover .m2lab-timeline-card-image {
    transform: scale(1.04);
}

/* Triangle Pointer pointing upwards to marker */
.m2lab-timeline-arrow {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 16px;
    height: 16px;
    background-color: var(--m2lab-timeline-card-bg, #ffffff);
    border-left: 1px solid #e2e8f0;
    border-top: 1px solid #e2e8f0;
    z-index: 1;
    transition: border-color 0.3s ease;
}

.m2lab-timeline-card:hover .m2lab-timeline-arrow {
    border-color: #cbd5e1;
}

/* Milestone Year typography below image */
.m2lab-timeline-card-year {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 22px;
    font-weight: 700;
    color: var(--m2lab-timeline-card-year-color, #1e3a8a);
    transition: color 0.3s ease;
    line-height: 1.2;
}

/* Description Text typography */
.m2lab-timeline-card-desc {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--m2lab-timeline-card-desc-color, #475569);
    transition: color 0.3s ease;
}

/* -----------------------------------------
   4. RESPONSIVE MEDIA QUERIES
----------------------------------------- */
@media (max-width: 768px) {
    .m2lab-timeline-wrapper {
        margin: 20px 0;
    }
    
    .m2lab-timeline-navigation {
        padding: 50px 0 25px 0;
    }
    
    .m2lab-timeline-card {
        padding: 20px;
    }

    .m2lab-timeline-card-year {
        font-size: 18px;
    }

    .m2lab-timeline-card-desc {
        font-size: 13px;
    }
}
