:root {
  --dark-bg: #343a40;
  --dark-bg-hover: #495057;
  --dark-bg-darker: #23272b;
  --white: #fff;
  --red: #dc3545;
  --green: green;
  --gray-dark: #474747;
  --gray-medium: rgb(118, 118, 118);
  --gray-deleted: rgb(128, 0, 0);
  --border-color: #454d55;
  --border-color-light: #dee2e6;
  --font-family: "Exo", sans-serif;
}

/* ========== Reset & Base Styles ========== */
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  background-color: #e5e9f4;
  color: var(--white);
  line-height: 1.6;
  background-image: url(../img/bg.jpg);
  background-repeat: repeat;
  background-position: center;
}
body {
  background-color: #343a40;
  color: white;
}
pre {
  color: var(--white);
  background-color: var(--red);
}

/* ========== Containers ========== */
.container {
  margin-top: 80px; /* Adjust the top margin to ensure content is not hidden behind the navbar */
}
.container-fluid {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

/* ========== Navbar ========== */
nav.navbar {
  margin-bottom: 1rem;
}
.navbar-text-centered {
  line-height: normal;
}
.navbar .dropdown-menu {
  background-color: var(--dark-bg);
  color: var(--white);
  border: none;
}
.navbar .dropdown-item {
  color: var(--white);
  background-color: var(--dark-bg);
  cursor: pointer;
}
.navbar .dropdown-item:hover,
.navbar .dropdown-item:focus {
  background-color: var(--dark-bg-hover);
  color: var(--white);
}
.navbar .dropdown-toggle {
  color: var(--white);
  background-color: var(--dark-bg);
  border: none;
  cursor: pointer;
}

/* ========== Dropdowns ========== */
.dropdown-menu-right {
  right: 0;
  left: auto;
}

/* ========== Tables ========== */
.generic-table,
.generic-table th,
.generic-table td {
  color: var(--white);
  background-color: var(--dark-bg);
  border-color: var(--border-color);
}
.generic-table thead th {
  background-color: var(--dark-bg-darker);
  font-weight: bold;
  border-bottom: 2px solid #6c757d;
}
.generic-table tbody tr:hover {
  background-color: var(--dark-bg-hover);
  color: var(--white);
}
.table {
  width: auto;
  max-width: 80%;
  margin: 0 auto;
}
.table thead th {
  color: white;
  background-color: #343a40;
}
.table tbody td,
.table td {
  color: white;
  max-width: 200px;
  word-wrap: break-word;
  white-space: normal;
}
th,
td {
  padding: 5px;
}
table,
th,
td {
  border: 1px solid black;
  border-collapse: collapse;
  white-space: nowrap;
}
.td-top-align {
  vertical-align: top;
}
.explanation-cell {
  max-width: 400px;
  min-width: 200px;
  white-space: pre-line;
}

/* ========== Status Colors & Classes ========== */
.confirmed { background-color: var(--green); }
.unconfirmed { background-color: var(--gray-medium); }
.deleted { background-color: var(--gray-deleted); }
.status-pending {
  background-color: #dc3545 !important; color: white !important;
}
.status-acknowledged {
  background-color: #fd7e14 !important; color: white !important;
}
.status-in_progress {
  background-color: #ffc107 !important; color: #333 !important;
}
.status-delayed {
  background-color: #dc3545 !important; color: white !important;
}
.status-completed {
  background-color: #28a745 !important; color: white !important;
}
.proposed-user.confirmed {
  background-color: #28a745 !important;
  color: #fff !important;
  font-weight: bold;
  transition: background 0.2s;
}

/* ========== List Groups ========== */
.list-group-item {
  background-color: var(--gray-dark);
  color: var(--white);
}

/* ========== Modal ========== */
.modal-content {
  background-color: var(--dark-bg);
  color: var(--white);
  background-image: url(../img/bg.jpg);
}
.modal-header,
.modal-footer {
  border-color: var(--border-color-light);
}
.modal-header {
  border-bottom: 1px solid #474f57;
}
.modal-footer {
  border-top: 1px solid #474f57;
}
.modal-footer .btn,
.modal-footer .btn-secondary {
  color: var(--white);
}
.modal-footer .btn-secondary {
  background-color: var(--dark-bg-hover);
  border: none;
}
.modal-footer .btn-danger {
  background-color: var(--red);
  border: none;
}
.modal-header .btn-close {
  filter: invert(1);
}
.modal-dialog {
  max-width: 80%;
}
.modal-wide {
  max-width: 80%;
}
.bg-dark-image,
.bg-white-image {
  background-image: url('../img/bg.jpg');
  color: white;
}

/* ========== Forms ========== */
.form-control {
  background-color: #474f57;
  color: white;
  border: 1px solid #5a6268;
}
.form-control::placeholder {
  color: #ced4da;
}
.form-group label {
  color: white;
}
.form-inline .form-group {
  margin-right: 15px;
}
#role-form,
#shift-type-form {
  text-align: center;
  margin: 0 auto;
}
.input-wide {
  width: 300px;
}
.form-control,
.form-control:disabled,
.form-control[readonly] {
    background-color: #23272b;
    color: #fff;
    border-color: #454d55;
    opacity: 1;
}

