/* Modern Timeline Widget Styles */

.modern-timeline {
    position: relative;
    max-width: 100%;
    margin: 0 auto;
}

/* Timeline Line */
.timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 25px;
    width: 3px;
    z-index: 1;
}

.timeline-line::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #333333;
    border-radius: 2px;
}

/* Animated line reveal */
.timeline-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: inherit;
    border-radius: 2px;
    animation: timelineReveal 2s ease-out forwards;
    animation-delay: 0.5s;
}

@keyframes timelineReveal {
    to {
        height: 100%;
    }
}

/* Timeline Title */
.timeline-title {
    font-size: 20px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 15px 0;
    line-height: 1.3;
    font-family: 'Asty', sans-serif;
}

/* Timeline Text */
.timeline-text {
    font-size: 16px;
    line-height: 1.6;
    color: #666666;
    margin: 0;
}

/* WYSIWYG Content Formatting */
.timeline-text p {
    margin: 0 0 10px 0;
}

.timeline-text p:last-child {
    margin-bottom: 0;
}

.timeline-text strong {
    font-weight: 600;
    color: #333333;
}

.timeline-text em {
    font-style: italic;
}

.timeline-text ul,
.timeline-text ol {
    margin: 10px 0;
    padding-left: 20px;
}

.timeline-text li {
    margin-bottom: 5px;
    line-height: 1.5;
}

.timeline-text ul li {
    list-style-type: disc;
}

.timeline-text ol li {
    list-style-type: decimal;
}

.timeline-text a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s ease;
}

.timeline-text a:hover {
    color: #4c63d2;
    text-decoration: underline;
}

.timeline-text br {
    line-height: 1.6;
}

/* Timeline Items Container */
.timeline-items {
    position: relative;
    z-index: 2;
}

/* Timeline Item */
.timeline-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Icon Wrapper */
.timeline-icon-wrapper {
    position: relative;
    flex-shrink: 0;
    z-index: 3;
}

/* Timeline Icon */
.timeline-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 20px;
    box-shadow: 0 4px 20px rgba(51, 51, 51, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

.timeline-icon::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: #333333;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-item:hover .timeline-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.4);
}

.timeline-item:hover .timeline-icon::before {
    opacity: 1;
}

/* Timeline Content */
.timeline-content {
    flex: 1;
    margin-left: 30px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #333333;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.timeline-item:hover .timeline-content::before {
    opacity: 1;
}

/* Timeline Content Arrow */
.timeline-content::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 30px;
    width: 20px;
    height: 20px;
    background: inherit;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transform: rotate(45deg);
    backdrop-filter: blur(10px);
}

/* Timeline Image */
.timeline-image {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
}

.timeline-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.timeline-item:hover .timeline-image img {
    transform: scale(1.05);
}

/* Timeline Date */
.timeline-date {
    font-size: 14px;
    font-weight: 600;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    font-family: 'Asty', sans-serif;
}

/* Timeline Title */
.timeline-title {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 15px 0;
    line-height: 1.3;
    font-family: 'Asty', sans-serif;
}

