/* One stylesheet for the whole UI. The pages use table/btn/alert/badge classes throughout, so the
   site keeps working without a CSS framework while still giving the lists and forms readable
   spacing, aligned columns and a click target that looks like one. */
:root {
    color-scheme: light;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #1f2933;
    background: #f5f7fa;
}

a {
    color: #0b5cad;
}

nav {
    background: #1f2933;
    padding: 0.5rem 1rem;
}

nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav a {
    display: block;
    padding: 0.45rem 0.75rem;
    border-radius: 0.25rem;
    color: #cfd8e3;
    text-decoration: none;
}

nav a:hover {
    background: #323f4b;
    color: #fff;
}

nav a.active {
    background: #3e4c59;
    color: #fff;
}

nav li.nav-session {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
    padding-left: 0.75rem;
    color: #cfd8e3;
    font-size: 0.9rem;
}

nav .nav-logout {
    font: inherit;
    padding: 0.35rem 0.7rem;
    border: 1px solid #52606d;
    border-radius: 0.25rem;
    background: none;
    color: #cfd8e3;
    cursor: pointer;
}

nav .nav-logout:hover {
    background: #323f4b;
    color: #fff;
}

main {
    display: block;
    max-width: 64rem;
    margin: 1.5rem auto 3rem;
    padding: 0 1rem;
}

h3 {
    margin: 1.25rem 0 0.75rem;
}

h4 {
    margin: 1.5rem 0 0.5rem;
}

.table {
    width: 100%;
    margin: 1rem 0;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 1px 2px rgba(31, 41, 51, 0.12);
}

.table th,
.table td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e4e7eb;
}

.table thead th {
    background: #eef2f7;
    font-weight: 600;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.btn {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    background: #e4e7eb;
    color: #1f2933;
}

.btn-primary {
    background: #0b5cad;
    border-color: #0b5cad;
    color: #fff;
}

.btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: #d7f0dd;
    color: #1b5e20;
    font-size: 0.8rem;
    font-weight: 600;
}

/* The one badge that has to be noticed while a class is running. */
.badge-live {
    margin-left: 0.4rem;
    background: #c62828;
    color: #fff;
}

.alert {
    margin: 0.75rem 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid #b9d7f2;
    border-radius: 0.25rem;
    background: #e8f2fc;
    color: #0b3d6b;
}

form > div {
    margin-bottom: 0.6rem;
}

/* A fixed label column keeps every input on a form starting at the same x, however long its label. */
label {
    display: inline-block;
    min-width: 6.5rem;
    margin-right: 0.5rem;
    font-weight: 600;
    vertical-align: top;
}

input,
textarea {
    width: 18rem;
    max-width: 100%;
    padding: 0.35rem 0.5rem;
    border: 1px solid #cbd2d9;
    border-radius: 0.25rem;
    font: inherit;
}

form > button {
    margin-top: 0.25rem;
}

select {
    padding: 0.35rem 0.5rem;
    border: 1px solid #cbd2d9;
    border-radius: 0.25rem;
    font: inherit;
    background: #fff;
}

.muted {
    color: #616e7c;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.filters input,
.filters select {
    width: auto;
}

/* Catalog, My Learning and plans all use the same card grid. */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.course-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e4e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(31, 41, 51, 0.08);
}

.course-card h4 {
    margin: 0;
}

.course-card .description {
    flex: 1;
    margin: 0.25rem 0;
    color: #3e4c59;
}

.course-card-footer {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.price {
    font-size: 1.05rem;
    font-weight: 700;
}

.material {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid #e4e7eb;
    border-radius: 0.5rem;
}

.video {
    width: 100%;
    max-height: 28rem;
    margin: 0.5rem 0 1rem;
    background: #000;
    border-radius: 0.5rem;
}

.subscription-status {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border: 1px solid #d7f0dd;
    border-radius: 0.5rem;
    background: #f2fbf4;
}