/* ========== Utility Classes ========== */
.header-white,
.header-white th,
.header-white td {
  color: white;
}
.border-custom {
  border: 1px solid #383838ff;
}
.clickable {
  cursor: pointer;
}
.hidden,
.d-none {
  display: none !important;
}
.logout-button {
  padding: 0;
  border: none;
  background: none;
}
.conf-code {
  color: red;
  margin-left: 10px;
}
.export-link {
  float: right;
  margin-bottom: 10px;
}
.white-text {
  color: white !important;
}
.highlight {
  background-color: red;
}
.highlight-red {
  background-color: red !important;
}
.highlight-yellow {
  background-color: yellow !important;
  color: black !important;
}
.border-bottom-dark {
  border-bottom: 1px solid #474f57;
}
.border-top-dark {
  border-top: 1px solid #474f57;
}
.nowrap-1pct,
.nowrap {
  white-space: nowrap;
  width: 1%;
}
.ul-indented {
  padding-left: 18px;
  margin-bottom: 0.25rem;
}
.tally-card {
  min-height: 120px !important;
}
.flex-grow-1 {
  flex: 1;
}

/* ========== Match Items ========== */
.match-item {
  background-color: #343a40;
  color: white;
  border: 1px solid var(--border-color-light);
  margin-bottom: 10px;
}
.match-item strong {
  color: #000;
}

/* ========== Icon Grid ========== */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 20px;
  justify-items: center;
  align-items: center;
  height: 80vh;
}
.icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--white);
  cursor: pointer;
}
.icon-item i {
  font-size: 4rem;
}
.icon-item:hover {
  transform: scale(1.05);
  text-decoration: none;
}

/* ========== Game Container ========== */
#game-container-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 51vw;
  height: calc(51vw * 9 / 16);
  border: 5px solid var(--white);
  box-sizing: border-box;
}
#game-container,
canvas {
  width: 100%;
  height: 100%;
  position: relative;
  cursor: url('../img/crosshair.png'), auto;
}

/* ========== jQuery UI Autocomplete ========== */
.ui-autocomplete {
  background-color: #222;
  border: 1px solid #555;
  color: #eee;
  max-height: 250px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10000;
  max-width: 400px;
  width: auto !important;
  white-space: normal;
}
.ui-menu-item-wrapper {
  padding: 4px 10px;
}
.ui-menu-item-wrapper.ui-state-active {
  background-color: #005aee;
  color: white;
}

/* ========== User Card (Profile) ========== */
.user-card {
  background: #23272b;
  border-radius: 1rem;
  margin-bottom: 2rem;
  padding: 1.2rem 1.5rem;
  box-shadow: 0 2px 8px #0004;
  display: flex;
  align-items: flex-start;
}
.user-card-photo {
  min-width: 120px;
  margin-right: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.user-card-photo img {
  max-width: 110px;
  max-height: 140px;
  border-radius: 0.6rem;
  border: 2px solid #555;
  background: #222;
  object-fit: cover;
  margin-bottom: 0.5rem;
}
.user-card label {
  font-weight: 600;
  min-width: 120px;
  color: #f8f9fa;
  margin-bottom: 0;
}
.user-card-row {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.user-card-row > div {
  margin-right: 1.5rem;
  margin-bottom: 0.25rem;
}
.user-card-notes {
  margin-top: 1rem;
  color: #ccc;
  font-style: italic;
}
.id-photo-placeholder {
  opacity: 0.6;
}
.user-handle {
  font-size: 0.85em;
  color: #aaa;
}

@media (max-width: 700px) {
  .user-card { flex-direction: column; }
  .user-card-photo {
    margin-right: 0;
    margin-bottom: 1rem;
    align-items: flex-start;
  }
}

/* ========== Action Buttons ========== */
.action-buttons {
  display: flex;
  justify-content: space-around;
}
.action-buttons .btn {
  margin: 0 2px;
}

/* ========== Misc ========== */
.field-line {
  margin: 5px 0;
}
.field-name {
  font-weight: bold;
}
/* Font Awesome fix */
.fas {
  font-style: normal !important;
  display: inline-block !important;
}
.rounded-csp {
  border-radius: 5px;
}

.fs-1rem {
  font-size: 1rem;
}

.cursor-pointer {
  cursor: pointer;
}
.location-link-icon {
  display: none;
  cursor: pointer;
}

.location-link-icon.show {
  display: flex;
  /* or inline-flex, or block, as needed */
}

.location-modal-body {
  min-height: 400px;
}
.inherit-color { color: inherit !important; }
#pendingUserTable {
  table-layout: fixed; /* Fix column widths */
  width: 100%;
}

#pendingUserTable th,
#pendingUserTable td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.pending-department-dropdown,
.pending-role-dropdown,
.pending-status-dropdown {
  max-width: 140px;  /* or smaller, depending on your design */
  width: 100%;       /* fill cell width */
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.department-column {
    width: 20%;
    min-width: 208px;
}
.role-column {
    width: 10%;
    min-width: 100px;
}
.action-column {
    width: 5%;
    min-width: 95px;
}
