#njsp-calendar {
  max-width: 100%;
  margin: 0 auto;
}

.fc .fc-toolbar-title {
  font-size: 20px;
  font-weight: 600;
  color: #222;
}

.fc-event-title {
  font-size: 14px;
  line-height: 1.3em;
  font-weight: 500;
}

.fc-list-event-time {
  font-weight: bold;
}

.fc-event {
  cursor: pointer;
}

#njsp-calendar table {
  margin: 0px;
}

#njsp-calendar .fc-h-event .fc-event-title {
  display: block;
  white-space: normal;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Tooltip */
.fc-tooltip-container {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 9999;
  position: absolute;
  max-width: 320px;
  width: 320px;
  font-size: 13px;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.3s ease;
  transform: translateY(0);
}

.fc-tooltip-container.fade-out {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

.fc-event:hover .fc-tooltip-container {
  display: block;
}

/* 🎯 Triangle pointer */
.fc-tooltip-container::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 20px;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid #fff;
}

.fc-tooltip-container::after {
  content: "";
  position: absolute;
  top: -7px;
  left: 21px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #fff;
}

.fc-custom-tooltip .tooltip-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.fc-custom-tooltip .tooltip-datetime {
  font-size: 13px;
  margin-bottom: 6px;
}

.fc-custom-tooltip .tooltip-category {
  font-size: 13px;
  color: #666;
  margin-bottom: 10px;
}

.fc-tooltip-button {
  display: inline-block;
  background: #0054a6;
  color: #fff;
  padding: 6px 10px;
  margin-right: 8px;
  font-size: 12px;
  border-radius: 4px;
  text-decoration: none;
}

.tooltip-location {
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.4em;
  word-break: break-word;
}

.fc-custom-tooltip .info-area {
  border-bottom: 1px solid #ccc;
  padding: 10px;
  margin: 0px;
}

.fc-custom-tooltip .info-area:last-child {
  border-bottom: 0px;
}

.fc-custom-tooltip .tooltip-title h4 {
  font-size: 18px;
  font-family: "Roboto", Sans-serif;
  margin: 0px;
  line-height: 1.5;
}

.fc-custom-tooltip .tooltip-datetime p {
  margin: 0px;
}

.fc-custom-tooltip .tooltip-datetime p br{
  display: none;
}

.fc-custom-tooltip .tooltip-datetime p > span,
.fc-custom-tooltip .tooltip-category > span,
.fc-custom-tooltip .tooltip-buttons a.linkin,
.fc-custom-tooltip .tooltip-location {
  display: block;
  margin: 0px;
  vertical-align: top;
}

.fc-custom-tooltip .tooltip-datetime p > span > span,
.fc-custom-tooltip .tooltip-category > span > span,
.fc-custom-tooltip .tooltip-buttons a.linkin > span,
.fc-custom-tooltip .tooltip-location > div {
  display: inline-block;
  margin-left: 10px;
  vertical-align: top;
}

.fc-custom-tooltip .tooltip-datetime p > span > span.icon-area, 
.fc-custom-tooltip .tooltip-category > span > span.icon-area,
.fc-custom-tooltip .tooltip-buttons a.linkin > span.icon-area,
.fc-custom-tooltip .tooltip-location > div.icon-area  {
  margin-left: 0px;
}

.fc-custom-tooltip .tooltip-datetime p > span > span.icon-area i,
.fc-custom-tooltip .tooltip-category > span > span.icon-area i,
.fc-custom-tooltip .tooltip-buttons a.linkin > span.icon-area i,
.fc-custom-tooltip .tooltip-location > div.icon-area i {
  color: #227bbc;
  font-family:"Font Awesome 5 Free";
}

.fc-custom-tooltip .tooltip-datetime p > span:hover > span.icon-area > i,
.fc-custom-tooltip .tooltip-category > span:hover > span.icon-area > i,
.fc-custom-tooltip .tooltip-buttons a.linkin:hover > span.icon-area i,
.fc-custom-tooltip .tooltip-location:hover > div.icon-area i {
  color: #003366;
}

.fc-custom-tooltip .tooltip-datetime p > span > span.text-area,
.fc-custom-tooltip .tooltip-category > span > span.text-area,
.fc-custom-tooltip .tooltip-buttons a.linkin > span.text-area,
.fc-custom-tooltip .tooltip-location > div.location-area > a {
  color: #003366;
}

.fc-custom-tooltip .tooltip-datetime p > span:hover > span.text-area,
.fc-custom-tooltip .tooltip-category > span:hover > span.text-area,
.fc-custom-tooltip .tooltip-buttons a.linkin:hover > span.text-area,
.fc-custom-tooltip .tooltip-location:hover > div.location-area > a {
  color: #227bbc;
}

