/* Pie Calendar Custom Styles - Kaiser Theme */

/* Calendar wrapper - inherit theme font */
.piecal-wrapper {
  color: var(--darkblue);
  max-width: 100%;
  overflow-x: auto;
  /*! overflow: hidden !important; */
}

/* Calendar container improvements */
.content_block_calendar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.piecal-wrapper .piecal-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.piecal-wrapper .piecal-controls label {
  display: none !important;
}

.piecal-wrapper .piecal-controls select {
  padding: 8px 12px;
  border: 1px solid var(--steelblue);
  border-radius: 4px;
  background-color: var(--white);
  color: var(--darkblue);
  min-width: 150px;
}

/* Today cell background color - using theme blue */
.piecal-wrapper .fc .fc-daygrid-day.fc-day-today {
  background-color: rgba(0, 120, 179, 0.1);
}

/* Calendar buttons - matching theme button style */
.piecal-wrapper .fc .fc-button {
  background-color: transparent;
  border: 1px solid var(--steelblue);
  color: var(--steelblue);
  border-radius: 50px;
  padding: 8px 20px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
}

.piecal-wrapper .fc .fc-button:hover {
  background-color: var(--steelblue);
  color: var(--white);
}

/* Today button when disabled */
.piecal-wrapper .fc .fc-button:disabled {
  background-color: var(--darkblue);
  border-color: var(--darkblue);
  color: var(--white);
}

/* Previous & Next buttons */
.piecal-wrapper .fc .fc-prev-button,
.piecal-wrapper .fc .fc-next-button {
  background-color: var(--darkblue);
  border-color: var(--darkblue);
  color: var(--white);
  border-radius: 50px;
  padding: 8px 16px;
}

.piecal-wrapper .fc .fc-prev-button:hover,
.piecal-wrapper .fc .fc-next-button:hover {
  background-color: var(--steelblue);
  border-color: var(--steelblue);
}

/* Calendar title styling */
.piecal-wrapper .fc .fc-toolbar-title {
  color: var(--darkblue);
  font-weight: 700;
  font-size: 24px;
}

/* Event styling - simplified approach */
.piecal-wrapper .fc-event {
  color: var(--white) !important;
  border-radius: 4px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  overflow: hidden;
  padding: 0 25px;
}

/* Hide inline time badge inside grid events when plugin outputs it */
.piecal-wrapper .fc .fc-daygrid-event .fc-event-time,
.fc-daygrid-event-dot {
  display: none !important;
}

.piecal-wrapper .fc-event:hover,
.piecal-wrapper .fc-event.synchronized-hover {
  transform: scale(1.1);
  opacity: 0.9;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer !important;
  overflow: visible !important;
}
.piecal-wrapper .fc-event:hover .fc-event-time,
.piecal-wrapper .fc-event.synchronized-hover .fc-event-time {
  background-color: inherit;
  position: relative;
}
.piecal-wrapper .fc-event:hover .fc-event-time:before,
.piecal-wrapper .fc-event.synchronized-hover .fc-event-time:before {
  background-color: inherit !important;
  content: "";
  width: calc(100% + 5px);
  height: calc(100% + 4px);
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  transform: translate(-50%, -50%);
  border-radius: 5px;
}

/* Day numbers */
.piecal-wrapper .fc .fc-daygrid-day-number {
  color: var(--darkblue);
  font-weight: 600;
}

/* Weekend styling */
.piecal-wrapper .fc .fc-day-sat,
.piecal-wrapper .fc .fc-day-sun {
  background-color: rgba(13, 28, 61, 0.05);
}

