* {
    box-sizing: border-box;
}

#taskName, #projectName, #startButton, #openNoteButton, .running-task, .stopButton, .startButton, #noteSelector, .date-range input[type="date"],
.autocomplete-list, #completedTasks table, #completedTasks th, #completedTasks td, #taskFilter {
    border-color: rgb(118, 118, 118);
    font-size: var(--joplin-font-size);
}

body {
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
}

#timeTracker {
    font-family: Avenir, Arial, sans-serif;
    font-size: var(--joplin-font-size);
    max-height: calc(100vh - 20px); /* Adjust if needed */
}

.input-group, .note-selector-group {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    position: relative;
}

#taskName, #projectName {
    width: 40%;
    min-height: 23px;
    color: var(--joplin-color);
    background-color: var(--joplin-background-color);
    border-width: 1px;
    border-radius: 3px;
    border-style: solid;
}

#startButton, #openNoteButton, .stopButton {
    width: 20%;
    min-height: 23px;
    cursor: pointer;
    color: var(--joplin-color);
    background-color: var(--joplin-background-color);
    border-width: 1px;
    border-radius: 3px;
    border-spacing: 5px;
    border-style: solid;
    font-size: var(--joplin-font-size);
    padding: 3px 8px;
}

#startButton:hover, #openNoteButton:hover, .stopButton:hover {
    background-color: var(--joplin-background-color-hover3);
}

#errorMessage {
    color: rgb(194, 28, 28);
    margin-bottom: 5px;
    margin-top: 5px;
    font-size: var(--joplin-font-size);
}

#runningTasks {
    overflow-y: auto;
    font-size: var(--joplin-font-size);
    box-sizing: border-box;
    margin: 0px;
}

.running-task {
    margin-bottom: 5px;
    padding: 5px;
    background-color: var(--joplin-background-color);
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
    transition: background-color 0.2s, border-color 0.2s;
}

.running-task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5px;
}

.running-task-title-container {
    display: flex;
    flex-direction: column;
}

.running-task-title {
    font-weight: bold;
}

.running-task-project {
    font-size: calc(var(--joplin-font-size) * 0.9);
    color: var(--joplin-color-faded);
}

.running-task-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.running-task-start-time {
    flex: 1;
    text-align: left;
}

.running-task-duration {
    flex: 1;
    text-align: right;
}

::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-corner {
    background: none;
}

::-webkit-scrollbar-track {
    border: none;
}

::-webkit-scrollbar-thumb {
    background: rgba(100, 100, 100, 0.3);
    border-radius: 5px;
}

::-webkit-scrollbar-track:hover {
    background: rgba(0, 0, 0, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 100, 100, 0.7);
}

#completedTasks {
    margin-top: 0px;
    margin-bottom: 10px;
}

.completed-tasks-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    overflow: hidden;
    table-layout: auto;
}

.completed-tasks-table .header-cell, .completed-tasks-table td {
    padding: 5px;
    text-align: left;
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

#completedTasks tr:last-child td {
    border-bottom: none;
}

.completed-tasks-table .header-cell {
    background-color: var(--joplin-background-color-hover3);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.completed-tasks-table tr:nth-child(even) {
    background-color: var(--joplin-background-color);
}

.completed-tasks-table tr:nth-child(odd) {
    background-color: var(--joplin-background-color3);
}

.completed-tasks-table td {
    word-wrap: anywhere;
    overflow-wrap: anywhere;
}

.startButton {
    padding: 3px 8px;
    background-color: var(--joplin-background-color);
    color: var(--joplin-color);
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
    text-align: center;
    font-size: 14px;
    line-height: 1;
}

.startButton:hover {
    background-color: var(--joplin-background-color-hover3);
}

.autocomplete-list {
    position: absolute;
    border-width: 1px;
    border-style: solid;
    border-top: none;
    z-index: 99;
    top: 100%;
    left: 0;
    right: 0;
    padding: 0;
    max-height: 150px;
    overflow-y: auto;
    background-color: var(--joplin-background-color);
    box-shadow: 0 2px 5px rgba(180, 180, 180, 0.2);
    margin-top: -1px;
}

.autocomplete-list li {
    padding: 5px;
    cursor: pointer;
    background-color: var(--joplin-background-color);
    border-bottom-width: 1px;
    border-bottom-style: solid;
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:hover,
.autocomplete-list li.selected {
    background-color: var(--joplin-background-color-hover3);
}

.autocomplete-list li.selected {
    background-color: var(--joplin-background-color-hover3);
}

.autocomplete-list li:not(.selected) {
    background-color: var(--joplin-background-color);
}

#noteSelector {
    width: 80%;
    min-height: 23px;
    padding: 0 5px;
    color: var(--joplin-color);
    background-color: var(--joplin-background-color);
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    font-family: Avenir, Arial, sans-serif;
    font-size: var(--joplin-font-size);
}

.date-range {
    display: flex;
    gap: 5px;
    width: 80%;
}

.date-range input[type="date"] {
    flex: 1;
    min-height: 23px;
    padding: 0 5px;
    color: var(--joplin-color);
    background-color: var(--joplin-background-color);
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
    font-family: Avenir, Arial, sans-serif;
    font-size: var(--joplin-font-size);
}

#aggregationSlider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: var(--joplin-background-color3);
    outline: none;
    opacity: 0.7;
    -webkit-transition: .2s;
    transition: opacity .2s;
}

#aggregationSlider:hover {
    opacity: 1;
}

#aggregationSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--joplin-color);
    cursor: pointer;
}

#aggregationSlider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--joplin-color);
    cursor: pointer;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: var(--joplin-font-size);
    color: var(--joplin-color);
    margin-top: 5px;
}

.filter-group {
    display: flex;
    align-items: stretch;
    margin-bottom: 5px;
    gap: 5px;
    width: 100%;
}

#taskFilter {
    width: 20%;
    min-height: 23px;
    padding: 0 5px;
    color: var(--joplin-color);
    background-color: var(--joplin-background-color);
    border-width: 1px;
    border-style: solid;
    border-radius: 3px;
}

/* For smaller screens, stack the elements vertically */
@media (max-width: 300px) {
    .filter-group {
        flex-direction: column;
    }

    .date-range, #taskFilter {
        width: 100%;
    }
}

.hidden {
    display: none;
}

.section-divider {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    color: var(--joplin-color);
}

.section-divider hr {
    flex-grow: 1;
    border: none;
    height: 1px;
    background-color: rgb(118, 118, 118);;
    margin: 0px;
}

.section-divider span {
    font-weight: bold;
    white-space: nowrap;
}

.sortable {
    cursor: pointer;
}

.sortable:hover {
    text-decoration: underline;
}

.arrow-up::after {
    content: ' ▲';
}

.arrow-down::after {
    content: ' ▼';
}
