/*
 * demonstrator.css
 * Consolidated stylesheet for ALL Demonstrator module templates.
 *
 * Covers:
 *   assign.html, auto.html, availability.html, demo_apply.html,
 *   demo_feedback.html, demo_lookup.html, module_form.html,
 *   head_demonstrators.html, import.html, index.html, listalldemos.html,
 *   manage.html, managedemocall.html, managemodules.html, moduledata.html,
 *   my_demo.html, registration.html, selectmodules.html,
 *   update_application.html, upload.html, viewprofile.html,
 *   withdraw_confirmation.html, withdraw_request.html,
 *   demonstrator_modules.html



/* ============================================================
   1. SHARED — page/form containers
   ============================================================
   Used by: module_form.html, demo_feedback.html,
            managedemocall.html, viewprofile.html
*/

.top-pad {
    max-width: 1000px;
    margin: 50px auto;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.top-pad h1 {
    text-align: center;
    margin-bottom: 20px;
    font-family: 'Arial', sans-serif;
    color: #333;
}

.top-pad label {
    display: block;
    margin-bottom: 8px;
    margin-top: 10px;
    font-family: 'Arial', sans-serif;
    color: #333;
}

.top-pad input[type="text"] {
    width: calc(100% - 20px);
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

.top-pad input[type="submit"] {
    width: 100%;
    padding: 10px;
    background-color: #4e9bec;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    font-family: 'Arial', sans-serif;
    margin-top: 10px;
}

.top-pad input[type="submit"]:hover {
    background-color: #3880ce;
}

/* Used by: demo_apply.html, update_application.html, registration.html */
.app_container {
    max-width: 800px;
    margin: 20px auto;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}


/* ============================================================
   2. SHARED — Bootstrap panel overrides
   ============================================================
   Used by: update_application.html, registration.html, demo_apply.html,
            index.html, managemodules.html
*/

.panel {
    margin-bottom: 20px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.panel-primary .panel-heading {
    background-color: #007bff;
    color: #fff;
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
}

.panel-body {
    padding: 15px;
}

legend {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #007bff;
}

.checkbox {
    margin-bottom: 10px;
}

.pull-right {
    float: right;
}


/* ============================================================
   3. SHARED — tables
   ============================================================
   Used by: all pages with tables
*/

/* Base table reset */
table {
    width: 100%;
    table-layout: fixed;
    border: 1px solid #dee2e6;
    border-spacing: 0;
    border-collapse: collapse;
}

table th,
table td {
    word-wrap: break-word;
    border: 1px solid #dee2ed;
    overflow: hidden;
    white-space: normal;
}

thead {
    display: table-header-group;
}

tr {
    page-break-inside: avoid;
}

table > thead > tr > th,
table > tbody > tr > th,
table > tfoot > tr > th,
table > thead > tr > td,
table > tbody > tr > td,
table > tfoot > tr > td {
    padding: 8px;
    line-height: 1.42857143;
    vertical-align: top;
    border-top: 1px solid #ddd;
}

table th {
    background-color: #f2f2f2;
    font-weight: 600;
    text-align: center;
    font-size: 13px;
}

table tr:nth-child(even) {
    background-color: #f9f9f9;
}

table tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

/* Bootstrap .table class */
.table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 20px;
    table-layout: fixed;
}

.table th,
.table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    word-wrap: break-word;
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.table th {
    background-color: #f2f2f2;
    font-weight: 600;
    text-align: center;
    border: none;
    font-size: 13px;
}

.table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.table tr:hover {
    background-color: #f1f1f1;
    cursor: pointer;
}

/* table-bordered variant */
.table-bordered {
    border: 1px solid #dee2ed;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #dee2ed;
}

/* managemodules.html — blue thead */
.table-blue th {
    background-color: #007bff;
    color: #fff;
}

/* index.html — centred table wrapper */
.center-table {
    display: flex;
    justify-content: center;
}

/* my_demo.html, viewprofile.html */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}


/* ============================================================
   4. SHARED — form elements
   ============================================================
   Used by: update_application.html, registration.html,
            managedemocall.html, demo_apply.html
*/

.form-control {
    width: 100%;
    padding: 10px;
    margin: 5px 0 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
    /* managedemocall overrides below */
    border-radius: 0;
    box-shadow: none;
    border-color: #d2d6de;
}

.form-control:focus {
    border-color: #3c8dbc;
}

.form-group {
    margin-bottom: 20px;
}

.form-horizontal .control-label {
    text-align: left;
}

/* Validation states — managedemocall.html */
.has-error .form-control {
    border-color: #dd4b39;
    box-shadow: none;
}

.has-error .form-control:focus {
    border-color: #e73c24;
}

.has-warning .form-control {
    border-color: #f0ad4e;
    box-shadow: none;
}

.has-warning .form-control:focus {
    border-color: #f39c12;
}

/* Form validation error message */
.form-error {
    color: red;
    margin-top: -10px;
    margin-bottom: 5px;
}

/* Datetime picker — managedemocall.html */
.form-horizontal .col-sm-9 input[type="datetime-local"].form-control {
    height: 50px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    line-height: 1.42857143 !important;
    box-sizing: border-box !important;
}


/* ============================================================
   5. SHARED — Bootstrap button overrides
   ============================================================
   Used by: my_demo.html, managemodules.html, update_application.html,
            registration.html, managedemocall.html
*/

.btn-primary {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #004085;
    color: #fff;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}

/* managedemocall.html teal variant — apply class="btn btn-primary-teal" */
.btn-primary-teal {
    background-color: #3c8dbc;
    border-color: #367fa9;
    color: #fff;
}

.btn-primary-teal:hover,
.btn-primary-teal:active,
.btn-primary-teal:focus {
    background-color: #367fa9;
    border-color: #204d74;
}

.btn-success {
    background-color: #28a745;
    border-color: #28a745;
    color: #fff;
    padding: 10px 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 5px;
    text-decoration: none;
}

.btn-success:hover {
    background-color: #218838;
    color: #fff;
}

.btn-success:focus {
    box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}

.btn-info {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.btn-info:hover {
    background-color: #0056b3;
    border-color: #004085;
    color: #fff;
}

.btn-info:focus {
    box-shadow: 0 0 0 0.2rem rgba(38, 143, 255, 0.5);
}

.float-right {
    float: right;
}


/* ============================================================
   6. SHARED — export button
   ============================================================
   Used by: availability.html, demonstrator_modules.html, managemodules.html
*/

.export-btn {
    background-color: #337ab7;
    border-color: #2e6da4;
    color: white;
    border-radius: 4px;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s;
    border: 1px solid transparent;
}

.export-btn:hover {
    background-color: #286090;
    border-color: #204d74;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}


/* ============================================================
   7. INDEX — demonstrator application summary page
   ============================================================ */

.text-center {
    text-align: center;
    font-size: medium;
}

.update_application {
    display: flex;
    justify-content: center;
}


/* ============================================================
   8. AVAILABILITY / DEMONSTRATOR_MODULES — applicant tables
   ============================================================ */

/* Row for an already-assigned demonstrator */
.assigned-demo {
    background-color: #d4edda !important;
}

/* Slot clash highlighting */
.user-clash-cell {
    background-color: #fff3cd !important;
    border: 1px solid #ffc107 !important;
}

.clash-icon {
    display: block;
    font-size: 16px;
    line-height: 1;
    margin-bottom: 2px;
    user-select: none;
}

/* Manual-add form (top-right of module tab) */
.manual-add-container {
    float: right;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 10px;
}

.manual-add-input {
    display: flex;
    align-items: center;
    gap: 5px;
}


/* ============================================================
   9. ASSIGN / DEMONSTRATOR_MODULES — feedback speech-bubble button
   ============================================================ */

.feedback-button-container {
    display: flex;
    align-items: center;
    color: inherit;
    text-decoration: none;
}

.feedback-button-container:hover {
    color: inherit;
    text-decoration: none;
    opacity: 0.6;
}

.feedback-button {
    cursor: pointer;
    margin: 5px 0;
    color: #fff;
    max-width: 5ch;
    text-align: center;
    --b: .4em;
    --h: .3em;
    padding: 1em;
    border-radius: 5px;
    border-bottom-left-radius: 0;
    clip-path: polygon(
        0 0,
        100% 0,
        100% 100%,
        calc(0% + var(--b)) 100%,
        0 calc(100% + var(--h)),
        0 100%
    );
}

.active-feedback-button {
    --c: #337AB7;
    background: var(--c);
    border-image: conic-gradient(var(--c) 0 0) 0 0 999 999 /
        0 0 calc(var(--h) + var(--b)) calc(var(--h) + var(--b)) /
        0 0 var(--h) var(--h);
}

.default-feedback-button {
    --c: #cecece;
    background: var(--c);
    border-image: conic-gradient(var(--c) 0 0) 0 0 999 999 /
        0 0 calc(var(--h) + var(--b)) calc(var(--h) + var(--b)) /
        0 0 var(--h) var(--h);
}

.feedback-icon {
    cursor: pointer;
    font-weight: bold;
    font-size: 20px;
    margin: 3px;
}

.add-button {
    font-size: 25px;
}


/* ============================================================
   10. DEMO_FEEDBACK — feedback page
   ============================================================ */

.feedback-info {
    display: flex;
    gap: 8px;
}

.feedback-info p {
    opacity: 0.7;
}

.comment-container {
    font-size: 1.7rem;
    width: 100%;
    border: 5px solid #4e9bec;
    border-radius: 15px;
    padding: 0;
}

.comment-container i {
    display: block;
    padding: 20px;
}

.comment-container p {
    padding-left: 20px;
}

.feedback-container {
    text-align: start;
    margin-top: 35px;
}

.new-feedback {
    width: 100%;
    margin-top: 50px;
    border: 5px solid #cecece;
    border-radius: 15px;
    padding: 0;
}

.new-feedback textarea {
    display: block;
    width: 100%;
    border: none;
    padding: 20px 20px 30px 20px;
    font-style: italic;
    font-size: 1.7rem;
    border-radius: 15px;
    resize: none;
    outline: none;
}

.empty-msg {
    margin-top: 25px;
}

.feedback-section {
    text-align: center;
    font-size: 2rem;
    min-height: 50px;
    width: 100%;
}

/* Scoped to feedback form only — avoids bleeding into nav/base forms */
.feedback-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}


/* ============================================================
   11. EDITMODULE / PARSE — slot timetable grid
   ============================================================ */

.grid {
    display: grid;
    grid-template-columns: 70px repeat(9, 1fr);
    grid-template-rows: 3rem repeat(5, 6rem);
}

.slots-container {
    width: 100%;
    overflow: hidden;
    margin-bottom: 20px;
}

.top-heading-cell {
    height: 3rem;
    margin: 0;
}

/* Scoped to the timetable grid on editmodule/parse pages only */
.grid .slot-cell,
.grid .heading-cell {
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    background-color: #e2e2e2;
    border: 2px solid #f9f9f9;
    border-radius: 5px;
}

.grid .heading-cell {
    min-width: 15px;
    border-width: 1.5px;
    background-color: #4e9bec;
    color: white;
    user-select: none;
}

.grid .slot-cell {
    cursor: pointer;
    position: relative;
    min-width: 50px;
    align-items: stretch;
    justify-content: stretch;
}

.slot {
    display: flex;
    width: 100%;
    min-height: 100%;
    justify-content: center;
    align-items: center;
    position: absolute;
    z-index: 999;
    cursor: grab;
    transition: box-shadow 0.2s ease;
    background-color: #c8e6c9;
    border: 2px solid #94ba94;
    border-radius: 5px;
    box-sizing: border-box;
    top: 0;
    left: 0;
}

.slot:hover {
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.2);
}

.slot::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 8px;
    cursor: col-resize;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.slot:hover::after {
    opacity: 1;
}

.slot-input {
    border: none;
    text-align: center;
    width: 100%;
    height: 100%;
    z-index: 1000;
    background-color: white;
    color: #333;
    font-weight: 500;
    font-size: 14px;
    padding: 0;
}

.slot-input::placeholder {
    color: #999;
}

.slot-input:focus {
    outline: none;
    box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.1);
}

.delete-button {
    display: none;
    position: absolute;
    user-select: none;
    top: 2px;
    right: 2px;
    width: 15px;
    height: 15px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    z-index: 1001;
    text-align: center;
    line-height: 15px;
}

.slot:hover .delete-button {
    display: block;
}

summary {
    font-weight: bold;
    margin-bottom: 15px;
    cursor: pointer;
}

details[open] summary::after {
    content: " ▲";
}

details summary::after {
    content: " ▼";
}

/* Autocomplete dropdown — module_form.html */
.autocomplete-items {
    border: 1px solid #ccc;
    background-color: whitesmoke;
    max-height: 150px;
    overflow-y: auto;
    position: absolute;
    opacity: 0.9;
    z-index: 10;
    width: calc(80% - 20px);
    left: 0;
}

.autocomplete-items:empty {
    display: none;
}

.autocomplete-items div {
    padding: 5px;
    cursor: pointer;
}

.autocomplete-items div:hover {
    background: #ccc;
}


/* ============================================================
   12. LISTALLDEMOS — date-range highlight
   ============================================================ */

.highlight {
    background-color: #ffff99;
}


/* ============================================================
   13. MY_DEMO — table formatting and cell states
   ============================================================ */

.center-text {
    text-align: center;
    vertical-align: middle;
}

/* Demo table wrapper */
.demo-table-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.demo-table-wrapper > table {
    width: auto !important;
    max-width: 90%;
    margin-bottom: 1rem;
}

.demo-table-wrapper > .table-responsive {
    width: auto !important;
    max-width: 90%;
}

.demo-table-wrapper .table-responsive table {
    width: auto !important;
    margin-bottom: 1rem;
}

.demo-table thead th {
    background-color: #f2f2f2;
    font-weight: 600;
    text-align: center;
    border: 1px solid #ddd;
    padding: 12px 8px;
}

.demo-table tbody td {
    padding: 12px 8px;
    border: 1px solid #ddd;
    word-wrap: break-word;
    white-space: normal;
}

/* My Modules table row states */
.occupied-cell,
.occupied-cell td {
    background-color: #fff3cd !important;
    color: #333 !important;
    font-weight: bold;
}

.head-demo,
.head-demo td {
    background-color: #cfe2ff !important;
    color: #004085 !important;
    font-weight: bold;
}

.clash-cell,
.clash-cell td {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    font-weight: bold;
}

/* My Timetable cell states */
.timetable-occupied {
    background-color: #fff3cd !important;
    font-weight: bold !important;
    text-align: center !important;
    color: #333 !important;
}

.timetable-head-demo {
    background-color: #cfe2ff !important;
    color: #004085 !important;
    font-weight: bold !important;
    text-align: center !important;
}


/* ============================================================
   14. MANAGEMODULES — blue header override
   ============================================================ */

.table-blue th {
    background-color: #007bff;
    color: #fff;
}