/* Vans views: van cards (views/vans/vans.js) and reservation grid (views/vans/availability.js) */
.vans-view {
  --van-color-0: #1f5f9f;
  --van-color-1: #c0392b;
  --van-color-2: #2e8b57;
  --van-color-3: #8e44ad;
}

/* Van cards: one content-panel per van (photo floated left, characteristics beside it) */
.van-card .content-panel-body {
  overflow: hidden; /* contains the floated photo */
}

.van-photo {
  float: left;
  width: 300px;
  max-width: 100%;
  height: auto;
  margin: 5px var(--spacing-md) 5px 0;
}

/* Own block formatting context: the list sits beside the photo, so its bullets are not drawn over it */
.van-description {
  display: flow-root;
}

.van-description ul {
  margin-bottom: var(--spacing-sm);
}

/* Characteristics single-spaced (content-panel lists are spaced out) */
.van-description li {
  margin-bottom: 0;
}

/* Verifica disponibilità / Noleggia, under the floated photo */
.van-card-actions {
  clear: both;
  padding-top: var(--spacing-sm);
}

.van-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Legend in the left bar: a bar and the van name per line */
.van-legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

/* Calendar race of the day (van managers): a yellow bar with its title under the van bars */
.van-event-line {
  display: block;
  height: 16px;
  margin-top: 2px;
  padding: 0 4px;
  border: 1px solid var(--gold-blue);
  border-radius: 4px;
  background-color: var(--gold-yellow);
  color: var(--gold-blue);
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 14px;
  text-decoration: none;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Reservation grid */
.vans-view .van-calendar {
  user-select: none;
}

.van-bar {
  display: block;
  height: 16px;
  margin-top: 2px;
  overflow: hidden;
}

/* "✕ van name" inside a bar: that van is not available that day */
.van-bar-label {
  display: block;
  padding: 0 4px;
  color: #ffffff;
  font-size: 0.7rem;
  line-height: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}


/* Bars of a multi-day reservation join across the cell borders; the ends keep a margin */
.van-calendar .van-bar {
  margin-left: -2px;
  margin-right: -2px;
}

.van-bar-empty {
  visibility: hidden;
}

.van-bar-pending {
  background-image: repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.65) 0 3px, transparent 3px 6px);
}

.van-bar-start {
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  margin-left: 2px;
}

.van-bar-end {
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  margin-right: 2px;
}

.van-bar-clickable {
  cursor: pointer;
}

.van-legend-bar {
  flex: none;
  width: 32px;
  margin-top: 0;
}

.van-color-0 { background-color: var(--van-color-0); }
.van-color-1 { background-color: var(--van-color-1); }
.van-color-2 { background-color: var(--van-color-2); }
.van-color-3 { background-color: var(--van-color-3); }


.van-calendar .van-bar-start { margin-left: 2px; }
.van-calendar .van-bar-end { margin-right: 2px; }

/* Past days and days without a free van; the selected range */
.vans-view .calendar-grid tbody td.van-day-blocked {
  cursor: not-allowed;
}

.vans-view .calendar-grid tbody td.van-day-blocked:not(.calendar-today) .calendar-day-number {
  color: var(--bs-secondary-color, #6c757d);
}

.vans-view .calendar-grid tbody td.van-day-full {
  background-color: #f8d7da;
}

.van-day-full-label {
  color: #842029;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.1;
  display: inline-block;
  vertical-align: middle;
  max-width: calc(100% - 1.75rem);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vans-view .calendar-grid tbody td.van-day-selected {
  background-color: var(--gold-yellow);
}

@media (max-width: 767.98px) {
  .van-bar {
    height: 7px;
    margin-top: 1px;
  }

  .van-event-line {
    height: 7px;
    margin-top: 1px;
    font-size: 0;
  }

  .van-bar-label,
  .van-day-full-label {
    display: none;
  }
}

/* Phone: the photo above the characteristics, not beside them */
@media (max-width: 575.98px) {
  .van-photo {
    float: none;
    width: 100%;
    margin: 0 0 var(--spacing-sm);
  }
}
