/* MSc Dissertation Timeline Styles */

.timeline-container {
    margin: 0;
    background: white;
    padding: 20px 20px 20px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: visible;
    width: fit-content;
}

.timeline-wrapper {
    display: grid;
    grid-template-columns: 200px 100px 200px 200px 200px 200px 200px;
    gap: 0;
    position: relative;
    width: max-content;
}

.timeline-wrapper::before {
    content: '';
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: white;
    z-index: 99;
    grid-column: 1 / -1;
    grid-row: 1;
    pointer-events: none;
}

.swimlane-header {
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    padding: 10px;
    position: sticky;
    top: 0;
    background: white;
    z-index: 200;
}

.swimlane-header.left-swimlane {
    color: #7ED321;
}

.swimlane-header.supervisor {
    color: #4A90E2;
}

.swimlane-header.committee {
    color: #F5A623;
}

.swimlane-header.admin {
    color: #BD10E0;
}

.swimlane-header.external {
    color: #50E3C2;
}

.swimlane-header.other {
    color: #D0021B;
}

.left-swimlane {
    padding: 20px 10px;
    text-align: right;
}

.timeline-center {
    position: relative;
    width: 100px;
    display: flex;
    justify-content: center;
}

.vertical-line {
    width: 3px;
    background-color: #ccc;
    position: absolute;
    top: 60px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.right-swimlanes {
    display: contents;
}

.right-swimlane {
    padding: 20px 10px;
}

.timeline-row {
    display: contents;
}

.time-point {
    display: flex;
    align-items: center;
    min-height: 80px;
    position: relative;
}

.time-point::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #ccc;
    z-index: 1;
}

.time-marker {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #555;
    border: 4px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    z-index: 100;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.time-label {
    position: absolute;
    top: calc(50% + 20px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9em;
    font-weight: bold;
    color: #666;
    white-space: normal;
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    width: 95px;
    text-align: center;
    z-index: 15;
}

.event-cell {
    display: flex;
    align-items: center;
    min-height: 80px;
    position: relative;
    padding: 10px;
    overflow: visible;
}

.event-cell.left-swimlane {
    z-index: 50;
}

.event-cell.right-swimlane.supervisor {
    z-index: 40;
}

.event-cell.right-swimlane.committee {
    z-index: 30;
}

.event-cell.right-swimlane.admin {
    z-index: 20;
}

.event-cell.right-swimlane.external {
    z-index: 10;
}

.event-cell.right-swimlane.other {
    z-index: 5;
}

.event-content {
    background: #f9f9f9;
    padding: 10px 15px;
    border-radius: 4px;
    border-left: 3px solid;
    position: relative;
    display: inline-block;
}

.left-swimlane .event-content {
    margin-left: auto;
    border-left: none;
    border-right: 3px solid;
}

.event-content::before {
    content: '';
    position: absolute;
    top: 50%;
    height: 2px;
    background-color: currentColor;
    transform: translateY(-50%);
}

.left-swimlane .event-content::before {
    display: none;
}

.event-cell.left-swimlane.student::after {
    content: '';
    position: absolute;
    left: 95%;
    width: 50px;
    top: 50%;
    height: 2px;
    background-color: #7ED321;
    transform: translateY(-50%);
}

.right-swimlane .event-content::before {
    display: none;
}

/* Connecting lines from right swimlanes to timeline */
.event-cell.right-swimlane.supervisor::after {
    content: '';
    position: absolute;
    right: 95%;
    width: 60px;
    top: 50%;
    height: 2px;
    background-color: #4A90E2;
    transform: translateY(-50%);
}

.event-cell.right-swimlane.committee::after {
    content: '';
    position: absolute;
    right: 95%;
    width: 260px;
    top: 50%;
    height: 2px;
    background-color: #F5A623;
    transform: translateY(-50%);
}

.event-cell.right-swimlane.admin::after {
    content: '';
    position: absolute;
    right: 95%;
    width: 460px;
    top: 50%;
    height: 2px;
    background-color: #BD10E0;
    transform: translateY(-50%);
}

.event-cell.right-swimlane.external::after {
    content: '';
    position: absolute;
    right: 95%;
    width: 660px;
    top: 50%;
    height: 2px;
    background-color: #50E3C2;
    transform: translateY(-50%);
}

.event-cell.right-swimlane.other::after {
    content: '';
    position: absolute;
    right: 95%;
    width: 860px;
    top: 50%;
    height: 2px;
    background-color: #D0021B;
    transform: translateY(-50%);
}

.event-date {
    font-size: 0.85em;
    color: #666;
    font-weight: bold;
    margin-bottom: 5px;
}

.event-title {
    font-size: 0.95em;
    color: #333;
}

/* Colour schemes for different roles */
.student .event-content {
    border-left-color: #7ED321;
    color: #7ED321;
}

.supervisor .event-content {
    border-left-color: #4A90E2;
    color: #4A90E2;
}

.committee .event-content {
    border-left-color: #F5A623;
    color: #F5A623;
}

.admin .event-content {
    border-left-color: #BD10E0;
    color: #BD10E0;
}

.external .event-content {
    border-left-color: #50E3C2;
    color: #50E3C2;
}

.other .event-content {
    border-left-color: #D0021B;
    color: #D0021B;
}

.event-content .event-date,
.event-content .event-title {
    color: #333;
}

/* Empty cell for alignment */
.empty-cell {
    min-height: 80px;
}
