/**
 * The Events Calendar Custom Styles
 *
 * This file applies our existing calendar design to The Events Calendar templates
 */

/* CRITICAL: Hide mobile controls by default to prevent flash */
.mobile-controls-container {
  display: none !important;
}

/* Main calendar page layout - copied from calendar.css */
.tribe-events-page-template .site-main {
  display: grid !important;
  grid-template-columns: repeat(22, 1fr) !important;
  padding-top: 14rem !important;
  position: relative;
  max-width: 2000px;
  margin: 0 auto;
  padding-left: 2rem;
  padding-right: 2rem;
}

/* Calendar page background with smooth transitions */
.calendar-page-background {
  position: absolute;
  top: -8rem;
  left: 0;
  width: 100vw;
  height: calc(100% + 31rem);
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 1) 0%,
    rgba(193, 214, 239, 0.2) 8%,
    rgba(193, 214, 239, 0.4) 15%,
    var(--clr-sky, #c1d6ef) 25%,
    var(--clr-sky, #c1d6ef) 35%,
    rgba(193, 214, 239, 0.8) 42%,
    rgba(193, 214, 239, 0.6) 48%,
    rgba(193, 214, 239, 0.45) 54%,
    rgba(193, 214, 239, 0.32) 60%,
    rgba(193, 214, 239, 0.22) 66%,
    rgba(193, 214, 239, 0.14) 72%,
    rgba(193, 214, 239, 0.08) 78%,
    rgba(193, 214, 239, 0.04) 84%,
    rgba(193, 214, 239, 0.02) 88%,
    rgba(255, 255, 255, 0.98) 92%,
    rgba(255, 255, 255, 1) 96%,
    rgba(255, 255, 255, 1) 100%
  );
  pointer-events: none;
  z-index: -1;
  opacity: 0.6;
  margin-left: calc(-50vw + 50%);
}

/* Calendar container */
.calendar-container {
  grid-column: 2 / 22 !important;
  flex-shrink: 0;
  border-radius: 2rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 100vh;
  margin-bottom: 7rem;
}

/* Events View Styles - copied from calendar.css */
.calendar-events-view {
  display: block;
  padding: 0;
  height: 100%;
  width: 100%;
  overflow-y: auto;
}

.calendar-events-list {
  padding: 4rem;
  width: 100%;
  box-sizing: border-box;
}

.event-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 4rem;
  position: relative;
}

.event-date-group {
  display: flex;
  align-items: flex-start;
  margin-bottom: 4rem;
  position: relative;
}

