/* =========================================
   Timeline / Chronology System
   ========================================= */

.dpfp-timeline-page {
    background: #fcfcfc;
    min-height: 100vh;
}

/* --- Hero Section --- */
.timeline-hero {
    background: linear-gradient(135deg, var(--dpfp-blue) 0%, #1a3c6e 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.timeline-hero .icon-wrapper {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.timeline-hero .hero-title {
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: 0.05em;
}

.timeline-hero .hero-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    margin-bottom: 30px;
}

.timeline-submission-cta .submit-term-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--dpfp-yellow);
    color: #333;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.timeline-submission-cta .submit-term-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: #ffc107;
}

/* --- Navigation (Year Tabs) --- */
.timeline-nav-wrapper {
    position: sticky;
    top: 60px;
    /* Adjust based on header height */
    z-index: 99;
    background: rgba(252, 252, 252, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 15px 0;
    margin-bottom: 40px;
}

.timeline-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.year-tab {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 700;
    color: #666;
    background: #fff;
    border: 1px solid #eee;
    transition: all 0.3s;
    font-family: 'Montserrat', sans-serif;
    /* or number font */
}

.year-tab:hover,
.year-tab.active {
    background: var(--dpfp-blue);
    color: #fff;
    border-color: var(--dpfp-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(4, 62, 128, 0.2);
}

/* --- Vertical Timeline --- */
.timeline-container {
    max-width: 800px;
    /* Narrower for timeline focus */
    margin: 0 auto;
    position: relative;
    padding-bottom: 100px;
}

/* The vertical line */
.timeline-container::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 4px;
    background: #e9ecef;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* Year Marker */
.timeline-year-marker {
    text-align: center;
    margin: 40px 0;
    position: relative;
    z-index: 2;
}

.year-label {
    display: inline-block;
    background: var(--dpfp-blue);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 900;
    padding: 10px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border: 4px solid #fcfcfc;
    /* gap effect */
}

/* Timeline Item (Card) */
.timeline-item {
    position: relative;
    margin-bottom: 40px;
    width: 50%;
    padding: 0 40px;
    box-sizing: border-box;
}

/* Left/Right alternation */
.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

/* Dot on the line */
.timeline-dot {
    position: absolute;
    top: 25px;
    /* Adjust to align with date/title */
    width: 20px;
    height: 20px;
    background: #fff;
    border: 4px solid var(--dpfp-blue);
    border-radius: 50%;
    z-index: 3;
    transition: transform 0.3s;
}

.timeline-item:nth-child(odd) .timeline-dot {
    right: -12px;
    /* Half of dot width + border fix */
}

.timeline-item:nth-child(even) .timeline-dot {
    left: -12px;
}

.timeline-item:hover .timeline-dot {
    transform: scale(1.3);
    background: var(--dpfp-yellow);
    border-color: var(--dpfp-yellow);
}

/* Content Card */
.timeline-content {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Arrow */
.timeline-content::after {
    content: '';
    position: absolute;
    top: 28px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.timeline-item:nth-child(odd) .timeline-content::after {
    right: -20px;
    border-left-color: #fff;
    /* Pointing right */
}

.timeline-item:nth-child(even) .timeline-content::after {
    left: -20px;
    border-right-color: #fff;
    /* Pointing left */
}

/* Card Internals */
.event-date {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--dpfp-blue);
    background: #eef4fa;
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.event-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #333;
}

.event-desc {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
    /* Align right for odd? No, keep it consistent locally */
}

.timeline-item:nth-child(odd) .event-meta {
    justify-content: flex-end;
}

.timeline-item:nth-child(even) .event-meta {
    justify-content: flex-start;
}

.event-source-link {
    font-size: 0.85rem;
    color: #888;
    text-decoration: none;
    transition: color 0.3s;
}

.event-source-link:hover {
    color: var(--dpfp-blue);
}

.event-tags .tag {
    font-size: 0.75rem;
    background: #f0f2f5;
    color: #555;
    padding: 3px 8px;
    border-radius: 4px;
}

/* --- Mobile Responsive --- */
@media (max-width: 768px) {
    .timeline-container::before {
        left: 30px;
        /* Move line to left */
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        /* clear the line */
        padding-right: 20px;
        text-align: left !important;
        /* Force left align */
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-item:nth-child(odd) .timeline-dot,
    .timeline-item:nth-child(even) .timeline-dot {
        left: 21px;
        /* Center on the line (30px - 9pxish) */
        right: auto;
    }

    .timeline-item:nth-child(odd) .timeline-content::after,
    .timeline-item:nth-child(even) .timeline-content::after {
        left: -20px;
        right: auto;
        border-right-color: #fff;
        border-left-color: transparent;
    }

    .timeline-item:nth-child(even) .event-meta {
        justify-content: flex-start;
    }
}

/* Edit Request Icon */
.edit-request-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #ccc;
    font-size: 0.9rem;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    background: transparent;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

.edit-request-icon:hover {
    color: var(--dpfp-blue);
    background: #f0f2f5;
}

/* Adjust padding for card content to prevent overlap if title is long */
.timeline-content {
    background: #fff;
    padding: 25px;
    padding-right: 40px;
    /* Make space for the icon */
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid rgba(0, 0, 0, 0.02);
}

/* PC: Flip Edit Icon for Left Side Cards */
@media (min-width: 769px) {
    .timeline-item:nth-child(odd) .edit-request-icon {
        right: auto;
        left: 15px;
    }

    .timeline-item:nth-child(odd) .timeline-content {
        padding-right: 25px;
        padding-left: 40px;
    }
}