/* public/css/style.css */

/* Basic resets / container styles. 
   This file is referenced by both index.php and login.php. */

:root {
    --bg-primary: #f4f4f4;
    --bg-secondary: #f4f4f4;
    --module: #fafafa;
    --module-done: #f0f0f0;
    --module-highlight: #e0f7fa;
    --text-primary: #333;
    --text-secondary: #444;
    --link: #007BFF;
  }

body {
    margin: 0;
    padding: 0;
    background: var(--bg-primary);
    font-family: Arial, sans-serif;
    color: var(--text-primary);
}

footer {
    text-align: center;
    padding: 20px 0;
    background: var(--bg-primary);
    border-top: 1px solid #ccc;
    position: relative;
}

footer a {
    color: var(--link);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.container {
    max-width: 900px;
    margin: 40px auto;
    background: var(--bg-secondary);
    padding: 25px 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 6px;
}

.login-container {
    max-width: 300px;
    margin: 100px auto;
    background: var(--bg-secondary);
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

header {
    margin-bottom: 30px;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

h1,
h2 {
    margin-top: 0;
    color: var(--text-primary);
}

.error {
    color: red;
    text-align: center;
}

label {
    margin-bottom: 0.5em;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="number"] {
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

input[type="date"] {
    padding: 6px;
}

button {
    background: var(--link);
    color: #fff;
    border: none;
    padding: 7px 10px;
    cursor: pointer;
    border-radius: 3px;
    font-size: 14px;
}

button:hover {
    background: #0056b3;
}

/* Index page extras */
.top-links a {
    text-decoration: none;
    color: var(--link);
    margin-left: 15px;
}

.top-links a:hover {
    text-decoration: underline;
}

.top-links a.active {
    font-weight: bold;
    color: var(--text-primary);
    /* other active styles */
}

.top-links a.disabled {
    color: #999;
    pointer-events: none;
}

.module-card {
    border: 1px solid #ccc;
    border-radius: 5px;
    color: var(--text-secondary);
    padding: 15px;
    margin: 10px 0;
    background: var(--module);
}

.module-card.completed {
    color: #999;
    background: var(--module-done);
    border-color: #ddd;
}

.module-card.highlighted {
    background: var(--module-highlight);
    border-color: var(--link);
}

.req-list {
    margin: 10px 0;
    padding-left: 20px;
}

.req-list li {
    margin-bottom: 5px;
}

.form-inline {
    display: inline-block;
    margin-right: 10px;
}

.term-block {
    margin-bottom: 40px;
}

.credit-summary {
    margin: 10px 0 0 0;
}

.credit-summary p {
    margin: 5px 0;
}

.info-line {
    margin: 5px 0;
}

/* Stats page extras */

canvas {
    max-width: 100%;
    height: 420px;
}

.chart-wrapper {
    margin: 40px 0;
}


/* Index page menu modal */


.header-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
}

/* Hidden checkbox */
#menu-toggle {
    display: none;
}

/* The menu button */
.menu-button {
    display: inline-block;
    padding: 10px 20px;
    /* background-color: #3498db; */
    color: var(--text-primary);
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    text-align: center;
}

/* The modal background */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* The modal content */
.modal-content {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    text-align: center;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Show modal when checkbox is checked */
#menu-toggle:checked+.menu-button+.modal-overlay {
    display: flex;
}

/* Close button inside modal */
.close-button {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 12px;
    background: #e74c3c;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}



/* Custom color picker */


#themeCustomiser {
    font-family: system-ui, sans-serif;
  }

  #themeTable {
    width: 100%;
    border-collapse: collapse;
  }

  #themeTable td {
    padding: 0.25rem 0.5rem;
    vertical-align: middle;
  }

  /* colour picker (left) */
  #themeTable td:first-child {
    width: 50%;
    text-align: right; /* flush picker up against middle */
  }

  /* label text (right) */
  #themeTable td:last-child {
    width: 50%;
    text-align: left;
    white-space: nowrap;
  }

  #resetTheme {
    margin-top: 0.5rem;
    padding: 0.25rem 0.6rem;
  }


/* Planner page extras */

.planner-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.left-pane {
    flex: 1 1 0;
    min-width: 38%;
}

.right-pane {
    flex: 1.4 1 0;
    max-height: calc(100vh - 180px);
    overflow: auto;
    position: sticky;
    top: 100px;
    border-left: 1px solid #ccc;
    padding-left: 12px;
}

.term-column {
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 18px;
    background: #fafafa;
}

.term-head {
    padding: 8px 10px;
    font-weight: 600;
    background: #eee;
    border-bottom: 1px solid #ccc;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-list {
    list-style: none;
    margin: 0;
    padding: 8px 10px;
    min-height: 30px;
}

.module-item {
    padding: 6px 8px;
    margin: 4px 0;
    background: #fff;
    border: 1px solid #bbb;
    border-radius: 4px;
    cursor: move;
    user-select: none;
}

.module-item.dragging {
    opacity: 0.5;
}

.module-item.done {
    background: #f0f0f0;
    color: #999;
    border-color: #ddd;
}

.drop-target {
    background: #d0ebff !important;
}

/***** Requirements preview *****/
table.req-preview {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

table.req-preview th,
table.req-preview td {
    padding: 4px 6px;
    border-bottom: 1px solid #ddd;
}

.term-row {
    cursor: pointer;
    user-select: none;
}

.term-row td {
    background: #eee;
    font-weight: 600;
    border-bottom: 2px solid #ccc;
}

.term-row.collapsed td {
    background: #ddd;
    opacity: 0.8;
}

tr.grey {
    background: #f0f0f0;
    color: #999;
}

.hidden {
    display: none;
}


/* Requirement detail page extras */


.sub-list {
    list-style: none;
    padding-left: 0;
}

.sub-list li {
    margin: 4px 0;
}

.sub-list form {
    display: inline;
}