/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.pagination .page, .pagination .next, .pagination .last, .pagination .prev, .pagination .first {
  margin: 0 2px;
  padding: 6px 12px;
  border: 0px solid #dee2e6;
  border-radius: 4px;
  text-decoration: none;
}

.pagination .current {
    color: #007bff;
}

  body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fc;
    color: #333;
    scroll-behavior: smooth;
  }

 .sort-link {
    color: inherit; /* Keeps the text color matching the surrounding text */
    text-decoration: none; /* Removes the default underline */
  }
  
  .sort-link:hover {
    color: #6c757d; /* Light grey on hover */
  }

  .vendor-actions, .customer-actions {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

  .vendor-card:hover .vendor-actions,  .customer-card:hover .customer-actions {
      opacity: 1;
  }

  .vendor-card-link,  .customer-card-link {
    display: block;
  }

  .vendor-card-link .vendor-actions, .customer-card-link .customer-actions  {
    pointer-events: auto;
  }

  .btn-xs {
    font-size: 12px;
    padding: 3px 8px;
}

.search-input {
  max-width: 300px; /* Restrict width for better alignment */
}

.form-select {
  max-width: 250px; /* Restricts dropdown width */
}

@media (min-width: 768px) {
  .input-group {
    float: right; /* Aligns inputs to the right */
  }
}

/* Flash alerts responsive margin */
@media (min-width: 768px) {
  .flash-container {
    margin-right: 2rem; /* Adjust this value as needed */
  }
}

/* Week Breakdown Dashboard Styles - Compact Version */
.week-breakdown-card {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.week-breakdown-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.week-breakdown-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px 8px 0 0;
}

/* New White Header Styles */
.week-overview-header {
  background: #ffffff;
  border-bottom: 3px solid #e9ecef;
  border-radius: 8px 8px 0 0;
}

.week-overview-title {
  color: #343a40;
  font-size: 1.5rem;
  font-weight: 700;
}

.week-date-range {
  color: #6c757d;
  font-size: 1rem;
  font-weight: 500;
}

.week-total-hours {
  color: #007bff;
  font-weight: 800;
}

.week-projects-count {
  color: #6c757d;
  font-size: 0.9rem;
}

.week-day-card {
  transition: all 0.2s ease;
  border-radius: 6px;
  overflow: hidden;
  min-height: 140px;
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  border: 1px solid #dee2e6;
}

.week-day-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.week-day-card.today {
  border: 2px solid #007bff;
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.week-day-card .day-today {
  color: #ffffff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Improved Weekday Header Styles */
.weekday-header {
  min-height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.weekday-name {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.today-star {
  font-size: 0.7rem;
  margin-left: 4px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.weekday-date {
  font-weight: 500;
}

.project-icons-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.project-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  padding: 1px 4px;
  width: 100%;
  max-width: 80px;
}

.project-icon {
  flex-shrink: 0;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-name-text {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.time-breakdown {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2px;
  margin-top: 4px;
}

.project-badge {
  font-size: 0.5rem;
  padding: 0.1em 0.3em;
  border-radius: 8px;
  font-weight: 500;
  margin: 0.05em;
  display: inline-block;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.today-occurrence-card {
  border-radius: 6px;
  border-left: 3px solid #007bff;
  transition: all 0.2s ease;
}

.today-occurrence-card:hover {
  transform: translateX(2px);
  box-shadow: 0 1px 6px rgba(0, 123, 255, 0.1);
}

.badge-sm {
  font-size: 0.65rem;
  padding: 0.25em 0.5em;
}

/* Enhanced Today's Schedule Styles */
.today-schedule-section {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
}

.today-activity-card {
  background: #ffffff;
  border-radius: 8px;
  border-left: 4px solid #007bff;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.today-activity-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 12px rgba(0, 123, 255, 0.1);
  border-left-color: #0056b3;
}

.customer-icon-wrapper {
  position: relative;
}

.customer-icon-today {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid #e9ecef;
}

.customer-icon-placeholder {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.2rem;
}

.time-block {
  background: rgba(0, 123, 255, 0.05);
  border-radius: 6px;
  padding: 0.75rem;
  border: 1px solid rgba(0, 123, 255, 0.1);
}

.contact-info {
  font-size: 0.8rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* Enhanced Projects and Customers Grid Styles */
.projects-grid,
.customers-grid {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-card-mini,
.customer-card-mini {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 6px;
  padding: 0.75rem;
  transition: all 0.2s ease;
}

.project-card-mini:hover,
.customer-card-mini:hover {
  background: #f8f9fa;
  border-color: #007bff;
  transform: translateX(2px);
}

.project-icon-mini,
.customer-icon-mini {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  flex-shrink: 0;
}

.project-mini-img,
.customer-mini-img {
  width: 24px;
  height: 24px;
  border-radius: 3px;
  object-fit: cover;
}

.project-mini-name,
.customer-mini-name {
  font-size: 0.85rem;
  line-height: 1.2;
}

.project-mini-customer,
.customer-mini-location {
  font-size: 0.75rem;
  line-height: 1.1;
}

.more-projects-indicator,
.more-customers-indicator {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.8rem;
  border: 1px dashed #dee2e6;
  border-radius: 6px;
  background: #fafafa;
}

.more-projects-indicator:hover,
.more-customers-indicator:hover {
  background: #f0f0f0;
  border-color: #007bff;
}

/* Compact responsive adjustments */
@media (max-width: 768px) {
  .week-day-card {
    margin-bottom: 0.25rem;
    min-height: 110px;
  }
  
  .week-day-card .fw-bold {
    font-size: 0.8rem !important;
  }
  
  .project-badge {
    font-size: 0.45rem;
    max-width: 50px;
  }
  
  .today-occurrence-card {
    margin-bottom: 0.5rem;
  }
  
  .week-breakdown-header h4 {
    font-size: 1.1rem;
  }
  
  .week-overview-title {
    font-size: 1.2rem !important;
  }
  
  .week-date-range {
    font-size: 0.85rem !important;
  }
  
  .week-total-hours {
    font-size: 1.5rem !important;
  }
  
  .project-item {
    max-width: 70px;
  }
  
  .project-name-text {
    font-size: 0.5rem !important;
  }
  
  .project-icon {
    width: 10px !important;
    height: 10px !important;
  }
  
  .today-activity-card {
    margin-bottom: 0.75rem;
  }
  
  .today-activity-card .row {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .today-activity-card .col-md-2,
  .today-activity-card .col-md-5 {
    flex: 0 0 auto;
    width: 100%;
  }
  
  .customer-icon-today,
  .customer-icon-placeholder {
    width: 32px;
    height: 32px;
  }
  
  .time-block {
    padding: 0.4rem;
    margin: 0.25rem 0;
    text-align: left !important;
  }
  
  .contact-info {
    margin-top: 0.25rem;
    font-size: 0.75rem;
  }
  
  .project-card-mini,
  .customer-card-mini {
    padding: 0.5rem;
  }
  
  .project-icon-mini,
  .customer-icon-mini {
    width: 24px;
    height: 24px;
  }
  
  .project-mini-img,
  .customer-mini-img {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 576px) {
  .week-day-card .fw-bold {
    font-size: 0.7rem !important;
  }
  
  .week-day-card {
    min-height: 100px;
  }
  
  .week-overview-title {
    font-size: 1rem !important;
  }
  
  .week-date-range {
    font-size: 0.75rem !important;
  }
  
  .week-total-hours {
    font-size: 1.3rem !important;
  }
  
  .weekday-name {
    font-size: 0.8rem !important;
  }
  
  .today-star {
    font-size: 0.6rem !important;
  }
  
  .today-schedule-section {
    padding: 1rem !important;
  }
  
  .today-activity-card .row {
    flex-direction: column;
  }
  
  .today-activity-card .col-md-3,
  .today-activity-card .col-md-6 {
    margin-bottom: 0.5rem;
  }
}

/* Remove large container styles and make everything more compact */
.stats-card {
  background: none;
  border-radius: 0;
  padding: 0;
}

/* Section Header Styles */
.section-header {
  border-bottom: 1px solid #e9ecef;
  padding-bottom: 0.5rem;
}

.section-header h6 {
  font-size: 0.9rem;
  letter-spacing: 0.025em;
}

.section-header i {
  font-size: 0.85rem;
}

/* Custom Login Background Support */
.auth-main .auth-wrapper.v3 .auth-form {
  /* Default background - will be overridden if custom image is set via inline style */
  background-image: url("../images/authentication/login.png");
  background-repeat: no-repeat;
  background-size: auto 75%;
  background-position: left center;
  min-height: 100vh;
}

/* When custom background is set via inline style, use same sizing as default */
.auth-main .auth-wrapper.v3 .auth-form[style*="background-image"] {
  background-repeat: no-repeat;
  background-size: auto 60%;
  background-position: left 3em center !important;
  min-height: 100vh;
  /* For SVG compatibility */
  background-attachment: scroll;
}

/* Specific handling for SVG backgrounds */
.auth-main .auth-wrapper.v3 .auth-form[style*=".svg"] {
  background-size: auto 20% !important;
  background-repeat: no-repeat !important;
  background-position: left 3em center !important;
}

/* Ensure the auth-main and auth-wrapper take full height */
.auth-main {
  min-height: 100vh;
}

.auth-main .auth-wrapper.v3 {
  min-height: 100vh;
}

/* Vendor Select Dropdown Styles */
[data-controller*="vendor-select"] .dropdown-menu {
  max-width: 100%;
  min-width: 100%;
}

[data-controller*="vendor-select"] .dropdown-menu.show {
  display: block;
}

[data-controller*="vendor-select"] .dropdown-item {
  cursor: pointer;
  display: flex;
  align-items: center;
}

[data-controller*="vendor-select"] .dropdown-item:hover {
  background-color: #f2f4f6;
}

[data-controller*="vendor-select"] .dropdown-item.active {
  background-color: #0d6efd;
  color: white;
}

[data-controller*="vendor-select"] .dropdown-item.active:hover {
  background-color: #0b5ed7;
  color: white;
}

[data-controller*="vendor-select"] .dropdown-toggle.text-muted {
  color: #a1a7ac !important;
}

[data-controller*="vendor-select"] .dropdown-toggle {
  display: flex;
  align-items: center;
  height: calc(1.5em + 0.75rem + 2px); /* Match Bootstrap form-control height */
  padding: 1.3rem 0.75rem; /* Match Bootstrap form-control padding */
  line-height: 1.5; /* Match Bootstrap form-control line-height */
}

[data-controller*="vendor-select"] .dropdown-toggle img,
[data-controller*="vendor-select"] .dropdown-item img {
  border-radius: 3px;
}

/* Create vendor form inside dropdown */
[data-controller*="vendor-select"] [data-profiles--vendor-select-target="createForm"] {
  background-color: #f8f9fa;
}

[data-controller*="vendor-select"] [data-profiles--vendor-select-target="createForm"] h6 {
  color: #212529;
  font-weight: 600;
}

/* Customer Select Dropdown Styles */
[data-controller*="customer-select"] .dropdown-menu {
  max-width: 100%;
  min-width: 100%;
  position: absolute;
  z-index: 1056; /* Higher than Bootstrap modal (1055) */
}

[data-controller*="customer-select"] .dropdown-menu.show {
  display: block;
}

/* Allow dropdown to overflow the modal */
[data-controller*="customer-select"] {
  position: relative;
}

/* Ensure parent column allows overflow */
.modal-body [data-controller*="customer-select"] .dropdown {
  position: static;
}

.modal-body .col-md-6:has([data-controller*="customer-select"]) {
  overflow: visible;
}

[data-controller*="customer-select"] .dropdown-item {
  cursor: pointer;
  display: flex;
  align-items: center;
}

[data-controller*="customer-select"] .dropdown-item:hover {
  background-color: #f2f4f6;
}

[data-controller*="customer-select"] .dropdown-item.active {
  background-color: #0d6efd;
  color: white;
}

[data-controller*="customer-select"] .dropdown-item.active:hover {
  background-color: #0b5ed7;
  color: white;
}

[data-controller*="customer-select"] .dropdown-toggle.text-muted {
  color: #a1a7ac !important;
}

[data-controller*="customer-select"] .dropdown-toggle {
  display: flex;
  align-items: center;
  height: calc(1.5em + 0.75rem + 2px); /* Match Bootstrap form-control height */
  padding: 1.3rem 0.75rem; /* Match Bootstrap form-control padding */
  line-height: 1.5; /* Match Bootstrap form-control line-height */
}

[data-controller*="customer-select"] .dropdown-toggle img,
[data-controller*="customer-select"] .dropdown-item img {
  border-radius: 3px;
}

/* Create customer form inside dropdown */
[data-controller*="customer-select"] [data-projects--customer-select-target="createForm"] {
  background-color: #f8f9fa;
}

[data-controller*="customer-select"] [data-projects--customer-select-target="createForm"] h6 {
  color: #212529;
  font-weight: 600;
}


/* Profile form accordion */
#profileDetailsAccordion .accordion-button {
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
}

#profileDetailsAccordion .accordion-button:not(.collapsed) {
  background-color: #e7f3ff;
  color: #0d6efd;
}

#profileDetailsAccordion .accordion-body {
  padding: 1.25rem;
}

/* Profile & User Select Dropdown Styles */
[data-controller*="profile-select"] .dropdown-menu,
[data-controller*="user-select"] .dropdown-menu {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

[data-controller*="profile-select"] .dropdown-item,
[data-controller*="user-select"] .dropdown-item {
  transition: all 0.2s ease;
  border-radius: 0.25rem;
  margin: 0.125rem 0.5rem;
  padding: 0.5rem;
}

[data-controller*="profile-select"] .dropdown-item:hover,
[data-controller*="user-select"] .dropdown-item:hover {
  background-color: #f8f9fa;
}

[data-controller*="profile-select"] .dropdown-item.active,
[data-controller*="user-select"] .dropdown-item.active {
  background-color: #0d6efd;
  color: white;
}

[data-controller*="profile-select"] .dropdown-item.active .badge {
  background-color: rgba(255, 255, 255, 0.2) !important;
  color: white;
}

[data-controller*="profile-select"] .dropdown-item.active .text-muted,
[data-controller*="user-select"] .dropdown-item.active .text-muted {
  color: rgba(255, 255, 255, 0.8) !important;
}

[data-controller*="profile-select"] .dropdown-toggle,
[data-controller*="user-select"] .dropdown-toggle {
  min-height: 42px;
}