.event-details-group {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.event-date-icon {
  flex-shrink: 0;
  margin-right: 4.5rem;
}

.calendar-icon-box {
  width: 4rem;
  height: 4rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.month-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1.5rem;
  border-radius: 0.5rem 0.5rem 0rem 0rem;
  background: var(--Pansie, #1b4799);
  color: #fff;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.5rem;
  text-align: center;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Next event overlay - blue */
.month-overlay.month-overlay-next {
  background: var(--Pansie, #1b4799) !important;
  color: #fff !important;
}

/* Future events overlay - sky-tone */
.month-overlay.month-overlay-future {
  background: var(--sky-tone, #e0ebf7) !important;
  color: var(--Pansie, #1b4799) !important;
}

/* Past events overlay - muted blue-gray */
.month-overlay.month-overlay-past {
  background: #b8c5d1 !important;
  color: #fff !important;
}

.date-number {
  color: var(--Pansie, #1b4799);
  text-align: center;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 400;
  line-height: 2rem;
  text-transform: capitalize;
  margin-top: 1.5rem;
}

.event-details {
  flex: 1;
}

/* First event in a date group - align with top of calendar icon */
.event-date-group .event-details:first-of-type {
  padding-top: 0;
}

/* Legacy single event items - maintain original padding */
.event-item .event-details {
  padding-top: 0.5rem;
}

.event-details-additional {
  margin-top: 3rem;
}

.event-title {
  color: var(--Pansie, #1b4799);
  font-family: "Mozaic GEO Variable", sans-serif;
  font-size: 1.5rem;
  font-style: normal;
  font-weight: 500;
  line-height: 2rem; /* 133.333% */
  text-transform: capitalize;
  margin-bottom: 0.75rem;
}

.event-time {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.event-time-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-time-categories {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.event-time svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.event-time-text {
  color: #666;
  font-family: "Mozaic GEO Variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 1.5rem; /* 150% */
  flex-shrink: 0;
}

.event-category-separator {
  color: #999;
  font-size: 1rem;
  flex-shrink: 0;
}

.event-categories {
  color: #666;
  font-family: "Mozaic GEO Variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 1.5rem;
  flex-shrink: 0;
}

.event-separator {
  height: 0.0625rem;
  background: #eee;
  width: 100%;
  margin-bottom: 4rem;
}

.no-events-message {
  text-align: center;
  color: #666;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1.25rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.5rem;
  padding: 4rem;
}

/* Tablet Calendar Styles */
@media (max-width: 1024px) {
  .calendar-container {
    width: 100%;
    max-width: 100%;
    margin: 0;
    border-radius: 2rem;
    min-height: 0;
  }

  .calendar-grid {
    min-height: 35rem;
  }

  .calendar-cell {
    min-height: 8rem;
    padding: 0.75rem;
  }

  .calendar-date {
    font-size: 1rem;
  }

  .event-slip {
    height: 1.875rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  .event-slip-text {
    font-size: 0.8125rem;
  }

  .calendar-header {
    height: 10rem;
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .calendar-month-year {
    font-size: 1.75rem;
  }

  .calendar-category-filter {
    right: calc(2rem + 9rem + 1rem);
  }

  .calendar-view-slider {
    right: 2rem;
  }
}

/* Mobile Calendar Styles - Mini Calendar View */
@media (max-width: 768px) {
  /* Prevent horizontal scrolling */
  body {
    overflow-x: hidden !important;
  }

  /* Full width mobile layout */
  .tribe-events-page-template .site-main {
    display: block !important;
  }

  .calendar-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    /* No rounding on top corners rounding on the bottom corners */
    border-radius: 2rem !important;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    position: relative;
    margin-bottom: 10rem !important;
  }

  /* Transform month view to mini-calendar style on mobile */
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #fff;
    margin: 0 0.5rem 5rem 0.5rem !important;
    border-radius: 0;
    overflow: hidden;
    width: calc(100% - 1rem) !important;
    min-height: 0 !important;
  }

  /* Mobile calendar day headers */
  .calendar-days-ruler {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #fff;
    margin: 0 0.5rem 1px 0.5rem !important;
    border-radius: 0.5rem 0.5rem 0 0;
    overflow: visible;
    width: calc(100% - 1rem) !important;
  }

  .calendar-day-label {
    background: #fff;
    text-align: center;
    font-family: "mozaic-geo-variable", sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    padding: 0.4rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile calendar cells - perfect 1x1 squares */
  .calendar-cell {
    aspect-ratio: 1 / 1 !important;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    position: relative;
    border: none !important;
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    width: 100%;
    flex-direction: row !important;
    overflow: hidden;
  }

  /* Mobile calendar day numbers - simple text like year view */
  .calendar-cell .calendar-date,
  .calendar-cell .day-number {
    font-family: "mozaic-geo-variable", sans-serif;
    font-weight: 400;
    color: #333;
    font-size: 0.875rem;
    line-height: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0 0 0.5rem 0.5rem;
    box-sizing: border-box;
  }

  /* Event days highlighting - full cell background and border */
  .calendar-cell.has-events {
    background: var(--event-bg-color, rgba(216, 87, 95, 0.25)) !important;
    border: 1px solid var(--event-border-color, #d8575f) !important;
    border-radius: 0.5rem !important;
    position: relative;
  }

  .calendar-cell.has-events .calendar-date,
  .calendar-cell.has-events .day-number {
    color: var(--event-border-color, #d8575f) !important;
    font-weight: 600;
    font-size: 0.875rem !important;
  }

  /* Hide detailed event info on mobile month view */
  .calendar-events-container {
    display: none !important;
  }

  /* Hide event indicator dots - we use background highlighting instead */
  .event-indicator {
    display: none;
  }

  /* Inactive dates (prev/next month) */
  .calendar-cell-inactive .calendar-date,
  .calendar-cell-inactive .day-number {
    color: #ccc;
    font-weight: 300;
  }

  /* Mobile calendar header adjustments */
  .calendar-header {
    padding: 2.5rem 1rem 0.5rem 1rem !important;
    position: relative;
    display: flex;
    align-items: flex-start !important;
    justify-content: space-between;
    gap: 1rem;
    height: auto !important;
    min-height: 10rem !important;
  }

  /* Navigation buttons on top left - hide on list view */
  .calendar-nav-btn {
    position: static;
    margin: 0;
  }

  /* Hide navigation buttons on list view */
  .calendar-events-view .calendar-nav-btn,
  .calendar-container:has(.calendar-events-view:not([style*="display: none"]))
    .calendar-nav-btn,
  body.tribe-events-list .calendar-nav-btn,
  .tribe-events-list-view .calendar-nav-btn,
  [data-view="list"] .calendar-nav-btn {
    display: none !important;
  }

  /* Text on the side (month/year or "Upcoming Events") */
  .calendar-month-year {
    font-size: 1.55rem !important;
    font-weight: 500;
    order: 3;
    flex: 1;
    margin: 0;
  }

  /* Left align "Upcoming Events" text on list view */
  .calendar-events-view .calendar-month-year {
    text-align: left !important;
  }

  /* Right align month/year text on calendar view */
  .calendar-grid-view .calendar-month-year,
  .calendar-container:not(:has(.calendar-events-view)) .calendar-month-year {
    text-align: right !important;
  }

  /* Hide desktop category filter on mobile */
  .calendar-category-filter {
    display: none !important;
  }

  /* Hide desktop view slider on mobile */
  .calendar-view-slider {
    display: none !important;
  }

  /* Mobile header layout adjustments */
  .calendar-header {
    padding-bottom: 4rem; /* Add space for mobile controls */
  }

  /* Mobile controls container positioning */
  .mobile-controls-container {
    position: absolute;
    bottom: 0.5rem;
    left: 0;
    right: 0;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    z-index: 10;
  }

  /* Mobile view slider */
  .mobile-view-slider {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.5rem;
    padding: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: row;
  }

  /* Hide year view button on mobile */
  .mobile-view-slider .view-btn:nth-child(2) {
    display: none;
  }

  /* Mobile filters button */
  .mobile-filters-btn {
    position: static;
    height: 3rem;
    border-radius: 0.5rem;
    border: 1px solid #eee;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0 1rem;
    font-family: "mozaic-geo-variable", sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    gap: 0.5rem;
  }

  .mobile-filters-btn:hover {
    background: #f8f9fa;
  }

  .mobile-filters-btn.has-active-filters {
    background: #1b4799;
    color: white;
    border-color: #1b4799;
  }

  /* Show mobile controls only on mobile */
  @media (max-width: 768px) {
    .mobile-controls-container {
      display: flex !important;
    }
  }

  /* Mobile navigation buttons */
  .calendar-nav-btn {
    width: 2.75rem !important;
    height: 2.75rem !important;
  }

  .calendar-nav-btn svg {
    width: 13px;
    height: 13px;
  }

  /* Mobile List View Overrides */
  @media (max-width: 768px) {
    .calendar-events-list {
      padding: 1.5rem 1rem 1rem 1rem !important;
    }

    .event-item,
    .event-date-group {
      margin-bottom: 2rem !important;
    }
  }

  .event-date-icon {
    margin-right: 1rem !important;
  }

  .calendar-icon-box {
    width: 3rem !important;
    height: 3rem !important;
  }

  .month-overlay {
    font-size: 0.625rem !important;
    height: 1.25rem !important;
    line-height: 1.25rem !important;
  }

  .date-number {
    font-size: 1.25rem !important;
    line-height: 1.5rem !important;
    margin-top: 1.25rem !important;
  }

  .event-title {
    font-size: 1.125rem !important;
    line-height: 1.5rem !important;
  }

  .event-time {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  .event-time-text {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
  }

  .event-time-categories {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    margin-top: 0.25rem !important;
  }

  .event-category-separator {
    display: none !important;
  }

  .event-categories {
    font-size: 0.875rem !important;
    line-height: 1.25rem !important;
  }

  .event-details-additional {
    margin-top: 1.5rem !important;
  }

  .event-separator {
    margin-bottom: 2rem !important;
  }

  /* Prevent horizontal overflow in events container */
  .calendar-events-view,
  .calendar-events-list,
  .event-date-group,
  .event-details-group,
  .event-details {
    overflow-x: hidden !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .event-title,
  .event-time,
  .event-time-main,
  .event-time-categories {
    overflow-wrap: break-word !important;
    word-wrap: break-word !important;
    word-break: break-word !important;
    max-width: 100% !important;
  }
}

/* Calendar header */
.calendar-header {
  height: 13rem;
  padding-left: 3rem;
  padding-right: 3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  position: relative;
}

/* Calendar header border */
.calendar-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0.0625rem;
  background: rgba(0, 0, 0, 0.1);
}

/* Navigation buttons */
.calendar-nav-btn {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  aspect-ratio: 1/1;
  border-radius: 2rem;
  border: 1px solid #eee;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.calendar-nav-btn:hover {
  background: #f8f9fa;
}

/* Month and year text */
.calendar-month-year {
  color: #1b4799;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 2.25rem;
  font-style: normal;
  font-weight: 500;
  line-height: 2rem;
  text-transform: capitalize;
  margin-left: 1.5rem;
}

/* Category Filter */
.calendar-category-filter {
  position: absolute;
  top: 50%;
  right: calc(3rem + 9rem + 1.5rem); /* 1.5rem to the left of view slider */
  transform: translateY(-50%);
  height: 3rem;
  z-index: 20;
}

.filter-button {
  height: 3rem;
  border-radius: 0.5rem;
  border: 1px solid #eee;
  background: #fff;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 0 1rem;
  width: 300px;
  transition: all 0.2s ease;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.filter-button svg:first-child {
  margin-right: 0.5rem;
}

.filter-button .dropdown-arrow {
  margin-left: auto;
}

.filter-text {
  color: #333;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 2rem;
  text-transform: capitalize;
}

.filter-button:hover {
  background: #f8f9fa;
}

.filter-button .dropdown-arrow {
  transition: transform 0.2s ease;
}

.filter-button.active .dropdown-arrow {
  transform: rotate(180deg);
}

.filter-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  padding: 1rem;
  gap: 0.5rem;
  min-width: 400px;
  width: max-content;
  z-index: 30;
}

.filter-dropdown.active {
  display: flex;
  flex-wrap: wrap;
}

.filter-category-item {
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 0.875rem;
  font-weight: 400;
  transition: all 0.2s ease;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.filter-category-item::before {
  content: "";
  width: 1rem;
  height: 1.00244rem;
  border-radius: 0.25rem;
  flex-shrink: 0;
  border: 1px solid currentColor;
  background: white;
  transition: all 0.2s ease;
  position: relative;
}

.filter-category-item.selected {
  font-weight: 500;
}

.filter-category-item.selected::before {
  background: linear-gradient(currentColor, currentColor) 0.19rem 0.19rem /
      calc(100% - 0.38rem) calc(100% - 0.38rem) no-repeat,
    white;
}

/* Clear Filters Button */
.clear-filters-btn {
  height: 3rem;
  border-radius: 0.5rem;
  border: 1px solid #eee;
  background: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0 1rem;
  transition: all 0.2s ease;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  color: #666;
  position: absolute;
  top: 50%;
  right: calc(
    3rem + 9rem + 1.5rem + 300px + 1rem
  ); /* Position to the left of the filter dropdown */
  transform: translateY(-50%);
  z-index: 20;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.clear-filters-btn:hover {
  background: #f5f5f5;
}

.clear-filters-btn.visible {
  display: flex;
}

/* Calendar view slider */
.calendar-view-slider {
  position: absolute;
  top: 50%;
  right: 3rem;
  transform: translateY(-50%);
  width: 9rem; /* Exactly 3 buttons × 3rem each = 9rem */
  height: 3rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  background: #f9f9f9;
  display: flex;
  align-items: center;
  padding: 0;
  gap: 0; /* Ensure no gaps between buttons */
}

/* Mobile view slider - only 2 buttons, positioned on left */
@media (max-width: 768px) {
  .calendar-view-slider {
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    bottom: auto !important;
    right: auto !important;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 0.5rem;
    padding: 0.25rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-direction: row !important;
  }
}

/* View button base styles */
.view-btn {
  width: 3rem;
  height: 3rem;
  flex-shrink: 0;
  border-radius: 0.5rem;
  border: 2px solid #f9f9f9;
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

/* Active view button */
.view-btn.active,
.view-btn:disabled {
  background: #e0ebf7 !important;
  border: 2px solid #e0ebf7 !important;
  cursor: default !important;
}

/* View button hover effect */
.view-btn:hover:not(:disabled):not(.active) {
  background: #fff;
}

/* SVG opacity control for view buttons */
.view-btn svg {
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.view-btn.active svg,
.view-btn:disabled svg {
  opacity: 1 !important;
}

/* Days ruler container */
.calendar-days-ruler {
  height: 3.5rem;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0;
  flex-shrink: 0;
  position: relative;
}

/* Days ruler separator */
.calendar-days-ruler::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0.0625rem;
  background: rgba(0, 0, 0, 0.1);
}

/* Day abbreviation styling */
.calendar-day-label {
  color: #333;
  text-align: center;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 2rem;
  text-transform: capitalize;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  border-right: 0.0625rem solid rgba(0, 0, 0, 0.1);
}

.calendar-day-label:last-child {
  border-right: none;
}

/* Calendar grid container */
.calendar-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 0;
  min-height: 50rem;
  height: 100%;
}

/* Large desktop screens */
@media (min-width: 1921px) {
  .calendar-grid {
    min-height: 60rem;
  }
}

/* Standard desktop screens */
@media (max-width: 1920px) {
  .calendar-grid {
    min-height: 50rem;
  }
}

/* Smaller desktop and tablet landscape */
@media (max-width: 1366px) {
  .calendar-grid {
    min-height: 40rem;
  }
}

/* Tablet portrait */
@media (max-width: 1024px) {
  .calendar-grid {
    min-height: 35rem;
  }

  .calendar-cell {
    min-height: 7rem;
  }
}

/* Large mobile devices */
@media (max-width: 900px) {
  .calendar-grid {
    min-height: 30rem;
  }

  .calendar-cell {
    min-height: 6rem;
    padding: 0.25rem;
  }

  .calendar-date {
    font-size: 0.875rem;
  }

  .event-slip {
    height: 1.75rem;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  .event-slip-text {
    font-size: 0.7rem;
  }
}

/* Calendar grid cell */
.calendar-cell {
  border-right: 0.0625rem solid rgba(0, 0, 0, 0.1);
  border-bottom: 0.0625rem solid rgba(0, 0, 0, 0.1);
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 0.5rem;
  position: relative;
  overflow: hidden;
  background: #fff;
}

/* Current day styling */
.calendar-cell.today .day-number {
  background: #1b4799;
}

.calendar-cell.today .calendar-date {
  color: #fff;
  font-weight: 600;
}

.calendar-cell.today .event-slip {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.5);
}

.calendar-cell.today .event-slip-text {
  color: #fff;
}

/* Calendar date number */
.calendar-date {
  display: flex;
  align-items: center;
  width: 100%;
  color: #333;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.5rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 0.5rem;
}

/* Remove right border from last column */
.calendar-cell:nth-child(7n) {
  border-right: none;
}

/* Inactive calendar cells (previous/next month dates) */
.calendar-cell-inactive {
  background: #f9f9f9;
  opacity: 0.5;
}

/* Calendar events container */
.calendar-events-container {
  margin-top: 0.25rem;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Event slip styles */
.event-slip {
  height: 2rem;
  /* margin-left: 0.75rem;
	margin-right: 0.75rem; */
  border-radius: 0.5rem;
  border: 1px solid var(--event-border-color, #eaab7a);
  background: var(--event-bg-color, rgba(234, 171, 122, 0.25));
  display: flex;
  align-items: center;
  position: relative;
  flex-shrink: 0;
}

.event-slip-text {
  padding-left: 0.5rem;
  overflow: hidden;
  color: var(--event-border-color, #b9621e);
  text-overflow: ellipsis;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 400;
  line-height: 1.125rem;
  letter-spacing: 0.0225rem;
  white-space: nowrap;
}

.event-slip-text a {
  color: inherit;
  text-decoration: none;
}

.event-slip-text a:hover {
  text-decoration: underline;
}

/* Multi-day event styling */
.event-slip-start {
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  margin-right: 0 !important;
  position: relative;
}

.event-slip-start::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--event-border-color, #eaab7a);
}

.event-slip-middle {
  border-radius: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  position: relative;
}

.event-slip-middle::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--event-border-color, #eaab7a);
}

.event-slip-end {
  border-top-left-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  margin-left: 0 !important;
}

/* Multi-day events should have a slightly different background to show continuity */
.event-slip-start,
.event-slip-middle,
.event-slip-end {
  background: var(--event-bg-color, rgba(234, 171, 122, 0.35)) !important;
  border-color: var(--event-border-color, #eaab7a) !important;
}

/* Ensure multi-day events span the full width of their cells */
.event-slip-start,
.event-slip-middle,
.event-slip-end {
  margin-left: 0.25rem !important;
  margin-right: 0.25rem !important;
}

.event-slip-start {
  margin-left: 0.75rem !important;
  margin-right: 0.25rem !important;
}

.event-slip-end {
  margin-left: 0.25rem !important;
  margin-right: 0.75rem !important;
}

/* Year View Styles */
.calendar-year-view {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, 1fr);
  gap: 1rem;
  padding: 0 3rem 3rem;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Large desktop screens */
@media (min-width: 1921px) {
  .calendar-year-view {
    gap: 2rem;
    padding: 0 4rem 4rem;
  }

  .calendar-month-name {
    font-size: 1.5rem;
    padding-top: 2rem;
  }
}

/* Standard desktop screens */
@media (max-width: 1600px) {
  .calendar-year-view {
    gap: 1rem;
    padding: 0 2rem 2rem;
  }
}

/* Smaller desktop and tablet landscape */
@media (max-width: 1366px) {
  .calendar-year-view {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(4, 1fr);
    gap: 1rem;
    padding: 0 2rem 2rem;
  }
}

/* Tablet portrait */
@media (max-width: 1024px) {
  .calendar-year-view {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: repeat(6, 1fr);
    gap: 1rem;
    padding: 0 1.5rem 1.5rem;
  }

  .calendar-month-name {
    font-size: 1.125rem;
    padding-top: 1.5rem;
    margin-bottom: 1.5rem;
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  .calendar-year-view {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1rem 1rem;
  }

  .calendar-month-name {
    font-size: 1rem;
    padding-top: 1rem;
    margin-bottom: 1rem;
  }

  .calendar-month-dates {
    padding: 0 0.5rem 0.5rem;
  }
}

.calendar-month-card {
  background: #fff;
  border-radius: 1rem;
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.calendar-month-name {
  color: #1b4799;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1.25rem;
  font-style: normal;
  font-weight: 500;
  line-height: 1.5rem;
  margin: 0;
  padding-top: 3rem;
  text-align: center;
  margin-bottom: 2rem;
}

.calendar-month-dates {
  flex: 1;
  padding: 0 1rem 1rem 1rem;
}

/* Event Modal Styles */
.event-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  padding: 2rem;
  box-sizing: border-box;
}

.event-modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.event-modal {
  width: 45rem;
  max-height: calc(
    100vh - 4rem
  ); /* Full viewport minus 2rem padding top/bottom */
  min-height: calc(
    100vh - 8rem
  ); /* Viewport height minus larger padding for smaller content */
  height: auto;
  border-radius: 2rem;
  background: #fff;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.event-modal-overlay.active .event-modal {
}

.event-modal-content {
  padding: 3rem;
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
}

.event-modal-close {
  width: 2rem;
  height: 2rem;
  border: none;
  background: none;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s ease;
}

.event-modal-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

.event-modal-close::before,
.event-modal-close::after {
  content: "";
  position: absolute;
  width: 1rem;
  height: 2px;
  background: #333;
  transform-origin: center;
}

.event-modal-close::before {
  transform: rotate(45deg);
}

.event-modal-close::after {
  transform: rotate(-45deg);
}

.event-modal-date-section-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 2.5rem;
}

.event-modal-calendar-icon {
  position: static;
}

.event-modal-calendar-icon .calendar-icon-box {
  width: 4rem;
  height: 4rem;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 0.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.event-modal-title-section {
  flex-shrink: 0;
  padding-bottom: 2rem;
}

.event-modal-title {
  color: #1b4799;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 2.25rem;
  font-style: normal;
  font-weight: 500;
  line-height: 2rem;
  text-transform: capitalize;
  margin: 0;
}

.event-modal-date-section {
  display: flex;
  align-items: center;
}

.event-modal-date-icon {
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.event-modal-date-icon img {
  flex-shrink: 0;
  margin-top: 0.2rem;
}

.event-modal-date-text {
  color: #666;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 1.5rem;
}

.event-modal-location-section {
  display: flex;
  align-items: flex-start;
}

.event-modal-location-icon {
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.4rem; /* Slight adjustment to align with first line of text */
}

.event-modal-location-icon img {
  flex-shrink: 0;
}

.event-modal-location-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.event-modal-venue-name {
  color: #666;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 1.5rem;
}

.event-modal-venue-address {
  color: #666;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 1.5rem;
}

.event-modal-organizer-section {
  display: flex;
  align-items: flex-start;
}

.event-modal-organizer-icon {
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.4rem; /* Slight adjustment to align with first line of text */
}

.event-modal-organizer-icon img {
  flex-shrink: 0;
}

.event-modal-organizer-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.event-modal-organizer-name {
  color: #666;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 1.5rem;
}
.event-modal-category-section {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1rem; /* Space before separator */
}

.event-modal-category-icon {
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem; /* Slight adjustment to align with first line of text */
}

.event-modal-category-icon img {
  flex-shrink: 0;
}

.event-modal-category-text {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.event-modal-category-name {
  color: #666;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 1.5rem;
}

.event-modal-cost-section {
  display: flex;
  align-items: flex-start;
}

.event-modal-cost-icon {
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.4rem; /* Slight adjustment to align with first line of text */
  color: #666;
}

.event-modal-cost-icon svg {
  flex-shrink: 0;
}

.event-modal-cost-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.event-modal-cost-amount {
  color: #666;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 1.5rem;
}

.event-modal-date-section,
.event-modal-organizer-section,
.event-modal-location-section,
.event-modal-cost-section,
.event-modal-category-section {
  padding-block: 0.75rem;
  border-bottom: 1px solid #eee;
}

.event-modal-category-section {
  border-bottom: none;
}

.event-modal-scroll-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow flex child to shrink */
}

.event-modal-content-section {
  color: #666;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 300;
  line-height: 1.5rem;
  flex-grow: 1;
}

.event-modal-content-section p {
  margin: 0 0 1rem 0;
}

.event-modal-content-section p:last-child {
  margin-bottom: 0;
}

.event-modal-content-section ul,
.event-modal-content-section ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.event-modal-content-section li {
  margin-bottom: 0.5rem;
}

.event-modal a {
  color: #666 !important;

  transition: color 0.2s ease;
}
.event-modal a:hover {
  color: #1b4799 !important;
}

.event-modal-content-section h1,
.event-modal-content-section h2,
.event-modal-content-section h3,
.event-modal-content-section h4,
.event-modal-content-section h5,
.event-modal-content-section h6 {
  color: #1b4799;
  font-family: "mozaic-geo-variable", sans-serif;
  font-weight: 500;
  margin: 2rem 0 1rem 0;
}

.event-modal-content-section blockquote {
  border-left: 4px solid #1b4799;
  padding-left: 1rem;
  margin: 1rem 0;
  font-style: italic;
}

.event-modal-content-section img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
}

.event-modal-content-section iframe,
.event-modal-content-section embed,
.event-modal-content-section object {
  max-width: 100%;
  margin: 1rem 0;
}

/* Mobile responsive modal */
@media (max-width: 768px) {
  .event-modal-overlay {
    padding: 1rem;
  }

  .event-modal {
    width: calc(100vw - 2rem);
    max-height: calc(
      100vh - 2rem
    ); /* Full viewport minus 1rem padding top/bottom */
    min-height: calc(
      100vh - 4rem
    ); /* Viewport height minus larger padding for smaller content */
    height: auto;
    margin: 0;
  }

  .event-modal-content {
    padding: 2rem;
  }

  .event-modal-date-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3rem;
    margin-bottom: 0.5rem;
  }

  .event-modal-calendar-icon .calendar-icon-box {
    width: 3rem;
    height: 3rem;
  }

  .event-modal-title {
    font-size: 1.75rem;
    line-height: 1.75rem;
  }

  .event-modal-close {
    top: 1rem;
    right: 1rem;
  }
}

/* Mobile Filter Modal */
.mobile-filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.mobile-filter-modal.active {
  display: flex;
}

.mobile-filter-content {
  background: white;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.mobile-filter-header {
  padding: 1.5rem;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-filter-title {
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: #333;
  margin: 0;
}

.mobile-filter-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.mobile-filter-body {
  padding: 1rem 1.5rem;
  max-height: 50vh;
  overflow-y: auto;
}

.mobile-filter-category {
  display: flex;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  gap: 1rem;
}

.mobile-filter-category:last-child {
  border-bottom: none;
}

.mobile-filter-checkbox {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid #ddd;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.mobile-filter-category.selected .mobile-filter-checkbox {
  background: #1b4799;
  border-color: #1b4799;
}

.mobile-filter-checkbox::after {
  content: "✓";
  color: white;
  font-size: 0.875rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.mobile-filter-category.selected .mobile-filter-checkbox::after {
  opacity: 1;
}

.mobile-filter-label {
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 1rem;
  font-weight: 400;
  color: #333;
  flex: 1;
}

.mobile-filter-footer {
  padding: 1.5rem;
  border-top: 1px solid #eee;
  display: flex;
  gap: 1rem;
}

.mobile-filter-clear {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid #ddd;
  background: white;
  color: #666;
  border-radius: 0.5rem;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-filter-clear:hover {
  background: #f8f9fa;
}

.mobile-filter-apply {
  flex: 2;
  padding: 0.75rem 1rem;
  border: none;
  background: #1b4799;
  color: white;
  border-radius: 0.5rem;
  font-family: "mozaic-geo-variable", sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-filter-apply:hover {
  background: #1547c7;
}

@media (max-width: 768px) {
  .mobile-filter-modal {
    display: none;
  }

  .mobile-filter-modal.active {
    display: flex;
  }
}

/* Mini Calendar Grid Styles */
.mini-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
  font-family: "mozaic-geo-variable", sans-serif;
}

.mini-day-header {
  font-weight: 500;
  color: #666;
  text-align: center;
  padding: 0.25rem 0;
  text-transform: uppercase;
}

.mini-date-cell {
  font-weight: 500;
  color: #333;
  text-align: center;
  padding: 0.0625rem;
  aspect-ratio: 1.4;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.25rem;
  border: 1px solid transparent;
  box-sizing: border-box;
  font-size: 0.875rem;
}

.mini-date-cell.empty {
  visibility: hidden;
}

.mini-date-cell.other-month {
  color: #999;
}

.mini-date-cell.today {
  border-radius: 0.5rem;
  background: #1b4799;
  color: #fff;
  font-weight: 500;
}

.mini-date-cell.has-events {
  border-radius: 0.5rem;
  border: 1px solid var(--event-border-color, #d8575f);
  background: var(--event-bg-color, rgba(216, 87, 95, 0.25));
  color: var(--event-border-color, #d8575f);
  font-weight: 500;
}

/* Multi-day event connections in year view */
.mini-date-cell.has-events.event-start {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  position: relative;
}

.mini-date-cell.has-events.event-start::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 0.25rem;
  background: var(--event-bg-color, rgba(216, 87, 95, 0.25));
  z-index: -1;
}

.mini-date-cell.has-events.event-middle {
  border-radius: 0;
  border-left: none;
  border-right: none;
  position: relative;
}

.mini-date-cell.has-events.event-middle::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.25rem;
  background: var(--event-bg-color, rgba(216, 87, 95, 0.25));
  z-index: -1;
  transform: translateX(-0.25rem);
}

.mini-date-cell.has-events.event-middle::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 0.25rem;
  background: var(--event-bg-color, rgba(216, 87, 95, 0.25));
  z-index: -1;
}

.mini-date-cell.has-events.event-end {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: none;
  position: relative;
}

.mini-date-cell.has-events.event-end::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0.25rem;
  background: var(--event-bg-color, rgba(216, 87, 95, 0.25));
  z-index: -1;
  transform: translateX(-0.25rem);
}

/* Other month dates styling */
.mini-date-cell.other-month {
  color: #999 !important;
}

.mini-date-cell.other-month.has-events {
  border-color: var(--event-border-color, rgba(216, 87, 95, 0.5));
  background: var(--event-bg-color, rgba(216, 87, 95, 0.15));
  color: var(--event-border-color, rgba(216, 87, 95, 0.7)) !important;
}

.mini-date-cell.other-month.today {
  border-color: rgba(27, 71, 153, 0.5);
  color: rgba(27, 71, 153, 0.7) !important;
}

/* Filtered out state for year view */
.mini-date-cell.filtered-out {
  border: 1px solid transparent !important;
  background: transparent !important;
  color: #333 !important;
  font-weight: 500;
}

.mini-date-cell.other-month.filtered-out {
  color: #999 !important;
}

/* Clean styling without debugging borders */

/* Ensure proper positioning for date elements */
/* .calendar-date {
	top: 1rem !important;
	right: 1rem !important;
	left: auto !important;
} */

.calendar-month-abbr {
  top: 1rem !important;
  left: 1rem !important;
}