/* Popover styles - matching theme colors */
.piecal-wrapper .piecal-popover {
  border-radius: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Hide native popover meta completely; show only custom ACF dates */
.piecal-wrapper .piecal-popover .piecal-popover__meta,
.piecal-wrapper .piecal-popover .piecal-meta,
.piecal-wrapper .piecal-popover dl,
.piecal-wrapper .piecal-popover dt,
.piecal-wrapper .piecal-popover dd {
  display: none !important;
}

/* Close button styling - smaller and better positioned */
.piecal-wrapper .piecal-popover__close-button {
  background-color: var(--darkblue);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  top: 0;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.piecal-wrapper .piecal-popover__close-button::before,
.piecal-wrapper .piecal-popover__close-button::after {
  background: var(--white);
  width: 12px;
  height: 2px;
}

/* Event popup content styling */
.piecal-wrapper .piecal-popover__inner {
  padding: 20px;
  line-height: 1.5;
}

.piecal-wrapper .piecal-popover__inner h3 {
  color: var(--darkblue);
  font-weight: 700;
  margin-bottom: 15px;
  padding-right: 36px; /* ensure space from close button */
  font-size: 20px;
}

/* Make sure any popup title variant has space from the close button */
.piecal-wrapper .piecal-popover__title,
.piecal-wrapper .piecal-popover__inner h1,
.piecal-wrapper .piecal-popover__inner h2,
.piecal-wrapper .piecal-popover__inner h3 {
  display: block;
  font-weight: bold;
  padding-top: 11px;
}

/* Event dates styling */
.piecal-wrapper .piecal-popover__inner table {
  margin: 15px 0;
  width: 100%;
  border-collapse: collapse;
}

.piecal-wrapper .piecal-popover__inner table td {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(13, 28, 61, 0.1);
  vertical-align: top;
}

.piecal-wrapper .piecal-popover__inner table td:first-child {
  font-weight: 600;
  color: var(--darkblue);
  width: 80px;
}

/* Event location and description styling */
.piecal-wrapper .event-popup-location {
  background-color: rgba(0, 120, 179, 0.1);
  padding: 12px;
  border-radius: 6px;
  border-left: 4px solid var(--steelblue);
}

.piecal-wrapper .event-popup-description {
  color: #333;
  margin-top: 15px;
}

.piecal-wrapper .event-popup-description p {
  margin: 8px 0;
}

/* Hide only the default View Event button; allow custom links (title/registration) */
.piecal-wrapper .piecal-popover__view-link {
  display: none !important;
}

/* Ensure custom links are visible */
.piecal-wrapper .piecal-popover__inner a.kpgv-title-link,
.piecal-wrapper .piecal-popover__inner a.kpgv-reg-link {
  display: inline !important;
}

/* Widget mode adjustments */
.piecal-wrapper--widget {
  max-width: 100%;
}

/* Back to month button in widget mode */
.piecal-wrapper:not([data-view="listDay"]) .piecal-controls__back-to-month {
  background-color: var(--darkblue);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 10px 20px;
  font-weight: 600;
}

/* Calendar grid borders */
.piecal-wrapper .fc .fc-scrollgrid {
  border-color: rgba(13, 28, 61, 0.2);
}

.piecal-wrapper .fc .fc-scrollgrid-sync-table {
  border-color: rgba(13, 28, 61, 0.2);
}

/* Day header styling */
.piecal-wrapper .fc .fc-col-header-cell {
  background-color: var(--darkblue);
  color: var(--white);
  font-weight: 700;
  padding: 12px 0;
}
.piecal-wrapper .fc .fc-col-header-cell a {
  color: var(--white);
}

/* Hide any timezone notices to avoid confusing users */
.piecal-wrapper .piecal-timezone-notice,
.piecal-wrapper .piecal__timezone,
.piecal-popover__timezone,
.piecal-footer {
  display: none !important;
}

/* Custom ACF dates block in popover */
.piecal-wrapper .kpgv-when-inline {
  padding: 12px 0;
  border-top: 2px solid;
  border-bottom: 2px solid;
  margin: 12px 0;
}
.piecal-wrapper .kpgv-when-inline > div {
  margin: 2px 0;
}

.piecal-wrapper hr{
  display: none
}

.piecal-wrapper .kpgv-row {
  
  display: flex;
  align-content: center;
  justify-content: space-between;
}

.piecal-wrapper .kpgv-location {
  margin-bottom: 12px;
}

.piecal-wrapper .kpgv-when-inline .kpgv-date {
  color: var(--darkblue);
}

/* Removed unused debug-only ACF dates grid */

/* Mobile responsive adjustments - simplified */
@media (max-width: 768px) {
  .piecal-wrapper .fc .fc-button {
    padding: 6px 12px;
    font-size: 12px;
  }

  .piecal-wrapper .fc .fc-toolbar-title {
    font-size: 18px;
  }

  .piecal-wrapper .piecal-controls {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 20px;
  }

  .piecal-wrapper .piecal-controls label {
    font-size: 14px;
    justify-content: flex-start;
  }

  .piecal-wrapper .piecal-controls select {
    width: 100%;
    max-width: 200px;
    padding: 10px 12px;
    font-size: 14px;
    margin-left: 15px;
  }

  .piecal-wrapper .piecal-popover__inner {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .piecal-wrapper .fc .fc-button {
    padding: 4px 8px;
    font-size: 11px;
  }

  .piecal-wrapper .fc .fc-toolbar-title {
    font-size: 16px;
  }

  .piecal-wrapper .piecal-controls label {
    font-size: 12px;
    max-width: 100% !important;
  }

  .piecal-wrapper .piecal-controls select {
    font-size: 12px;
    padding: 8px 10px;
    min-width: unset;
    max-width: 180px;
  }

  .piecal-wrapper .piecal-popover__inner {
    padding: 12px;
  }
}
