/* ===================================================
   timeline.css - HORIZONTAL TIMELINE VIEW (CLEAN CODE)
   =================================================== */

/* 1. Tombol Pemicu Timeline */
.timeline-btn {
    background: #8e44ad;
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 3px 6px rgba(0,0,0,0.15);
}

.timeline-btn:hover {
    background: #9b59b6;
    transform: translateY(-1px);
}

/* 2. Layar Modal Fullscreen / Luas */
.timeline-modal-content {
    max-width: 95vw !important;
    width: 95vw !important;
    height: 90vh !important;
    max-height: 90vh !important;
    display: flex;
    flex-direction: column;
    padding: 20px !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    flex-shrink: 0;
}

.timeline-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #2c3e50;
}

.close-timeline-btn {
    background: #e74c3c;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: bold;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 3. Filter Bar: Kategori, Sub-Kategori, & Rentang Waktu */
.timeline-filter {
    margin: 12px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 12px;
    flex-shrink: 0;
}

.timeline-filter .filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-filter select {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 12px;
    outline: none;
}

/* 4. Canvas Scroll Timeline */
.timeline-scroll-container {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    padding: 80px 30px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 5px;
    border: 1px solid #e2e8f0;
}

.timeline-line-wrapper {
    position: relative;
    min-width: 1400px;
    height: 100%;
    display: flex;
    align-items: center;
}

/* Garis Utama Horizontal */
.timeline-main-line {
    position: absolute;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    top: 50%;
    transform: translateY(-50%);
    border-radius: 3px;
    z-index: 1;
}

.timeline-events-container {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* 5. Titik Kegiatan (Node) */
.timeline-node {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 4px solid #3498db;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.timeline-node:hover {
    transform: translate(-50%, -50%) scale(1.4);
    z-index: 10;
}

.timeline-node.completed {
    border-color: #2ecc71;
    background: #2ecc71;
}

/* 6. Kartu Detail Tugas (Atas / Bawah Garis) */
.timeline-card {
    position: absolute;
    width: 160px;
    background: white;
    padding: 8px 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    font-size: 11px;
    text-align: left;
    border-left: 4px solid #3498db;
}

.timeline-card.top {
    bottom: 58%;
    transform: translateX(-50%);
}

.timeline-card.bottom {
    top: 58%;
    transform: translateX(-50%);
}

.timeline-card .date-tag {
    font-size: 9px;
    color: #7f8c8d;
    font-weight: bold;
}

.timeline-card .title-tag {
    font-weight: 600;
    color: #2c3e50;
    margin: 3px 0;
    display: -webkit-box;
    display: box;
    -webkit-line-clamp: 2;
    line-clamp: 2; /* Menghilangkan warning VS Code */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 7. Tombol Aksi Kategori di Modal Edit/Tambah */
.kat-action-btns {
    display: flex;
    gap: 4px;
}

.btn-kat-act {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    padding: 4px 8px;
    font-size: 11px;
    transition: 0.2s;
}

.btn-kat-act:hover {
    background: #eee;
}

/* Layer standar modal timeline diatur di level bawah */
#timelineModal {
    z-index: 1000 !important;
}

/* Layer modal edit & form aksi diatur di level paling atas (di depan timeline) */
#editTaskModal,
#addTaskModal,
#moveTaskModal,
#jurnalModal,
#mediaLightbox {
    z-index: 2000 !important;
}

/* ===================================================
   timeline.css - STATUS VISUAL & SEARCH HIGHLIGHT
   =================================================== */

/* TAMPILAN ELEMEN SELSEAI (SUDAH DICEKLIS) */
.timeline-node.completed {
    background-color: #2ecc71 !important;
    border-color: #27ae60 !important;
    box-shadow: 0 0 6px rgba(46, 204, 113, 0.6);
}

.timeline-card.completed-card {
    background: #f0fff4 !important;
    border-left-color: #2ecc71 !important;
    opacity: 0.85;
}

.timeline-card.completed-card .title-tag {
    text-decoration: line-through;
    color: #7f8c8d !important;
}

/* TAMPILAN ELEMEN BELUM SELESAI */
.timeline-node.pending {
    background-color: #ffffff !important;
}

.timeline-card.pending-card {
    background: #ffffff !important;
}

/* ANIMASI SOROTAN SAAT DIKLIK DARI SEARCH SUGGESTION */
@keyframes timelinePulse {
    0% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.7);
    }
    50% {
        transform: translateX(-50%) scale(1.6);
        box-shadow: 0 0 0 15px rgba(52, 152, 219, 0);
    }
    100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

.timeline-node.highlight-node {
    animation: timelinePulse 1.2s ease-in-out infinite;
    z-index: 100 !important;
}

.timeline-card.highlight-card {
    border: 2px solid #3498db !important;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.5) !important;
    z-index: 100 !important;
}


/* 8. Media Query Layar HP */
@media (max-width: 915px) {
    .timeline-btn {
        padding: 4px 10px !important;
        font-size: 10px !important;
    }
    
    .timeline-filter {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}