/* =========================================================
   base.css
   Colours, fonts, and default look of plain HTML elements
   (text, links, buttons, forms, tables).
   ========================================================= */

/* ---------- Fonts ----------
   The font files live in frontend/fonts (licence files are next to them).
   Headings: Courier Prime, a typewriter style font.
   Text:     IBM Plex Sans, an easy-to-read sans serif.  */
@font-face {
    font-family: "Courier Prime";
    src: url("../fonts/courier-prime-400.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "Courier Prime";
    src: url("../fonts/courier-prime-700.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}
@font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
    font-weight: 400;
    font-display: swap;
}
@font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2");
    font-weight: 600;
    font-display: swap;
}
@font-face {
    font-family: "IBM Plex Sans";
    src: url("../fonts/ibm-plex-sans-700.woff2") format("woff2");
    font-weight: 700;
    font-display: swap;
}

/* ---------- Colours and sizes ---------- */
/* The site looks like a page in a notebook:
   paper = cream background
   ink   = dark grey text and lines
   blue  = links and main buttons
   red   = errors and violations                 */
:root {
    --paper: #fbfaf5;
    --ink: #2b2b2b;
    --blue: #1a4f8b;
    --blue-dark: #0d2f57;
    --red: #b00020;
    --line: #d8d4c4;        /* light ruled lines */
    --line-dashed: #c9c3ad; /* dashed lines under headings */
    --muted: #6b6758;       /* secondary text */
    --white: #ffffff;

    /* older names still used inside some JS files */
    --primary-color: var(--blue);
    --primary-hover: var(--blue-dark);
    --primary: var(--blue);
    --link-color: var(--blue);
    --success: var(--blue);
    --danger: var(--red);
    --warning: var(--red);
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --secondary-color: var(--muted);
    --border-color: var(--line);
    --surface-color: var(--paper);
    --bg-color: var(--paper);
    --background-color: var(--paper);

    /* fonts (if a file fails to load, the browser uses the next name in the list) */
    --font-heading: "Courier Prime", "Courier New", monospace;
    --font-body: "IBM Plex Sans", Arial, sans-serif;

    --sidebar-width: 200px;
    --header-height: 50px;
}

/* ---------- Reset ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--paper);
}

/* ---------- Text ---------- */
/* headings use a serif font, like titles in a printed page */
h1, h2, h3 {
    font-family: var(--font-heading);
    font-weight: 700;
    margin-bottom: 10px;
}

h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 17px; }

h4 {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 8px;
}

p {
    margin-bottom: 10px;
}

a {
    color: var(--blue);
}

a:hover {
    color: var(--blue-dark);
}

hr {
    border: none;
    border-top: 1px solid var(--line);
    margin: 20px 0;
}

/* ---------- Buttons ---------- */
button {
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* main action: solid blue */
.btn-primary {
    background-color: var(--blue);
    color: var(--white);
    border: 1px solid var(--blue);
    padding: 5px 14px;
}

.btn-primary:hover {
    background-color: var(--blue-dark);
}

/* Cancel / Back / Close: just an outline */
.btn-secondary,
.btn-sm {
    background-color: transparent;
    color: var(--ink);
    border: 1px solid var(--muted);
    padding: 5px 14px;
}

.btn-secondary:hover,
.btn-sm:hover {
    color: var(--blue);
    border-color: var(--blue);
}

.btn-sm {
    padding: 2px 10px;
    font-size: 12px;
}

/* dangerous actions (logout, close exam, revoke) */
.btn-danger {
    background-color: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    padding: 5px 14px;
}

.btn-danger:hover {
    background-color: var(--red);
    color: var(--white);
}

.btn-warning {
    color: var(--red);
    margin-right: 5px;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 3px;
    font-weight: bold;
    font-size: 12px;
}

.form-control,
.form-input {
    width: 100%;
    padding: 5px 7px;
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    background-color: var(--white);
    border: 1px solid #b9b39e;
}

.form-control:focus,
.form-input:focus {
    outline: 1px solid var(--blue);
    border-color: var(--blue);
}

.form-input:disabled {
    background-color: transparent;
}

/* password box with a "Show" button inside it */
.password-input-wrapper {
    position: relative;
}

.password-input-wrapper .form-control {
    padding-right: 55px;
}

.password-toggle-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--blue);
    font-size: 11px;
    text-decoration: underline;
    padding: 2px 6px;
}

/* ---------- Tables ---------- */
/* no boxes: only lines between rows, like a ruled page */
.table-container {
    margin-bottom: 20px;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 8px 8px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

th {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 14px;
    border-bottom: 1px solid var(--ink);
}

tbody tr:hover {
    background-color: #f3f1e7;
}

/* hidden row under a report that shows the proctoring logs */
.logs-row,
.logs-row:hover {
    background-color: transparent;
}