/* Calendar table styling */
#njsp-calendar table tr td, 
#njsp-calendar table tr th {
  background-color: #fff;
  color: #003366;
}

#njsp-calendar table tr td.fc-day-other {
  background-color: #F5F6FA;
}

#njsp-calendar table tr td:hover {
  text-decoration: underline;
}

#njsp-calendar table tr th.fc-col-header-cell,
#njsp-calendar table tr td.fc-day-today {
  background-color: #003366;
  color: #fff;
}

#njsp-calendar .fc-daygrid-event-harness:not(:first-child) {
  margin-top: 10px !important;
}

/* Hide list time on mobile */
@media (max-width: 768px) {
  .fc-list-event-time {
    display: none !important;
  }
}

/* Calendar Category Filter Dropdown */
.njsp-calendar-filters {
  margin-bottom: 20px;
  text-align: left;
}

.njsp-calendar-filters form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.njsp-calendar-filters .custom-dropdown,
.njsp-calendar-filters .njsp-search-wrapper {
  flex: 1 1 280px;
  max-width: 420px;
}

.njsp-calendar-filters .custom-dropdown {
  position: relative;
  width: 300px;
  font-family: inherit;
  user-select: none;
}

.njsp-calendar-filters .selected-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid #ccc;
  background-color: #fff;
  cursor: pointer;
  min-height: 44px;
}

.njsp-calendar-filters .options {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  border: 1px solid #ccc;
  background-color: #fff;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.njsp-calendar-filters .dropdown-option {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  gap: 10px;
}

.njsp-calendar-filters .dropdown-option:hover {
  background-color: #f0f0f0;
}

.njsp-calendar-filters .color-box {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.njsp-calendar-filters .dropdown-arrow {
  width: 0;
  height: 0;
  margin-left: 10px;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #333;
  right: 15px;
  position: absolute;
}

/* Upcoming dates list reset */
.fc-custom-tooltip .upcoming-dates-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Upcoming date item layout + hover */
.fc-custom-tooltip .upcoming-date-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 0;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

/* ✅ FIX: removed broken "." line that was breaking CSS parsing */
.fc-custom-tooltip .upcoming-date-item:hover {
  background-color: #f5f5f5;
}

/* =========================================================
   SEARCH STYLING (clean + no empty border)
   ========================================================= */

.njsp-search-wrapper {
  position: relative;
  width: 100%;
}

/* Search input – match dropdown look */
.njsp-search-box input#njsp-event-search {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 12px;
  border: 1px solid #ccc !important;
  font-size: 16px;
  line-height: 1.2;
  border-radius: 0;
  background-color: #fff;
  box-shadow: none !important;
  background-image: none !important;
  outline: none;
  min-height: 44px;
}

.njsp-search-box input#njsp-event-search:focus {
  outline: none;
}

/* Results container is hidden unless JS adds .has-results */
#njsp-event-search-results {
  position: absolute;
  top: calc(100% - 0px);
  left: 0;
  right: 0;
  z-index: 9999;

  display: none; /* ✅ no empty border */
  background: #fff;
  border: 1px solid #ccc;
  border-top: 0;
  box-shadow: 0 10px 22px rgba(0,0,0,0.12);

  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;

  padding: 0;
  margin: 0;
}

#njsp-event-search-results.has-results {
  display: block;
}

/* Your real output item */
#njsp-event-search-results .njsp-search-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.25;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s ease;
  color: #003366;
}

#njsp-event-search-results .njsp-search-item:nth-child(odd) {
  background: #ffffff;
}

#njsp-event-search-results .njsp-search-item:nth-child(even) {
  background: #f7f9fc;
}

#njsp-event-search-results .njsp-search-item:hover {
  background: #e9f2ff;
}

#njsp-event-search-results .njsp-search-item:last-child {
  border-bottom: 0;
}

/* No Events Found */
#njsp-event-search-results .njsp-search-empty {
  padding: 12px 12px;
  font-size: 14px;
  line-height: 1.35;
  color: #a94442;
  background: #fff6f6;
  display: flex;
  align-items: center;
  gap: 10px;
}

#njsp-event-search-results .njsp-search-empty:before {
  content: "\26A0";
  font-size: 16px;
  line-height: 1;
}

#njsp-event-search-results .njsp-search-empty:hover {
  background: #fff0f0;
}

/* Responsive: stack filters on small screens */
@media (max-width: 768px) {
  .njsp-calendar-filters form {
    flex-direction: column;
    align-items: stretch;
  }

  .njsp-calendar-filters .custom-dropdown,
  .njsp-calendar-filters .njsp-search-wrapper {
    max-width: 100%;
  }
}
