/**
 * Emargy Enhanced Timeline Showcase Widget Styles
 * Created to match the professional design seen in the reference image
 */

/* Main Container */
.emargy-timeline-container {
    position: relative;
    width: 100%;
    padding: 60px 0;
    overflow: hidden;
    background-color: #e22d4b;
}

/* Items Wrapper */
.emargy-timeline-items-wrapper {
    position: relative;
    margin: 0 auto;
    width: 95%;
    overflow: hidden;
}

/* Timeline Items */
.emargy-timeline-items {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    min-height: 280px;
    transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Individual Timeline Item */
.emargy-timeline-item {
    position: relative;
    min-width: 160px;
    margin-right: 30px;
    z-index: 2;
    cursor: pointer;
    transition: all 0.4s ease;
}

.emargy-timeline-item-inner {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Timeline Item Thumbnail */
.emargy-timeline-thumbnail {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
}

.emargy-timeline-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.emargy-timeline-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
}

.emargy-no-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
}

/* Play Button */
.emargy-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

.emargy-play-button i {
    color: #fff;
    font-size: 18px;
}

.emargy-play-button::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* Timeline Content */
.emargy-timeline-content {
    padding: 15px;
    color: #fff;
}

.emargy-timeline-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    letter-spacing: 0.5px;
}

.emargy-timeline-excerpt {
    font-size: 14px;
    margin-top: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    opacity: 0.9;
    line-height: 1.4;
}

/* Timeline Number */
.emargy-timeline-number {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

/* Center Item Styles */
.emargy-timeline-center-item {
    z-index: 5;
}

.emargy-timeline-center-item .emargy-timeline-item-inner {
    transform: scale(2); /* Double the size */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.emargy-timeline-center-item .emargy-play-button {
    width: 70px;
    height: 70px;
    background-color: rgba(255, 255, 255, 0.3);
}

.emargy-timeline-center-item .emargy-play-button i {
    font-size: 24px;
}

.emargy-timeline-center-item .emargy-timeline-title {
    font-size: 18px;
}

.emargy-timeline-center-item .emargy-timeline-thumbnail img {
    transform: scale(1.05);
}

/* Hover Effects */
.emargy-hover-enabled .emargy-timeline-item:hover .emargy-timeline-item-inner {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

.emargy-hover-enabled .emargy-timeline-center-item:hover .emargy-timeline-item-inner {
    transform: scale(2.2) translateY(-5px);
}

.emargy-hover-enabled .emargy-timeline-item:hover .emargy-play-button {
    background-color: rgba(255, 255, 255, 0.4);
}

.emargy-hover-enabled .emargy-timeline-item:not(.emargy-timeline-center-item):hover .emargy-timeline-thumbnail img {
    transform: scale(1.1);
}

/* Timeline Line */
.emargy-timeline-line {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.4);
    z-index: 1;
}

/* Soundwave Style */
.emargy-timeline-wave {
    height: 30px;
    position: relative;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%,
                               rgba(255, 255, 255, 0.4) 20%,
                               rgba(255, 255, 255, 0.4) 50%,
                               rgba(255, 255, 255, 0.4) 80%,
                               rgba(255, 255, 255, 0) 100%);
    overflow: hidden;
}

.emargy-timeline-wave::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        to right,
        transparent,
        transparent 3px,
        rgba(255, 255, 255, 0.5) 3px,
        rgba(255, 255, 255, 0.5) 4px
    );
    opacity: 0.4;
}

.emargy-timeline-wave::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%);
}

/* Special soundwave display for the items */
.emargy-timeline-style-wave .emargy-timeline-items {
    margin-bottom: 50px;
}

.emargy-timeline-style-wave .emargy-timeline-item:nth-child(odd) {
    margin-top: -30px;
}

.emargy-timeline-style-wave .emargy-timeline-item:nth-child(even) {
    margin-top: 30px;
}

.emargy-timeline-style-wave .emargy-timeline-center-item {
    margin-top: 0 !important;
}

/* Navigation Arrows */
.emargy-timeline-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.emargy-timeline-nav:hover {
    background-color: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.emargy-nav-prev {
    left: 25px;
}

.emargy-nav-next {
    right: 25px;
}

.emargy-timeline-nav i {
    color: #fff;
    font-size: 20px;
}

/* Indicator Dots */
.emargy-timeline-indicators {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.emargy-timeline-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    margin: 0 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.emargy-timeline-indicator.active {
    background-color: #fff;
    transform: scale(1.2);
}

/* Video Modal */
.emargy-video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.emargy-video-modal-inner {
    position: relative;
    width: 80%;
    max-width: 900px;
}

.emargy-video-modal-content {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    background-color: #000;
}

.emargy-video-modal-content iframe,
.emargy-video-modal-content video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.emargy-video-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    width: 30px;
    height: 30px;
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.emargy-video-modal-title {
    color: #fff;
    font-size: 20px;
    margin: 0 0 20px;
    text-align: center;
}

/* Responsive Adjustments */
@media screen and (max-width: 1200px) {
    .emargy-timeline-center-item .emargy-timeline-item-inner {
        transform: scale(1.8);
    }
    
    .emargy-hover-enabled .emargy-timeline-center-item:hover .emargy-timeline-item-inner {
        transform: scale(1.8) translateY(-5px);
    }
    
    .emargy-timeline-item {
        min-width: 140px;
        margin-right: 25px;
    }
}

@media screen and (max-width: 1024px) {
    .emargy-timeline-center-item .emargy-timeline-item-inner {
        transform: scale(1.5);
    }
    
    .emargy-hover-enabled .emargy-timeline-center-item:hover .emargy-timeline-item-inner {
        transform: scale(1.5) translateY(-5px);
    }
    
    .emargy-timeline-item {
        min-width: 120px;
        margin-right: 20px;
    }
}

@media screen and (max-width: 767px) {
    .emargy-timeline-container {
        padding: 40px 0;
    }
    
    .emargy-timeline-center-item .emargy-timeline-item-inner {
        transform: scale(1.3);
    }
    
    .emargy-hover-enabled .emargy-timeline-center-item:hover .emargy-timeline-item-inner {
        transform: scale(1.3) translateY(-5px);
    }
    
    .emargy-timeline-item {
        min-width: 100px;
        margin-right: 15px;
    }
    
    .emargy-timeline-nav {
        width: 40px;
        height: 40px;
    }
    
    .emargy-timeline-nav i {
        font-size: 16px;
    }
    
    .emargy-nav-prev {
        left: 15px;
    }
    
    .emargy-nav-next {
        right: 15px;
    }
    
    .emargy-play-button {
        width: 40px;
        height: 40px;
    }
    
    .emargy-timeline-center-item .emargy-play-button {
        width: 50px;
        height: 50px;
    }
}

@media screen and (max-width: 480px) {
    .emargy-timeline-container {
        padding: 30px 0;
    }
    
    .emargy-timeline-items-wrapper {
        width: 85%;
    }
    
    .emargy-timeline-center-item .emargy-timeline-item-inner {
        transform: scale(1.2);
    }
    
    .emargy-hover-enabled .emargy-timeline-center-item:hover .emargy-timeline-item-inner {
        transform: scale(1.2) translateY(-5px);
    }
    
    .emargy-timeline-item {
        min-width: 80px;
        margin-right: 12px;
    }
    
    .emargy-timeline-title {
        font-size: 12px;
    }
    
    .emargy-timeline-center-item .emargy-timeline-title {
        font-size: 14px;
    }
    
    .emargy-timeline-number {
        font-size: 12px;
    }
}