/* Project-specific CSS for Django Vines */
/* Bootstrap theming is now handled by custom Bootstrap SCSS build */

/* Full-width layout: add padding at xxl to make room for week navigator */
@media (min-width: 1400px) {
  #main-content {
    padding-left: 6rem;
    padding-right: 6rem;
  }
}

/* Legacy alert styles (keeping for backward compatibility) */
.alert-debug {
  color: black;
  background-color: white;
  border-color: #d6e9c6;
}

.alert-error {
  color: #b94a48;
  background-color: #f2dede;
  border-color: #eed3d7;
}

/* Global: no underline on links */
a {
  text-decoration: none;
}

/* Add any Django Vines-specific custom styles below */
/* Note: Bootstrap theming is handled in work/theming/src/bootstrap-serra-vine.scss */

/* ============================================================
   Table Action Dropdown - Show on Hover
   ============================================================ */
/* Hide dropdown by default */
.table tbody tr .dropdown {
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

/* Show dropdown on row hover or when menu is open */
.table tbody tr:hover .dropdown,
.table tbody tr .dropdown.show,
.table tbody tr .dropdown:focus-within {
  opacity: 1;
}

/* Compact dropdown button styling */
.table .dropdown .btn-link {
  line-height: 1;
}

/* Fix dropdown clipping in responsive tables */
.table-responsive {
  overflow: clip visible;
}

/* ============================================================
   Week Separators
   ============================================================ */
/* Visual separation between weeks in production request tables */
tr.week-start {
  border-top: 2px solid var(--bs-primary);
}

tr.week-start td:first-child {
  position: relative;
}

/* Week label (legacy) - CSS-only display for pages without JS selection */
tr.week-start td:first-child[data-week]::before {
  content: "Week " attr(data-week);
  position: absolute;
  top: -0.65rem;
  left: 0;
  background: white;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--bs-secondary);
  white-space: nowrap;
}

/* Week label - clickable element to select all requests in week */
.week-label {
  position: absolute;
  top: -0.65rem;
  left: 0;
  background: white;
  padding: 0 0.5rem;
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--bs-secondary);
  white-space: nowrap;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
}

.week-label:hover,
.week-label:focus {
  background-color: var(--bs-primary);
  color: white;
  outline: none;
}

/* ============================================================
   Inline Edit Popover — floats over cell without shifting layout
   ============================================================ */
.inline-edit-cell {
  position: relative;
}

.inline-edit-popover {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  z-index: 10;
  background: var(--bs-body-bg, #fff);
  border: 1px solid var(--bs-border-color, #dee2e6);
  border-radius: 0.375rem;
  padding: 0.25rem 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
}

.inline-edit-popover.text-end {
  left: auto;
  right: 0;
}

/* ============================================================
   Tracking table: phase column separator
   ============================================================ */
.phase-start {
  border-left: 1px solid var(--bs-gray-300);
}

/* ============================================================
   Sticky tab bar on schedule detail
   ============================================================ */
.nav-tabs-sticky {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--bs-body-bg, #fff);
}

/* ============================================================
   Sticky sidebar on detail pages
   ============================================================ */
.sidebar-sticky {
  position: sticky;
  top: 42px;
  align-self: flex-start;
}

/* ============================================================
   Week Navigator — compact iPhone-style scroller
   ============================================================ */
#week-navigator {
  position: fixed;
  top: 50%;
  left: 0.5rem;
  transform: translateY(-50%);
  width: 4rem;
  z-index: 100;
  padding: 0;
}

#week-navigator .nav {
  max-height: 200px;
  overflow-y: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
  mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 15%,
    black 85%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%,
    black 15%,
    black 85%,
    transparent 100%
  );
}

#week-navigator .nav::-webkit-scrollbar {
  display: none;                  /* Chrome/Safari */
}

#week-navigator .nav-link {
  font-size: 0.65rem;
  line-height: 1;
  color: var(--bs-secondary);
  white-space: nowrap;
  padding: 2px 6px;
  border-right: 2px solid transparent;
  text-align: right;
  transition: all 0.15s ease;
}

#week-navigator .nav-link:hover {
  color: var(--bs-primary);
  border-right-color: var(--bs-primary);
}

#week-navigator .nav-link.active {
  color: var(--bs-primary);
  font-weight: bold;
  font-size: 0.75rem;
  border-right-color: var(--bs-primary);
}

/* Show short label by default, full label when active */
#week-navigator .nav-link .week-full {
  display: none;
}
#week-navigator .nav-link .week-short {
  display: inline;
}
#week-navigator .nav-link.active .week-full {
  display: inline;
}
#week-navigator .nav-link.active .week-short {
  display: none;
}

#week-navigator .nav-link.loading {
  opacity: 0.5;
  pointer-events: none;
}
