/* General Body Styling */
body {
    font-family: 'Source Sans Pro', sans-serif;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
}

/* Main Wrapper */
#mainwrapper {
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

header #logo img {
    width: 80px;
    height: auto;
}

header nav a {
    text-decoration: none;
    color: #555;
    margin-left: 20px;
    font-weight: bold;
    transition: color 0.3s;
}

header nav a:hover {
    color: #007bff;
}

/* Content Area */
#content {
    display: flex;
    flex-wrap: wrap;
    flex-direction: row-reverse;
}

#mainContent {
    flex: 3;
    padding: 20px;
    position: relative; /* Added to establish positioning context for timeline */
}

#sidebar {
    flex: 1;
    padding: 20px;
    background-color: #f8f9fa;
    border-right: 1px solid #eee;
}

/* Hide notOnDesktop on larger screens */
@media screen and (min-width: 769px) {
    .notOnDesktop {
        display: none;
    }
}

/* Styling for desktop search form */
.search-form-desktop {
    display: flex;
    margin-bottom: 20px;
}

.search-form-desktop input[type="text"] {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
}

.search-form-desktop button {
    padding: 8px 15px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Styling for mobile search form */
.search-form-mobile {
    display: flex;
    padding: 10px 20px; /* Add padding for mobile form */
    background-color: #f8f9fa; /* Add a background */
}

.search-form-mobile input[type="text"] {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px 0 0 4px;
}

.search-form-mobile button {
    padding: 8px 15px;
    border: 1px solid #007bff;
    background-color: #007bff;
    color: white;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 100%; /* Changed to 100% to fill mainContent */
    margin: 0 auto;
    padding: 20px 0;
    clear: both; /* Added to clear floats and prevent overlap */
}

.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: #007bff;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
}

.timeline-item {
    padding: 10px 0px; /* Adjusted padding */
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    background-color: white;
    border: 4px solid #007bff;
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
    padding-right: 90px; /* Space for the right-side content */
}

.right {
    left: 50%;
    padding-left: 90px; /* Space for the left-side content */
}

.left::before { /* Arrow for left item */
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px; /* Positioned to the right of the left item */
    border: medium solid white;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

.right::before { /* Arrow for right item */
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px; /* Positioned to the left of the right item */
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

.left::after { /* Dot for left item */
    right: -17px;
    left: auto; /* Ensure it's not affected by left: 30px from .timeline-item::after */
}

.right::after { /* Dot for right item */
    left: -16px; /* Positioned on the left side of the right item */
}

.timeline-content {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
}

/* Responsive adjustments for sidebar and timeline */
@media screen and (max-width: 768px) {
    .notOnDesktop { /* Show mobile search form */
        display: block;
    }
    .search-form-desktop { /* Hide desktop search form */
        display: none;
    }
    #content {
        flex-direction: column;
    }
    #sidebar {
        border-right: none;
        border-top: 1px solid #eee;
    }

    .timeline::after { /* Timeline axis for small screens */
        left: 31px;
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px; /* Space for the line and dot */
        padding-right: 25px;
    }
    .timeline-item::before { /* Arrow for small screens */
        left: 60px;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }
    .left::after, .right::after { /* Dot for small screens */
        left: 15px;
        right: auto;
    }
    .right { /* Ensure all items are on one side for small screens */
        left: 0%;
        padding-left: 70px;
    }
}

.timeline-content h2 {
    margin-top: 0;
    font-size: 24px;
    color: #007bff;
}

.timeline-content p {
    margin-bottom: 0;
}

.timeline-image {
    flex-shrink: 0;
    width: 128px;
    height: 128px;
    object-fit: cover;
    border-radius: 6px;
}

/* Footer */
footer {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background-color: #343a40;
    color: #fff;
}

footer article {
    flex: 1;
    padding: 0 20px;
}

#footerbar {
    text-align: center;
    padding: 10px;
    background-color: #212529;
    color: #fff;
}

/* Responsive */
@media screen and (max-width: 768px) {
    #content {
        flex-direction: column;
    }
    #sidebar {
        border-left: none;
        border-top: 1px solid #eee;
    }
    .timeline::before {
        left: 20px;
    }
    .timeline-item::after {
        left: 8px;
    }
}
