/**
 * Timeline Component
 * Vertical timeline for news updates, events, and chronological content
 * 
 * Used in: News page, activity feeds
 * 
 * @package AcademicLegalWebsite
 * @version 1.0
 */

/* ============================================================================
   TIMELINE CONTAINER
   ========================================================================= */

.timeline {
    position: relative;
    padding: var(--space-xl) 0;
}

/* Vertical line connecting items */
.timeline::before {
    content: '';
    position: absolute;
    left: 2rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

/* Dark mode */
[data-theme="dark"] .timeline::before {
    background: var(--border-color);
    opacity: 0.3;
}

/* ============================================================================
   TIMELINE ITEM
   ========================================================================= */

.timeline-item {
    position: relative;
    padding-left: 5rem;
    padding-bottom: var(--space-2xl);
}

.timeline-item:last-child {
    padding-bottom: 0;
}

/* Date circle marker */
.timeline-marker {
    position: absolute;
    left: 1.125rem;
    top: 0.25rem;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--white);
    border: 3px solid var(--primary);
    border-radius: var(--radius-full);
    z-index: 2;
    transition: all var(--transition-normal);
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.15);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.1);
}

/* Dark mode marker */
[data-theme="dark"] .timeline-marker {
    background: var(--bg-dark);
    border-color: var(--accent);
}

/* ============================================================================
   TIMELINE DATE
   ========================================================================= */

.timeline-date {
    position: absolute;
    left: 0;
    top: 0;
    width: 4rem;
    text-align: center;
    font-family: var(--font-sans);
}

.timeline-date-month {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.05em;
}

.timeline-date-day {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.timeline-date-year {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
}

/* Dark mode dates */
[data-theme="dark"] .timeline-date-month {
    color: var(--accent);
}

/* ============================================================================
   TIMELINE CONTENT
   ========================================================================= */

.timeline-content {
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}

.timeline-item:hover .timeline-content {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateX(2px);
}

/* Dark mode content */
[data-theme="dark"] .timeline-content {
    background: var(--card-dark);
    border-color: var(--border-color);
}

[data-theme="dark"] .timeline-item:hover .timeline-content {
    border-color: var(--accent);
}

/* ============================================================================
   TIMELINE TYPE BADGE
   ========================================================================= */

.timeline-type {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-sm);
}

/* Type-specific colors */
.timeline-type-publication {
    background: rgba(26, 35, 126, 0.1);
    color: var(--primary);
}

.timeline-type-presentation {
    background: rgba(0, 137, 123, 0.1);
    color: #00897b;
}

.timeline-type-award {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent);
}

.timeline-type-media {
    background: rgba(106, 27, 154, 0.1);
    color: #6a1b9a;
}

.timeline-type-event {
    background: rgba(245, 124, 0, 0.1);
    color: #f57c00;
}

.timeline-type-announcement {
    background: rgba(97, 97, 97, 0.1);
    color: #616161;
}

/* Dark mode badges */
[data-theme="dark"] .timeline-type-publication {
    background: rgba(26, 35, 126, 0.2);
    color: #7c90ff;
}

[data-theme="dark"] .timeline-type-presentation {
    background: rgba(0, 137, 123, 0.2);
    color: #4db6ac;
}

[data-theme="dark"] .timeline-type-award {
    background: rgba(212, 175, 55, 0.2);
    color: var(--accent);
}

[data-theme="dark"] .timeline-type-media {
    background: rgba(106, 27, 154, 0.2);
    color: #ba68c8;
}

[data-theme="dark"] .timeline-type-event {
    background: rgba(245, 124, 0, 0.2);
    color: #ffb74d;
}

[data-theme="dark"] .timeline-type-announcement {
    background: rgba(97, 97, 97, 0.2);
    color: #bdbdbd;
}

/* ============================================================================
   TIMELINE TITLE
   ========================================================================= */

.timeline-title {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    line-height: 1.4;
}

.timeline-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.timeline-title a:hover {
    color: var(--primary);
}

[data-theme="dark"] .timeline-title a:hover {
    color: var(--accent);
}

/* ============================================================================
   TIMELINE DESCRIPTION
   ========================================================================= */

.timeline-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

/* ============================================================================
   TIMELINE LINK
   ========================================================================= */

.timeline-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.timeline-link:hover {
    color: var(--accent);
    gap: 0.75rem;
}

.timeline-link svg {
    width: 1rem;
    height: 1rem;
}

/* External link icon */
.timeline-link-external::after {
    content: '↗';
    font-size: 1rem;
    opacity: 0.6;
}

[data-theme="dark"] .timeline-link {
    color: var(--accent);
}

[data-theme="dark"] .timeline-link:hover {
    color: #fff;
}

/* ============================================================================
   RESPONSIVE DESIGN
   ========================================================================= */

/* Mobile: Stack dates above content */
@media (max-width: 767px) {
    .timeline::before {
        left: 0.75rem;
    }
    
    .timeline-item {
        padding-left: 3rem;
    }
    
    .timeline-marker {
        left: 0.375rem;
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .timeline-date {
        position: static;
        width: auto;
        text-align: left;
        margin-bottom: var(--space-sm);
        padding-left: 3rem;
    }
    
    .timeline-date-month,
    .timeline-date-day,
    .timeline-date-year {
        display: inline;
        font-size: 0.875rem;
    }
    
    .timeline-date-day {
        margin: 0 0.25rem;
    }
}

/* Tablet and up */
@media (min-width: 768px) {
    .timeline {
        padding-left: var(--space-xl);
    }
}