/* Shared Header Card Styles - used on Dashboard and Time Tracking */

#filterCard.card {
  border: 1px solid var(--color-border-light, #e0e0e0);
  border-radius: 12px;
  box-shadow: var(--color-shadow-sm, 0 2px 4px rgba(0,0,0,0.1));
  background: #fff;
  overflow: hidden;
  width: 100%;
  margin-bottom: 1.5rem;
  /* No animations for this card */
  transform: none !important;
  will-change: auto !important;
  backface-visibility: visible !important;
  transition: none !important;
}

#filterCard .card-body {
  padding: 0.75rem 1rem;
}

/* Disable hover animations/elevations */
#filterCard.card:hover {
  box-shadow: var(--color-shadow-sm, 0 2px 4px rgba(0,0,0,0.1)) !important;
  transform: none !important;
}

/* Auto width dropdowns consistent across pages */
.auto-width-dropdown {
  width: auto;
  min-width: 150px;
}

/* Normalize header card typography across pages */
#filterCard .form-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text-muted, #6c757d);
  margin-bottom: 0.25rem;
}

#filterCard #filterTotalHours,
#filterCard #filterOutsideHours {
  font-size: 1rem; /* same as Bootstrap fs-6 */
  font-weight: 700;
}

/* Force consistent select appearance within header card regardless of page CSS */
#filterCard .form-select {
  font-size: 0.85rem; /* align with Bootstrap .form-select-sm */
  line-height: 1.4;
  height: auto;
  padding: 0.25rem 2rem 0.25rem 0.5rem; /* room for caret */
}

/* Optgroup label style for visual grouping */
#filterCard [data-role="quickActions"] optgroup,
#headerCardModal [data-role="quickActions"] optgroup {
  color: var(--color-text-muted, #6c757d);
  font-weight: 600;
}

/* Ensure muted text color is identical across pages inside the header card */
#filterCard .text-muted {
  color: var(--color-text-muted, #6c757d) !important;
}

/* Slightly increase spacing between Hours Logged and Outside Work groups */
#filterCard .d-flex.align-items-center.gap-3 {
  gap: 5rem !important; /* increased spacing between the two metric groups */
}

/* Quick Actions container appearance */
#filterCard .quick-actions-container,
#headerCardModal .quick-actions-container {
  background: linear-gradient(180deg, rgba(0,0,0,0.02), rgba(0,0,0,0.01));
  border: 1px solid var(--color-border-light, #eaeaea);
  border-radius: 12px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  position: relative; /* stacking context for z-index children */
}

/* Emphasized bottom border for clearer separation */
#filterCard .quick-actions-container,
#headerCardModal .quick-actions-container {
  border-bottom-width: 2px;
  border-bottom-color: rgba(0,0,0,0.12);
}

#filterCard .quick-actions-container:hover,
#headerCardModal .quick-actions-container:hover {
  border-color: rgba(0,123,255,0.22);
}

#filterCard .quick-actions-container:focus-within,
#headerCardModal .quick-actions-container:focus-within {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.15rem rgba(0,123,255,0.12);
  border-bottom-color: rgba(0,123,255,0.35);
}

/* Reduce top gap when header card is the first element on a page */
.main-content .container-fluid > #filterCard:first-child,
.container-fluid > #filterCard:first-child {
  margin-top: -1rem; /* pull up into the container's top padding */
}

@media (max-width: 576px) {
  .main-content .container-fluid > #filterCard:first-child,
  .container-fluid > #filterCard:first-child {
    margin-top: -0.75rem;
  }
}

/* Mobile responsiveness for header card */
@media (max-width: 576px) {
  /* Tighter padding on small screens */
  #filterCard .card-body {
    padding: 0.5rem 0.75rem;
  }

  /* Make each column stack full width */
  #filterCard .row > .col,
  #filterCard .row > .col-auto {
    width: 100% !important;
  }

  /* Full-width selects and override inline max-widths */
  #filterCard .auto-width-dropdown,
  #filterCard .form-select {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Allow text wrapping inside metric groups */
  #filterCard .text-nowrap {
    white-space: normal !important;
  }

  /* Stack Hours Logged and Outside Work vertically with smaller gap */
  #filterCard .d-flex.align-items-center.gap-3 {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem !important;
  }

  /* Make Quick Actions container full width on mobile */
  #filterCard .quick-actions-container,
  #headerCardModal .quick-actions-container {
    width: 100%;
  }
}

/* Ensure select sits above overlapping elements when expanded in some browsers */
#filterCard [data-role="quickActions"],
#headerCardModal [data-role="quickActions"] {
  position: relative;
  z-index: 2;
}

