/* -------------------------------------------------------------------------- */
/*                        Styles loaded via AssetMapper                       */
/* -------------------------------------------------------------------------- */

/* ----------------------------- General styles ----------------------------- */
.company-logo {
  height: 2rem;
  width: auto;
}

.links-footer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), var(--bs-light));
}

.links-footer a:hover  {
  color: var(--bs-primary-text-emphasis) !important;
}

.text-vertical {
  writing-mode: vertical-lr;
  transform: rotate(180deg);
}

#registration_form_agreeTerms + label {
  opacity: 1;
  cursor: pointer;
}

.reduce-text-modal {
  font-size: 0.8rem;
}

.reduce-text-modal h4  {
  font-size: 1.25em;
}
.reduce-text-modal h5 {
  font-size: 1.1em;
}

.text-strike-danger {
  text-decoration: line-through;
  text-decoration-color: var(--bs-danger);
  text-decoration-thickness: 1px;
}

/* --------------------------------- Tables --------------------------------- */
.table-responsive {
  padding: 1rem;
}

.table {
  margin-bottom: 0;
}

/* col-limit = 60% / nº cols */
.col-limit-3 {
  width: 20%;
  max-width: max-content;
  white-space: nowrap;
}

.col-limit-4 {
  width: 15%;
  max-width: max-content;
  white-space: nowrap;
}

.col-limit-5 {
  width: 12%;
  max-width: max-content;
  white-space: nowrap;
}

.col-limit-name-sticky {
  position: sticky;
  left: 0;
  margin-left: 0;
  max-width: 10%;
}

.max-width-0 {
  max-width: 0;
}

@media (max-width: 768px) {
  .table {
    font-size: 0.875rem;
  }

  /* .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  } */

  .col-limit-3, .col-limit-4, .col-limit-5 {
    width: 1%;
  }
  .col-limit-name-sticky {
    max-width: 0;
  }
}

/* --------------------------- Login and register --------------------------- */
@media (min-width: 576px) {
  .login-fixed-width-sm {
    width: 400px;
  }
  .register-fixed-width-sm {
    width: 400px;
  }
}
/* ---------------------------------- Forms --------------------------------- */
.form-group {
  margin-bottom: 1rem;
}

