/*** TWF CSS ***/

/* HTML, BODY, BASIC STYLES */
html, body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Main center container */
#layout {
  display: flex;
  flex-direction: row;
  flex: 1;
  height: 100%;
}

#layout, .container-fluid, .d-flex {
  flex: 1;
  align-items: stretch;
}

.btn-ext {
    background-color: #848484;
    color: white;
}

.btn-ext::before {
  content: ""; /* nothing by default */
}

.btn-ext:hover::before {
  content: "\f35d"; /* Unicode for FontAwesome icon (here: fa-search) */
  font-family: "Font Awesome 6 Free";
  font-weight: 900; /* 400 for regular, 900 for solid icons */
  margin-right: 0.5em;
  color: #aaa;
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.content {
  flex: 1;  /* This makes the content expand to fill available space, pushing the footer down */
}

h1 {
    margin-top: .3rem;
    color: #454545;
    font: 1.7em "Raleway", sans-serif;
    letter-spacing: 2px;
}

h1::after {
  content: '';
  display: block;
  margin-top: 0.25rem;
  border-bottom: 1px solid #ccc;
}

h2 {
    margin-top: 1rem;
    color: #454545;
    font: 1.5em "Raleway", sans-serif;
    letter-spacing: 2px;
}

h2::after {
  content: '';
  display: block;
  margin-top: 0.25rem;
  margin-right: 50px;
  border-bottom: 1px solid #ccc;
}

.lead {
    font-style: italic;
}

.text-small {
    font-size: 0.75em;  /* Adjust this value as needed */
}

.nav-link {
    font-size: 0.9em;
}

.side-item:hover {
    background-color: #a18d7b !important;
}

.side-item a:hover {
    color: #fff !important;
}

.top-item:hover .nav-link {
    text-decoration: underline;
}

/******************************************************************************/
/* Default page links */
/* Default page links */
.pagination .page-link {
  color: #212529; /* Bootstrap dark */
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 0; /* Optional: square look */
  padding: 0.4em 0.75em;
}

/* Hover effect */
.pagination .page-link:hover {
  background-color: #e9ecef;
  color: #000;
}

/* Active page */
.pagination .page-item.active .page-link {
  background-color: #212529; /* dark */
  color: white;
  border-color: #212529;
  font-weight: 600;
}

/* Disabled pages */
.pagination .page-item.disabled .page-link {
  color: #6c757d;
  background-color: #f1f3f5;
  border-color: #dee2e6;
}



/* Footer */

footer.footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  background-color: #f8f9fa;
  padding: 10px 0;
  box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.text-right {
    text-align: right;
}


/* clickable image */
.img-clickable {
    transition: transform 0.3s ease;  /* Smooth transition when enlarging */
    cursor: pointer;
}

/* Enlarged image will take the full viewport */
.img-enlarged {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    z-index: 9999;  /* Ensure the image appears on top */
}

.inline-form {
    width: 100%;
}

/* Each form group aligns inline and has flexible width */
.inline-form .form-group {
    display: flex;
    align-items: center;
    flex-grow: 1;
    margin-right: 10px;
}

.inline-form .form-group label {
    margin-right: 5px;
    white-space: nowrap;  /* Prevent label from wrapping */
}

/* Adjust checkbox and submit button sizing */
.inline-form .checkbox-group,
.inline-form .submit-group {
    flex-grow: 0;
    margin-right: 10px;
}


/* Bordered box */
.bordered-box {
    position: relative;          /* Allows positioning of the label */
    border: 1px solid #333;      /* Define the border */
    padding: 20px;               /* Inner padding for content */
    margin-top: 10px;
}

.box-label {
    position: absolute;
    top: -10px;                  /* Move label above the border */
    left: 20px;                  /* Position the label horizontally */
    background-color: #fff;      /* Background to cover border underneath */
    padding: 0 5px;              /* Small padding on sides */
    font-weight: bold;           /* Optional: make label bold */
}

/* Custom Table */
.annotations-row {
    background-color: #f9f9f9;
    font-size: 0.9rem;
}

/* Annotations Container */
.annotations-container {
    max-width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box; /* Ensures padding does not break max-width */
}

/* Annotation Items */
.annotation-item {
    display: inline-block;
    margin-right: 20px;
    text-align: center;
    vertical-align: top;
    font-size: 0.8rem; /* Smaller font for annotations */
}

/* Annotation Image */
.annotation-item img {
    max-width: 100px;
    max-height: 100px;
    display: block;
    margin: 0 auto 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

/* Text in Annotation Items */
.annotation-item p {
    margin: 0;
    font-size: 0.8rem; /* Adjust font size for annotation text */
}

.annotation-item small {
    font-size: 0.7rem; /* Even smaller for secondary info like type */
}

/* Ensure the table respects screen width */
.table {
    width: 100%;
    table-layout: fixed; /* Prevent table columns from resizing */
}


tr[data-bs-toggle="collapse"] {
    cursor: pointer;
}

tr[data-bs-toggle="collapse"]:hover {
    background-color: #f1f1f1;
}

/********** HELP OVERLAY STYLING **************/

/* Help overlay */
.help-overlay {
    position: fixed;
    top: 0;
    right: -550px; /* Initially hidden */
    width: 500px;
    height: 100%;
    box-shadow: -3px 0 10px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease-in-out;
    z-index: 999;
    font-family: "Arial", sans-serif;
    background-color: #eaeff5;
}

.helpHeader {
    display: flex;
    align-items: center;
}

/* Help overlay content */
.help-content {
    padding: 20px;
    height: 100%;
    overflow-y: auto;
}

.help-content h1 {
    font-size: 1.5rem;
}

.help-content h2 {
    font-size: 1.5rem;
}

/* Style help links as badges with icons */
.help-link {
    display: inline-flex;
    align-items: center;
    background-color: #343a40;
    color: white;
    padding: 5px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    text-decoration: none;
    margin-right: 5px;
}

.help-link i {
    margin-right: 4px;
}

/* Hover effect */
.help-link:hover {
    background-color: #1d2124;
    color: white;
    text-decoration: none;
}

/* Close button */
.close-help {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #343a40; /* Bootstrap danger color */
    border: none;
    color: white;
    border-radius: 50%; /* Make it round */
    font-size: 18px;
    cursor: pointer;
    margin-right: 10px; /* Space between button and links */
}

.close-help:hover {
     background-color: #1d2124; /* Darker red on hover */
}

/* Show overlay */
.help-overlay.show {
    right: 0;
}

/*** SIDEBAR STYLING ***/
.sidebarToggle button {
    background-color: #343a40;
    color: white;
    padding: 0px 5px;
    margin: 0 10px 0 0;
    cursor: pointer;
}

/* Sidebar Default Width */
#sidebar-container {
    width: 200px;
    min-width: 200px;
    max-width: 200px;
    transition: width 0.3s ease-in-out;
    overflow: hidden;

    height: auto; /* reset if previously 100% */
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #212529;
}

/* Sidebar Collapsed */
#sidebar-container.collapsed {
    width: 0;
    min-width: 0;
    max-width: 0;
    padding: 0;
    margin: 0;
    border: none;
}