/* Timeline Text */
.timeline-text {
    font-size: 16px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.timeline-text p {
    margin-bottom: 15px;
}

.timeline-text p:last-child {
    margin-bottom: 0;
}

/* Style Variations */

/* Minimal Style */
.timeline-style-minimal .timeline-content {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: none;
    box-shadow: none;
    padding: 20px;
}

.timeline-style-minimal .timeline-content::before,
.timeline-style-minimal .timeline-content::after {
    display: none;
}

.timeline-style-minimal .timeline-title {
    color: #333333;
}

.timeline-style-minimal .timeline-text {
    color: #666666;
}

.timeline-style-minimal .timeline-date {
    color: #999999;
}

/* Gradient Style */
.timeline-style-gradient .timeline-content {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.timeline-style-gradient .timeline-content::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
}

/* Neon Style */
.timeline-style-neon {
    filter: brightness(1.1);
}

.timeline-style-neon .timeline-content {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ffff;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
}

.timeline-style-neon .timeline-content::before {
    background: linear-gradient(90deg, #00ffff, #ff00ff);
}

.timeline-style-neon .timeline-icon {
    background: #0a0a0a;
    border: 2px solid #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
    color: #00ffff;
}

.timeline-style-neon .timeline-title {
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.timeline-style-neon .timeline-date {
    color: #ff00ff;
    text-shadow: 0 0 10px #ff00ff;
}

.timeline-style-neon .timeline-text {
    color: rgba(255, 255, 255, 0.9);
}

/* Glass Style */
.timeline-style-glass .timeline-content {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(31, 38, 135, 0.37),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.timeline-style-glass .timeline-content::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.2));
}

/* Layout Variations */

/* Horizontal Layout */
.timeline-layout-horizontal {
    display: flex;
    flex-direction: column;
}

.timeline-layout-horizontal .timeline-line {
    left: 0;
    right: 0;
    top: 25px;
    bottom: auto;
    width: auto;
    height: 3px;
}

.timeline-layout-horizontal .timeline-items {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}

.timeline-layout-horizontal .timeline-item {
    flex-direction: column;
    align-items: center;
    margin-bottom: 0;
    flex: 1;
    min-width: 250px;
}

.timeline-layout-horizontal .timeline-content {
    margin-left: 0;
    margin-top: 30px;
    width: 100%;
}

.timeline-layout-horizontal .timeline-content::after {
    left: 30px;
    top: -10px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    border-bottom: none;
    transform: rotate(-45deg);
}

/* Zigzag Layout */
.timeline-layout-zigzag {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    padding: 50px 0;
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.timeline-layout-zigzag .timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
    top: 50px;
    bottom: 50px;
    height: auto;
    width: 3px;
}

.timeline-layout-zigzag .timeline-line::before {
    background: #333333;
    height: 100%;
    position: absolute;
    top: 0;
    bottom: 0;
    content: '';
    left: 0;
    width: 100%;
    border-radius: 2px;
}

.timeline-layout-zigzag .timeline-line::after {
    background: #333333;
    height: 0%;
    animation: timelineReveal 2s ease-out forwards;
    animation-delay: 0.5s;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    content: '';
    border-radius: 2px;
}

.timeline-layout-zigzag .timeline-items {
    position: relative;
    z-index: 2;
    display: block;
    flex: 1;
}

/* Override default timeline item styles for zigzag */
.timeline-layout-zigzag .timeline-item {
    width: 100%;
    padding: 0;
    margin-bottom: 80px;
    position: relative;
    display: block !important; /* Override flex */
    align-items: unset !important;
}

.timeline-layout-zigzag .timeline-icon-wrapper {
    position: absolute;
    left: 50%;
    top: 30px;
    transform: translateX(-50%);
    z-index: 10;
    flex-shrink: unset;
}

/* Odd items (left side) */
.timeline-layout-zigzag .timeline-item:nth-child(odd) .timeline-content {
    width: calc(50% - 40px);
    margin-left: 0;
    margin-right: auto;
    position: relative;
    float: left;
    clear: both;
    flex: unset;
}

.timeline-layout-zigzag .timeline-item:nth-child(odd) .timeline-content::after {
    content: '';
    position: absolute;
    top: 30px;
    right: -20px;
    width: 0;
    height: 0;
    border: 20px solid transparent;
    border-left: 20px solid rgba(255, 255, 255, 0.95);
    z-index: 1;
}

/* Even items (right side) */
.timeline-layout-zigzag .timeline-item:nth-child(even) .timeline-content {
    width: calc(50% - 40px);
    margin-left: auto;
    margin-right: 0;
    position: relative;
    float: right;
    clear: both;
    flex: unset;
}

.timeline-layout-zigzag .timeline-item:nth-child(even) .timeline-content::after {
    content: '';
    position: absolute;
    top: 30px;
    left: -20px;
    width: 0;
    height: 0;
    border: 20px solid transparent;
    border-right: 20px solid rgba(255, 255, 255, 0.95);
    z-index: 1;
}

/* Clear floats after each item */
.timeline-layout-zigzag .timeline-item::after {
    content: '';
    display: table;
    clear: both;
}

/* Style-specific adjustments for zigzag */
.timeline-layout-zigzag.timeline-style-minimal .timeline-item:nth-child(odd) .timeline-content::after {
    border-left-color: rgba(255, 255, 255, 0.95);
}

.timeline-layout-zigzag.timeline-style-minimal .timeline-item:nth-child(even) .timeline-content::after {
    border-right-color: rgba(255, 255, 255, 0.95);
}

.timeline-layout-zigzag.timeline-style-neon .timeline-item:nth-child(odd) .timeline-content::after {
    border-left-color: rgba(0, 0, 0, 0.8);
}

.timeline-layout-zigzag.timeline-style-neon .timeline-item:nth-child(even) .timeline-content::after {
    border-right-color: rgba(0, 0, 0, 0.8);
}

.timeline-layout-zigzag.timeline-style-glass .timeline-item:nth-child(odd) .timeline-content::after {
    border-left-color: rgba(255, 255, 255, 0.25);
}

.timeline-layout-zigzag.timeline-style-glass .timeline-item:nth-child(even) .timeline-content::after {
    border-right-color: rgba(255, 255, 255, 0.25);
}

/* Animation Types */
.timeline-item[data-animation="fade_in"] {
    opacity: 0;
    transition: opacity 0.6s ease;
}

.timeline-item[data-animation="fade_in"].animated {
    opacity: 1;
}

.timeline-item[data-animation="slide_in_left"] {
    opacity: 0;
    transform: translateX(-50px);
}

.timeline-item[data-animation="slide_in_left"].animated {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item[data-animation="slide_in_right"] {
    opacity: 0;
    transform: translateX(50px);
}

.timeline-item[data-animation="slide_in_right"].animated {
    opacity: 1;
    transform: translateX(0);
}

.timeline-item[data-animation="scale_in"] {
    opacity: 0;
    transform: scale(0.8);
}

.timeline-item[data-animation="scale_in"].animated {
    opacity: 1;
    transform: scale(1);
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Reset zigzag to vertical layout on mobile */
    .timeline-layout-zigzag .timeline-item,
    .timeline-layout-zigzag .timeline-item:nth-child(even),
    .timeline-layout-zigzag .timeline-item:nth-child(odd) {
        display: flex !important;
        flex-direction: row;
        justify-content: flex-start;
        width: 100%;
        padding: 0;
        align-items: flex-start !important;
    }
    
    .timeline-layout-zigzag .timeline-content,
    .timeline-layout-zigzag .timeline-item:nth-child(even) .timeline-content,
    .timeline-layout-zigzag .timeline-item:nth-child(odd) .timeline-content {
        width: auto;
        margin-left: 30px;
        margin-right: 0;
        float: none;
        flex: 1;
    }
    
    .timeline-layout-zigzag .timeline-content::after,
    .timeline-layout-zigzag .timeline-item:nth-child(even) .timeline-content::after,
    .timeline-layout-zigzag .timeline-item:nth-child(odd) .timeline-content::after {
        content: '';
        position: absolute;
        top: 30px;
        left: -20px;
        right: auto;
        width: 0;
        height: 0;
        border: 20px solid transparent;
        border-right: 20px solid rgba(255, 255, 255, 0.95);
        border-left: none;
    }
    
    .timeline-layout-zigzag .timeline-line {
        left: 25px;
        transform: none;
    }
    
    .timeline-layout-zigzag .timeline-icon-wrapper {
        position: relative;
        left: auto;
        top: auto;
        transform: none;
        flex-shrink: 0;
    }
    
    .timeline-layout-horizontal .timeline-items {
        flex-direction: column;
    }
    
    .timeline-layout-horizontal .timeline-item {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .timeline-layout-horizontal .timeline-content {
        margin-top: 0;
        margin-left: 30px;
    }
    
    .timeline-layout-horizontal .timeline-line {
        left: 25px;
        right: auto;
        top: 0;
        bottom: 0;
        width: 3px;
        height: auto;
    }
    
    .timeline-content {
        padding: 20px;
        margin-left: 20px;
    }
    
    .timeline-title {
        font-size: 18px;
    }
    
    .timeline-text {
        font-size: 14px;
    }
    
    .timeline-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .timeline-line {
        left: 20px;
    }
}

@media (max-width: 480px) {
    .timeline-content {
        padding: 15px;
        margin-left: 15px;
    }
    
    .timeline-title {
        font-size: 16px;
    }
    
    .timeline-text {
        font-size: 13px;
    }
    
    .timeline-icon {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .timeline-line {
        left: 17px;
    }
}

/* Loading State */
.timeline-loading .timeline-item {
    opacity: 0.3;
    pointer-events: none;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .timeline-item,
    .timeline-icon,
    .timeline-content,
    .timeline-image img {
        transition: none;
        animation: none;
        transform: none;
    }
    
    .timeline-line::after {
        animation: none;
        height: 100%;
    }
    
    .timeline-item {
        opacity: 1;
        transform: none;
    }
}

/* Print Styles */
@media print {
    .timeline-item {
        opacity: 1;
        transform: none;
        break-inside: avoid;
        margin-bottom: 30px;
    }
    
    .timeline-content {
        box-shadow: none;
        border: 1px solid #ccc;
        background: #fff;
    }
    
    .timeline-title {
        color: #000 !important;
    }
    
    .timeline-text {
        color: #333 !important;
    }
}
