.d-none {
    display: none;
}

/* Flex layout */
body, html {
    height: 100%;
    margin: 0;
  }
  
  .flex-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  nav, footer {
    flex: 0 0 auto;
  }
  
  main {
    flex: 1 1 auto;
    overflow-y: auto;
  }
  
  /* Centred login box */
  main .login {
    display: flex; /* Make flex */
    align-items: center; /* Center vertically */
    min-height: 100%; /* Full height in main */
  }

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.2); /* 20% black */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000; /* Above all other content */
}

/* Customer name and icon styling */
.customer-icon {
    display: flex;
    align-items: center; /* Align items vertically */
    cursor: pointer;
    text-decoration: none; /* Remove any default underline for links */
    background: none; /* Remove background */
    padding: 0; /* Remove any padding */
}

.icon-container {
    display: inline-flex; /* Flex to center icon */
    justify-content: center;
    align-items: center;
    border-radius: 50%; /* Circular border */
    width: 48px;
    height: 48px;
    border: 2px solid white; /* Border that will change colour */
    transition: border-color 0.3s ease, color 0.3s ease; /* Transition for border and colour */
}

.customer-icon .customer-name {
    color: white; /* Initial colour matching icon */
    transition: color 0.3s ease; /* Transition for colour */
    order: -1; /* Flip order with icon on larger screens */
    margin-right: 10px; /* Space between icon and name */
}

.customer-icon i {
    font-size: 32px; /* Set icon size */
    color: white; /* Set icon color */
    line-height: 1; /* Ensure proper vertical alignment */
    transition: color 0.3s ease; /* Transition for colour */
}

.customer-icon:hover .icon-container,
.customer-icon:hover i,
.customer-icon:hover .customer-name {
    border-color: #62AEFB; /* Border */
    color: #62AEFB; /* Text and icon */
}

.customer-icon:active .icon-container,
.customer-icon:active i,
.customer-icon:active .customer-name {
    border-color: #E6E6E6; /* Border */
    color: #E6E6E6; /* Text and icon */
}

/* Customer name and icon styling for narrower screens */
@media screen and (max-width: 768px) {
    .customer-icon {
        flex-direction: column; /* Stack icon and name vertically */
    }

    .icon-container {
        width: 36px; /* Adjust circle size */
        height: 36px; /* Adjust circle size */
        border: 2px solid white; /* Adjust border */
        margin-right: 0;
        margin-bottom: 2px; /* Space between icon and name */
    }

    .customer-icon .customer-name {
        order: 1; /* Name below icon */
        display: block; /* Stack below icon */
        text-align: center; /* Center name */
        font-size: 12px; /* Smaller font size */
        margin-top: 2px; /* Space between icon and name */
        margin-right: 0; /* No left margin */
    }

    .customer-icon i {
        font-size: 24px; /* Adjust icon size */
    }
}

/* Popup menu styling */
.popup-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    width: 300px;
}

.popup-first {
    margin-bottom: 20px;
}

.popup-group {
    margin-top: 20px;
    margin-bottom: 20px;
}

#password-form-container {
    margin-top: 20px;
}

.text-danger {
    color: #990000;
}

.text-success {
    color: #006700;
}

/* Download icon styling */
.download-icon {
    display: inline-block;
    cursor: pointer;
    text-decoration: none; /* Remove any default underline for links */
    background: none; /* Remove background */
    border: none; /* Remove border */
    padding: 0; /* Remove any padding */
}

.download-icon i {
    font-size: 32px; /* Adjust icon size */
    color: black; /* Set icon color */
    line-height: 1; /* Ensure proper vertical alignment */
    vertical-align: middle; /* Ensure proper vertical alignment */
    transition: color 0.3s ease; /* Smooth transition for hover effect */
}

.download-icon i:hover {
    color: #0D47A1; /* Colour on hover */
}

.download-icon i:active {
    color: #474747; /* Colour on click */
}

/* Spacer styling */
.greet-spacing { /* To pad greeting line */
    padding-bottom: 20px;
}

