body {
    font-family: sans-serif;
    margin: 0;
    padding: 2em;
}

.header-container {
    position: static;
    background-color: white;
    padding-bottom: 10px;
    border-bottom: 2px solid #ddd;
    margin-bottom: 20px;
}

.chart-section {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 20px auto;
    padding: 10px;
}

.chart-container {
    width: 400px;
    height: 400px;
}

#chart-legend {
    margin-left: 40px;
    font-size: 18px;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

h1 {
    font-size: 1.5rem;
    padding: 0 10px;
}

@media (max-width: 768px) {
    body {
        padding: 1em;
    }

    .chart-section {
        flex-direction: column;
        margin: 10px auto;
    }

    .chart-container {
        width: 300px;
        height: 300px;
    }

    #chart-legend {
        margin-left: 0;
        margin-top: 20px;
        font-size: 14px;
    }

    th, td {
        padding: 6px;
        font-size: 12px;
    }

    .popup-content {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
        overflow-y: auto;
        padding: 20px;
    }

    #full-brief-text {
        white-space: pre-wrap; /* Enable text wrapping */
        word-wrap: break-word;
    }
}

h1 {
    color: #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    max-width: 300px; /* Adjust as needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 20px; /* Make space for the arrow */
}

th.sortable::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    transition: transform 0.2s;
}

th.sortable.asc::after {
    border-top-color: #333; /* Up arrow */
    transform: translateY(-50%) rotate(180deg);
}

th.sortable.desc::after {
    border-bottom-color: #333; /* Down arrow */
    transform: translateY(-50%) rotate(0deg);
}


thead {
    background-color: #f2f2f2;
}

th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    max-width: 300px; /* Adjust as needed */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status specific row coloring */
.status-green {
    background-color: #d4edda; /* Light green */
}

.status-yellow {
    background-color: #fff3cd; /* Light yellow */
}

.status-red {
    background-color: #f8d7da; /* Light red */
}

.status-grey {
    background-color: #e2e6ea; /* Light grey for Registered */
}

.status-violet {
    background-color: #e6e6fa; /* Light violet for Reopen */
}

.status-default-grey {
    background-color: #adb5bd; /* Default light grey for unspecified statuses */
}

.popup {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 3000; /* Sit on top of everything */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
}

.popup-content {
    background-color: #fefefe;
    margin: 15% auto; /* 15% from the top and centered */
    padding: 20px;
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}

#full-brief-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

.close-button {
    color: white;
    position: fixed; /* Fixed relative to the viewport */
    top: 20px;
    right: 20px;
    z-index: 4000; /* Above the popup (3000) */
    font-size: 35px;
    font-weight: bold;
    background-color: rgba(0,0,0,0.5);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
}

.close-button:hover {
    background-color: rgba(0,0,0,0.8);
}