/* ----------------------- Native app look for mobile ----------------------- */
@media (max-width: 768px) {
  .navbar {
    padding-top: env(safe-area-inset-top);
    /* background-color: rgba(255, 255, 255, 0.95) !important; */
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  /* .btn {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
  } */

  /* .card {
    margin: 1rem -0.75rem;
  } */
}

.clickable-row {
  cursor: pointer;
}

/* ------------------------------ Custom error ------------------------------ */
.is-invalid-group {
  outline: 1px solid red;
}

.is-invalid-group
.is-invalid-group .invalid-feedback {
  display: block;
  color: red;
  margin-top: 5px;
  font-size: 0.875em;
}
/*
.is-valid {
  border-color: #28a745 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2328a745' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.is-invalid {
  border-color: #dc3545 !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}
*/
.invalid-feedback {
  display: none;
  color: #dc3545;
  font-size: 0.875em;
}

.is-invalid ~ .invalid-feedback {
  display: block;
}

/* --------------------- Custom toggle visibility button -------------------- */
.form-group.password-container {
  position: relative;
}

.toggle-password {
  position: absolute;
  right: 10px;
  top: 70%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.2rem;
  user-select: none;
  display: none;
}

/* Hide the default toggle button in Edge */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear {
    display: none;
}

/* -------------------------- Username suggestions -------------------------- */
[data-registration-form-target="suggestions"] .list-group-item {
  transition: background-color 0.2s;
}

[data-registration-form-target="suggestions"] .list-group-item:hover {
  background-color: #f8f9fa;
}

/* ------------------------------- Map styles ------------------------------- */
.leaflet-tooltip {
    pointer-events: auto !important;
}

.cluster-tooltip-scrollable {
    pointer-events: auto;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
    user-select: auto;
    overflow-y: auto;
}

.cluster-tooltip-scrollable::-webkit-scrollbar {
    width: 8px;
}

.cluster-tooltip-scrollable::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cluster-tooltip-scrollable::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.cluster-tooltip-scrollable::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Tooltip styles */
.tooltip-inner {
  max-width: 300px;
  max-height: 50vh;
  overflow-y: auto;
  text-align: left;
  background-color: #343a40;
  padding: 10px;
  border-radius: 6px;
}

.tooltip.bs-tooltip-auto .tooltip-inner {
  font-size: 0.9rem;
}

.tooltip .list-unstyled li {
  margin-bottom: 8px;
}

.tooltip .btn-sm {
  color: #fff;
  padding: 2px 8px;
  font-size: 0.8rem;
}

.marker-wrapper:hover .marker-icon {
  filter: brightness(1.5);
}
/* ---------------------------- Daily Note Marker --------------------------- */

.dailyRecordMarker {
  font-size: 0.8rem;
  bottom: 25%;
  left:  2vw;
}

@media (max-width: 768px) {
  .dailyRecordMarker {
    bottom: 0;
    left: auto;
    right: -.5rem;
  }
}

/* -------------------------- Button Notifications -------------------------- */
.btn-notification-badge {
    transform: translate(-50%, -50%) scale(0.8);
    top: 0;
    left: 50%;
    padding: 2px 1px;
    z-index: 2;
}

/* ----------------------------- Disabled Anchor ---------------------------- */
.disabled-anchor {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.65;
}

/* ------------------------------- Worker Card ------------------------------ */

@media (max-width: 768px) {
  .worker-card {
    max-height: fit-content;
  }
}


/* ----------------------------- Navbar sections ---------------------------- */
.navbar-section-center {
    flex: 1; /* Occupy remaining space */
    max-width: 100%;
    overflow: hidden;
}

/* Logo */
.navbar-company-logo {
    height: 30px;
    width: auto;/* Keeps aspect ratio */
    max-height: 30px;
    object-fit: contain;
}

/* Text truncation */
.truncate-wrapper {
  width: 100%;
  overflow: hidden;
}

.username-text {
  display: inline-block; /* Required for truncation to work */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Icon size */
.navbar-icon {
    font-size: 1.25rem;
}

/* Mobile settings (< 768px) */
@media (max-width: 767.98px) {
    .navbar-brand {
        font-size: 1rem;
        line-height: 1;
    }

    .navbar-company-logo {
        height: 25px;
        max-height: 25px;
    }

    .navbar-btn-sm {
        padding: 0.25rem 0.5rem;
    }

    /* Strict vertical alignment */
    .navbar-section-left,
    .navbar-section-center,
    .navbar-section-right {
        height: 100%;
    }

    .navbar-brand,
    .navbar-btn {
        display: flex;
        align-items: center;
        height: 100%;
    }

    /* Truncate username text on mobile */
    .navbar-section-right {
        min-width: 0; /* Allow shrinking */
    }

    .truncate-wrapper {
        min-width: 0;
        flex-shrink: 1;
    }

    .username-text {
        min-width: 0;
        flex-shrink: 1;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Settings for larger displays (≥ 768px) */
@media (min-width: 768px) {
    .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-company-logo {
        height: 30px;
        max-height: 30px;
    }
}

/* Settings for small widths */
@media (max-width: 576px) {
  .navbar-company-logo {
      height: 20px;
      max-height: 20px;
  }

  .navbar-brand {
      font-size: 1rem;
  }
}

/* Settings for very small widths */
@media (max-width: 300px) {
  .navbar-company-logo {
      display: none; /* Hide logo on extreme widths */
  }

  .navbar-brand {
      font-size: 0.9rem;
  }

  .navbar-icon {
      font-size: 1rem;
  }

  .username-text {
    margin-left: 0.5rem; /* Small margin to better center text */
  }
}

/* --------------------------------- Alerts --------------------------------- */
#flash-messages-container {
  z-index: 9999;
}
.alert-danger {
  --bs-alert-bg: rgba(var(--bs-danger-bg-subtle-raw), var(--alert-transparency));
}
.alert-success {
  --bs-alert-bg: rgba(var(--bs-success-bg-subtle-raw), var(--alert-transparency));
}
.alert-warning {
  --bs-alert-bg: rgba(var(--bs-warning-bg-subtle-raw), var(--alert-transparency));
}
.alert-info {
  --bs-alert-bg: rgba(var(--bs-info-bg-subtle-raw), var(--alert-transparency));
}
.alert {
  backdrop-filter: blur(1rem);
}

.notyf__toast {
  backdrop-filter: blur(1rem);
  border-radius: 0 !important;
  font-family: var(--bs-font-sans-serif);
}
.notyf__wrapper {
  max-height: 80vh;
}
.notyf__message {
  max-height: 80vh;
  overflow-y: auto;
}
.notyf__message::-webkit-scrollbar {
  width: 8px;
}
.notyf__message::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
}
.notyf__message::-webkit-scrollbar-track {
  background-color: transparent;
}
.notyf__toast--success {
  background: rgba(var(--bs-success-bg-subtle-raw), var(--alert-transparency));
  /* color: var(--bs-success-text); */
}
.notyf__toast--success .notyf__ripple {
  background-color: rgba(var(--bs-success-rgb), .75) !important;
}
.notyf__toast--error {
  background: rgba(var(--bs-danger-bg-subtle-raw), var(--alert-transparency));
  color: var(--bs-danger-text);
}
.notyf__toast--error .notyf__ripple {
  background-color: rgba(var(--bs-danger-rgb), .75) !important;
}
.notyf__toast--warning {
  background: rgba(var(--bs-warning-bg-subtle-raw), var(--alert-transparency));
  color: var(--bs-dark);
}
:root[data-bs-theme="dark"] {
  .notyf__toast--warning {
    color: var(--bs-white);
  }
}
.notyf__toast--warning .notyf__ripple {
  background-color: rgba(var(--bs-warning-rgb), .75) !important;
}
.notyf__toast--info {
  background: rgba(var(--bs-info-bg-subtle-raw), var(--alert-transparency));
  color: var(--bs-info-text);
}
.notyf__toast--info .notyf__ripple {
  background-color: rgba(var(--bs-info-rgb), .75) !important;
}
.notyf__toast__dismiss-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: inherit;
  opacity: 0.5;
}

/* --------------------------- Vacation & Extra Hours view -------------------------- */
.vacation-total { color: var(--bs-info); }
.vacation-approved { color: var(--bs-success); }
.vacation-pending { color: var(--bs-warning); }
.vacation-available { color: var(--bs-purple); }
.vacation-previous-year { color: var(--bs-primary); }

.vacationDayMarker {
  font-size: 0.8rem;
  bottom: 50%;
  left:  2vw;
}

.extra-hours-day {
  display: grid;
  grid-template-columns: 80px 50px;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.extra-hours-day-name {
  text-align: left;
}

.extra-hours-day-number {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.25rem;
}

@media (max-width: 768px) {
  .extra-hours-day {
    display: flex;
    justify-content: space-evenly;
  }

  .extra-hours-day-number {
    display: inline;
  }

  .vacationDayMarker {
    top: .5rem;
    left: auto;
    right: -.5rem;
  }
}

/* ---------------------------------- Help ---------------------------------- */
.help-icon {
  transition: all 0.3s ease;
  cursor: pointer;
}

.help-icon:hover {
  transition: all 0.3s ease;
  color: var(--bs-primary);
}

.help-icon-navbar {
  transition: all 0.3s ease;
  color: var(--bs-primary);
  cursor: pointer;
}

.help-icon-navbar:hover {
  transition: all 0.3s ease;
  background-color: var(--bs-secondary);
  color: var(--bs-primary);
}

[data-bs-theme=dark] .help-icon-navbar {
  color: #adb5bd;
}

[data-bs-theme=dark] .help-icon-navbar:hover {
  background-color: #adb5bd;
  color: #212529;
}

/* ---------------------------- Subscription Plan --------------------------- */
.plan-card {
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
.plan-card:hover {
    transform: translateY(-5px);
    border-color: var(--bs-info-bg-subtle);
    transition: all 0.3s ease;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}
.plan-card.active {
    border-color: var(--bs-blue); /* Primary color? */
    background-color: #f8f9fa; /* Light? */
}
.billing-cycle-select .btn-check:checked + .btn-outline-primary {
    background-color: var(--bs-blue);
    color: white;
}
.feature-item {
    transition: all 0.2s ease;
    position: relative; /* Ensure proper positioning for ghost element */
}
.drag-handle {
    cursor: grab;
    touch-action: none; /* Prevent scrolling during touch */
    padding: 8px; /* Larger touch target */
}
.feature-item.dragging {
    opacity: 0.75;
    background-color: var(--bs-info);
    transition: all 0.2s ease;
}
.feature-item .drag-handle {
    transition: all 0.5s ease;
}
.feature-item:hover .drag-handle {
    background-color: var(--bs-info) !important;
    transition: all 0.3s ease;
}
.collection-widget {
    position: relative;
}
.dragging-ghost {
    opacity: 0.75;
    background-color: var(--bs-dark);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    pointer-events: none; /* Prevent interaction with ghost element */
}

/* ------------------------- Request Conflict Indicators ------------------------- */
.has-conflicts {
    background-color: rgba(var(--bs-warning-rgb), 0.1) !important;
    /* Subtle animation for conflict rows */
    transition: background-color 0.3s ease;
}

.has-conflicts:hover {
    background-color: rgba(var(--bs-warning-rgb), 0.15) !important;
}

.conflict-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    animation: pulse-warning 2s ease-in-out infinite;
}

.conflict-icon {
    font-size: 1rem;
    animation: pulse-warning 2s ease-in-out infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* ------------------------------- Collapse Icon ------------------------------ */
[data-collapse-header] {
  cursor: pointer;
}