body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    margin: 20px;
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.6;
}

h1, h2 {
    color: #343a40;
    margin-bottom: 0.75rem;
}
h1 {
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}
h2 {
    font-size: 1.25rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

#auth-section {
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    max-width: 700px;
}

#auth-section div {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #495057;
}

input[type="text"],
textarea {
    width: 100%; /* Make inputs fill their container */
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box; /* Include padding in width */
}
textarea {
    resize: vertical; /* Allow vertical resize */
}

button {
    padding: 10px 18px;
    background-color: #0d6efd; /* Bootstrap blue */
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    margin-right: 8px; /* Spacing for filter buttons */
}

button:hover {
    background-color: #0b5ed7;
}
button:disabled {
     background-color: #6c757d;
     cursor: not-allowed;
}


button.active-filter {
    background-color: #0a58ca;
    font-weight: bold;
}

#content-browser {
    display: flex;
    flex-wrap: wrap; /* Allow columns to wrap on smaller screens */
    gap: 20px; /* Consistent spacing */
    margin-top: 20px;
}

.column {
    flex: 1; /* Distribute space equally */
    min-width: 220px; /* Minimum width before wrapping */
    background-color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    /* Limit height and enable scrolling for content lists */
    max-height: 75vh;
    display: flex; /* Use flexbox for column layout */
    flex-direction: column; /* Stack header and list vertically */
}

.column h2 {
    margin-top: 0;
    margin-bottom: 10px; /* Space between header and list */
    flex-shrink: 0; /* Prevent header from shrinking */
}

.column ul {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow-y: auto; /* Enable vertical scroll *within* the list */
    flex-grow: 1; /* Allow list to take remaining space */
}

li {
    padding: 10px 8px;
    border-bottom: 1px solid #f1f3f5;
    cursor: pointer;
    word-wrap: break-word; /* Prevent long text overflow */
    transition: background-color 0.15s ease;
    font-size: 0.95rem;
}

li:last-child {
    border-bottom: none;
}

li:hover {
    background-color: #e9ecef;
}

li.selected {
    background-color: #0d6efd;
    color: white;
    font-weight: 500;
    border-radius: 4px; /* Slight rounding on selected item */
}
li.selected:hover {
    background-color: #0b5ed7;
}

.hidden {
    display: none !important; /* Use !important to override flex display if needed */
}

#loading {
    font-size: 1.2em;
    color: #6c757d;
    text-align: center;
    padding: 30px;
    width: 100%;
}

.error-message {
    color: #842029; /* Bootstrap danger text */
    background-color: #f8d7da; /* Bootstrap danger background */
    border: 1px solid #f5c2c7; /* Bootstrap danger border */
    padding: 12px 15px;
    border-radius: 5px;
    margin: 15px 0;
    max-width: 700px; /* Align width with auth box */
}

#course-filters {
    margin-bottom: 10px;
    flex-shrink: 0; /* Prevent filter area from shrinking */
}
#course-filters button {
    margin-bottom: 5px; /* Space below filter buttons */
    font-size: 0.9em;
    padding: 6px 12px;
}

/* Content item specific styling */
#content-list li {
    cursor: default; /* Content items aren't clickable */
    display: flex; /* Align title and links */
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow links to wrap */
}
#content-list .item-info {
    flex-grow: 1; /* Title takes available space */
    margin-right: 10px; /* Space before links */
}
#content-list .item-links {
     display: flex;
     gap: 8px; /* Space between links */
     flex-wrap: wrap; /* Allow links to wrap on narrow screens */
     margin-top: 5px; /* Space if links wrap below title */
}

#content-list a {
    display: inline-block;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    white-space: nowrap; /* Prevent link text wrapping */
    transition: opacity 0.2s ease;
}
#content-list a:hover {
    opacity: 0.85;
}

#content-list a.video-link {
    background-color: #198754; /* Bootstrap success */
    color: white;
}
#content-list a.pdf-link {
    background-color: #ffc107; /* Bootstrap warning */
    color: #333;
}
#content-list a.notes-link {
    background-color: #0dcaf0; /* Bootstrap info */
    color: white;
}
#content-list span.item-type {
    font-style: italic;
    color: #6c757d; /* Bootstrap secondary text */
    font-size: 0.85em;
    margin-left: 5px;
    white-space: nowrap;
}