/* Content Container (Main Content) */
#content-container {
    flex-grow: 1;
    transition: margin-left 0.3s ease-in-out;
    overflow-x: hidden;
}

/* Adjust Content When Sidebar is Collapsed */
#sidebar-container.collapsed + #content-container {
    width: calc(100% - 50px); /* When sidebar is collapsed */
}


/******* PROGRESS BAR *******************************/
/* Custom animation for pending state */
.progress-bar-striped.progress-bar-animated {
    background-color: #333; /* Dark Grey/Black */
    background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%,
                                      transparent 50%, rgba(255,255,255,0.15) 50%,
                                      rgba(255,255,255,0.15) 75%, transparent 75%, transparent);
    background-size: 40px 40px;
    animation: progress-animation 1s linear infinite;
}

/* Optional: Custom animation speed */
@keyframes progress-animation {
    from { background-position: 0 0; }
    to { background-position: 40px 0; }
}


/* TWF BreadCrumb */
.breadcrumb {
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    margin-left: 0;
}

.breadcrumb-item a {
    color: whitesmoke;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.badge-table {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 0.15em 0.4em;
  background-color: #e6e6e6;
  color: #444;
  border-radius: 0.25rem;
  margin-right: 0.25rem;
  white-space: nowrap;
}


/******* DJANGO-TABLES2 SORTING INDICATORS *******************************/

/* Make sortable column headers visually distinct */
th.orderable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

th.orderable:hover {
    background-color: #f8f9fa;
}

/* Add sort indicator space after sortable headers */
th.orderable a {
    padding-right: 20px;
    position: relative;
    display: inline-block;
    color: inherit;
    text-decoration: none;
}

th.orderable a:hover {
    text-decoration: none;
    color: #212529;
}

/* Ascending sort indicator (▲) */
th.orderable.asc a::after {
    content: " \25B2"; /* Unicode up triangle */
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: #212529;
    font-weight: bold;
}

/* Descending sort indicator (▼) */
th.orderable.desc a::after {
    content: " \25BC"; /* Unicode down triangle */
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: #212529;
    font-weight: bold;
}

/* Subtle indicator for unsorted but sortable columns */
th.orderable:not(.asc):not(.desc) a::after {
    content: " \25B4"; /* Unicode up triangle outline */
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    color: #ccc;
    opacity: 0.5;
}

/* Show indicator more prominently on hover */
th.orderable:not(.asc):not(.desc):hover a::after {
    color: #999;
    opacity: 1;
}

/* Highlight currently sorted column */
th.orderable.asc,
th.orderable.desc {
    background-color: #f8f9fa;
    font-weight: 600;
}

