/*
 Theme Name:   Playful Child Theme
 Theme URI:    https://playful.ancorathemes.com
 Description:  Playful Child Theme
 Author:       AncoraThemes
 Author URI:   http://ancorathemes.com
 Template:     playful
 Version:      1.0
 Tags:         flexible-header, custom-background, custom-colors, custom-header, custom-menu, featured-image-header, featured-images, full-width-template, microformats, post-formats, theme-options, threaded-comments, translation-ready
 Text Domain:  playful
*/

/* =Child-Theme customization starts here
------------------------------------------------------------ */

.tribe-events-calendar-list__event-title-link,
.tribe-events-c-subscribe-dropdown__list-item-link,
.tribe-events-calendar-month-mobile-events__mobile-event-title-link.tribe-common-anchor,
.tribe-events-calendar-month__day-date-link,
.tribe-events-calendar-month__calendar-event-title-link,
.tribe-events-c-messages__message-list-item-link,
.tribe-events-calendar-month__calendar-event-tooltip-title-link {
  color: #d8a235 !important;
}

.tribe-events-c-top-bar__today-button {
  background-color: #d8a235 !important;
}

.tribe-events-single-event-description.tribe-events-content h2 {
  color: #fff !important;
}

.tribe-events-content h3 {
  color: #fff;
}

.sticky-header tr > td:not(:first-child) {
  text-align: center;
  position: relative;
}

.sticky-header tr > td > span {
  font-size: 12px;
  line-height: 6px;
  /* display: inline-block; */
  position: absolute;
  width: 100%;
  bottom: 6px;
  left: 0;
}

/* Make table headers sticky - apply to th elements for better browser support */
.sticky-header thead {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #141414;
}

.sticky-header thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #141414;
  padding: 12px 10px;
  line-height: 1.4;
}

.sticky-header thead th .date-line {
  display: block;
  font-size: 0.85em;
  font-weight: normal;
  opacity: 0.8;
  margin-top: 4px;
}

@media (max-width: 479px) {
  .sticky-header tr > td > span {
    display: none !important;
  }
}

/* Mobile Schedule Filters and Modal */
@media (max-width: 767px) {
  /* Filter buttons */
  .schedule-filters {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 12px;
    position: sticky;
    top: 0;
    background: #0c0c0e;
    z-index: 10;
  }

  /* Adjust sticky header positioning below filter buttons on mobile */
  .sticky-header thead {
    position: sticky;
    top: 60px;
    z-index: 9;
    background: #141414;
  }

  .sticky-header thead th {
    position: sticky; /* Re-declare for mobile */
    top: 60px; /* Stick below filter buttons */
    z-index: 9; /* Below filter buttons (z-index: 10) */
    background: #141414; /* Ensure background covers content */
  }

  .schedule-filters .filter-btn {
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #333;
    background: #1a1a1a;
    color: #aaa;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
  }

  .schedule-filters .filter-btn:hover {
    background: #252525;
  }

  .schedule-filters .filter-btn.active {
    background: #d8a235;
    color: #000;
    font-weight: 600;
    border-color: #d8a235;
  }

  /* Table adjustments for mobile */
  .schedule-table tbody tr.performer-row {
    cursor: pointer;
    transition: background-color 0.2s ease;
  }

  .schedule-table tbody tr.performer-row:hover {
    background-color: rgba(216, 162, 53, 0.1);
  }

  .schedule-table tbody tr.performer-row:active {
    background-color: rgba(216, 162, 53, 0.2);
  }

  /* Modal styles */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
  }

  .modal-backdrop[style*="display: flex"] {
    display: flex;
  }

  .modal-content {
    background: #1a1a1a;
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
  }

  .modal-content h2 {
    margin: 0 0 16px;
    color: #d8a235;
    font-size: 22px;
    text-align: center;
  }

  .modal-week-list {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
  }

  .modal-week-list td {
    padding: 10px 8px;
    border-bottom: 1px solid #2a2a2a;
    font-size: 14px;
  }

  .modal-week-list td:first-child {
    text-align: left;
    color: #fff;
    font-weight: 500;
  }

  .modal-week-list td:last-child {
    text-align: right;
    font-size: 18px;
  }

  .modal-week-list td.day {
    color: #d8a235;
  }

  .modal-week-list td.night {
    color: #8ab4ff;
  }

  .modal-week-list td.both {
    color: #d8a235;
  }

  .modal-week-list td.off {
    color: #555;
  }

  .modal-week-list tr:last-child td {
    border-bottom: none;
  }

  .modal-close-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: #333;
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: background 0.2s ease;
  }

  .modal-close-btn:hover {
    background: #444;
  }

  .modal-close-btn:active {
    background: #555;
  }
}

/* Desktop - hide filters, no row click behavior */
@media (min-width: 768px) {
  .schedule-filters {
    display: none;
  }

  .schedule-table tbody tr.performer-row {
    cursor: default;
  }
}