.spacing { /* For distance between structures */
    margin-top: 20px;
    margin-bottom: 20px;
}

h3.my-3 { /* To pad scroll to heading */
    scroll-margin-top: 20px;
}

/* Expand-collapse pointer */
.expand-collapse {
    cursor: pointer;
}

/* Feedback styling */
.feedback-container {
    max-height: 60vh; /* Limit verticle height */
    overflow-y: auto; /* Enable vertical scrolling */
    scroll-behavior: smooth;
    margin-bottom: 20px; /* Add space after table */
    padding: 20px; /* Add padding inside border */
}

.feedback-header {
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
    padding: 10px;
}

.feedback-header:hover {
    background-color: #f8f9fa;
}

.feedback-img {
    max-width: 500px;
    max-height: 300px;
    cursor: pointer;
    display: block;
    margin-top: 10px;
}

.status-container {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-container select,
.status-container button {
    line-height: normal;
    padding: 6px 10px;
}

.status-dropdown {
    max-width: 150px;
}

.confirm-btn {
    display: inline-block;
}

/* Reusable base box styling */
.container-box {
    border: 2px solid black; /* Bold black border */
    border-radius: 12px; /* Rounded corners */
}

/* Specific feedback box styling */
.feedback-box {
    background-color: #E6E6E6;
    padding: 10px;
    margin-bottom: 20px;
}

/* Specific form box styling */
.form-container {
    max-width: 640px; /* Limit width of form */
    margin: 0 auto; /* Center align form on page */
    margin-bottom: 20px; /* Add space after form */
    padding: 20px; /* Add padding inside border */
}

/* Specific table box styling */
.table-container {
    max-height: 360px; /* Limit to 8 lines (30px height per line as estimate) */
    overflow-y: auto; /* Enable vertical scrolling */
    margin-bottom: 20px; /* Add space after table */
    padding: 10px; /* Add padding inside border */
    table-layout: fixed; /* Forces equal column widths for consistency */
}

/* Specific pie chart styling */
.chart-container {
    max-height: 360px; /* Limit to same height as tables */
    max-width: 100%;   /* Keep chart responsive */
    overflow: hidden;  /* Prevent chart from exceeding container */
    display: flex;     /* Center chart horizontally */
    justify-content: center; 
    align-items: center;
}

.chart-container canvas {
    max-height: 100%; /* Ensure canvas container height */
    max-width: 100%;  /* Ensure canvas scales responsively */
}

/* Specific report box styling */
.reports-container {
    max-height: 48vh; /* Limit verticle height */
    overflow-y: auto; /* Enable vertical scrolling */
    scroll-behavior: smooth;
    margin-bottom: 20px; /* Add space after table */
    padding: 10px; /* Add padding inside border */
}

@media screen and (max-width: 768px) {
    .reports-container {
        max-height: 38vh; /* Smaller on smaller screens */
    }
}

.report-date {
    text-align: right;
    margin-bottom: 5px; /* Small space before entry */
}

/* Specific SRS box styling */
.srs-entry {
    background-color: #E6E6E6;
    padding: 10px;
    margin-bottom: 20px;
    position: relative;
}
.srs-entry h5 {
    margin-top: 0;
}
.srs-entry p {
    margin-bottom: 10px;
}

/* Specific log box styling */
.chat-log {
    background-color: #E6E6E6;
    padding: 10px;
    margin-bottom: 20px;
    border-radius: 12px;
}
.log-entry {
    margin-bottom: 20px;
}
.log-name {
    margin: 10px 0;
    cursor: pointer;
    transition: background-color 0.2s;
}
.log-name:hover {
    color: #0D47A1;
}

.speaker-label {
    font-weight: bold;
}
.speaker-label.correction {
    color: #990000;
}
.spoken-tag {
    color: #006700;
}
  
.input-field {
    padding: 10px 20px;
    border: 2px solid #000;
    border-radius: 8px;
    font-size: 1rem;
}

.search-match {
    color: #990000;
    font-weight: bold;
    text-decoration: none;
}
.search-match.current-match {
    text-decoration: underline;
}

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

.modal-content {
    position: relative;
    max-width: 80%;
    background: none;
}

.modal-img {
    max-width: 80%;
    max-height: 80vh;
    height: auto;
    width: auto;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    background: black;
    color: white;
    font-size: 24px;
    text-align: center;
    line-height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: #0D47A1;
}

.modal-close:active {
    background-color: #474747;
}

/* Form styling */
.expand-collapse {
    color: #0D47A1;
}

.form-group {
    margin-top: 10px;
    margin-bottom: 10px;
    margin-right: auto; /* Default left-align */
}

.form-container .form-group { /* Initial login form */
    width: 50%;
    margin-left: auto; /* Forces centre */
    overflow: auto; /* Aiming to prevent button margin overflow */
}

.password-management .form-group {
    width: 50%;
    margin-left: auto; /* Forces centre */
    overflow: auto; /* Aiming to prevent button margin overflow */
}

.customer-management .form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.code-management .form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-management .form-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-editor {
    width: 100%;
    height: 400px;
}

.config-error-message {
    color: #990000;
    display: none;
    margin-top: 10px;
}

.form-group label {
    display: block;
    white-space: nowrap; /* Check password form also still looks OK with this, or split out*/
    padding-top: 6px; /* Check password form also still looks OK with this, or split out*/
    margin-bottom: 5px; /* Space between label and input */
    text-align: left; /* Align label to left of its container */
}

.form-group input, select {
    display: block;
    width: 100%; /* Use full width of parent form group */
    padding: 10px; /* Padding inside input */
    border: 1px solid #474747; /* Grey border */
    border-radius: 8px; /* Rounded corners */
    box-sizing: border-box; /* Ensure padding doesn't affect width */
    font-size: 16px; /* Font size for readability */
}

.form-group button {
    display: block;
    width: fit-content; /* Adjust width to content */
    margin-left: auto; /* Align to right */
    margin-top: 10px; /* Space above button */
    margin-bottom: 10px; /* Space below button */
}

.form-end {
    margin-top: 20px;
    margin-bottom: 20px;
    margin-left: auto; /* Centre */
    margin-right: auto; /* Centre */
    overflow: auto; /* Aiming to prevent button margin overflow */
}

/* Button styling */
.button {
    padding: 10px 20px;
    background-color: #000;
    color: #fff;
    border: none; /* Remove default border */
    border-radius: 8px; /* Rounded corners */
    cursor: pointer; /* Pointer cursor on hover */
}

.button:hover {
    background-color: #0D47A1;
}

.button:active {
    color: #474747;
}

/* Table styling */
table {
    width: 100%;
    border-collapse: collapse; /* Remove gaps between borders */
}

thead th {
    font-weight: bold;
    border-bottom: 2px solid black; /* Bold bottom border */
    padding: 10px 5px; /* Padding in table headers */
}

tbody td {
    padding: 8px 5px; /* Padding inside cells */
}

tbody tr {
    border-bottom: 1px solid black; /* Thin horizontal border between rows */
}

tbody tr:last-child {
    border-bottom: none; /* Remove border from the last row */
}

td:first-child {
    text-align: left; /* Left-align the first column */
    min-width: 180px; /* Minimum width for the first column */
}

td:not(:first-child) {
    text-align: left; /* Left-align other columns */
    padding-left: 20px; /* Left padding for indentation */
}

/* Spacing */
.input-container {
    margin-bottom: 40px; /* Space between input box and Summary table */
}

.details-container {
    margin-top: 40px; /* Space between Summary table and Details */
}

.details-container h4 {
    margin-top: 20px; /* Add space above the Details headings */
}

/* Footer link styling */
.svg-link svg {
    transition: fill 0.3s ease;
}

.svg-link svg:hover {
    fill: #62AEFB;
}

.svg-link svg:active {
    fill: #E6E6E6;
}

.obs-footer-link {
    color: white;
    transition: color 0.3s ease;
}

.obs-footer-link:hover {
    color: #62AEFB;
}

.obs-footer-link:active {
    color: #E6E6E6;
}
