/* =============================================
   SWIB Events Page - Senior-Friendly Design
   Supports List, Month, Week, Map, Summary views
   ============================================= */

/* =============================================
   HIDE DEFAULT TEC UI ELEMENTS
   ============================================= */
.tribe-events-c-search,
.tribe-events-header__top-bar,
#tribe-bar-form,
form.tribe-events-c-search,
.tribe-events .tribe-events-c-search,
.tribe-events-header form,
.tribe-events-c-events-bar,
.tribe-events-header h1.tribe-events-header__title,
.tribe-events .tribe-events-header__title,
.tribe-events-pro-filter-bar,
.tribe-filter-bar,
.tribe-events-filter-bar,
form.tribe-events-pro-filter-bar__form,
.tribe-events-pro-filter-bar__filters {
    display: none !important;
}

/* =============================================
   CUSTOM TOOLBAR
   ============================================= */
.swib-toolbar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    margin: 0 auto 20px auto;
    max-width: 1400px;
    box-sizing: border-box;
}

.swib-search-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.swib-search-row > div {
    flex: 1;
    min-width: 200px;
}

.swib-search-row > div:last-child {
    flex: 0 0 auto;
}

.swib-search-row label,
.swib-toolbar label {
    display: block !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1f2937 !important;
    margin-bottom: 8px !important;
}

.swib-search-row input,
.swib-search-row select,
.swib-toolbar input,
.swib-toolbar select {
    width: 100% !important;
    padding: 14px 16px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 10px !important;
    font-size: 16px !important;
    background: white !important;
    box-sizing: border-box !important;
    min-height: 48px !important;
}

.swib-search-row button#swib-find-events,
.swib-toolbar button#swib-find-events {
    background: #0d9488 !important;
    color: white !important;
    border: none !important;
    padding: 14px 28px !important;
    border-radius: 10px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    margin-top: 28px !important;
    min-height: 48px !important;
}

.swib-view-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-bottom: 15px !important;
}

.swib-view-row .view-label {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
}

.swib-view-row a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px 20px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 10px !important;
    background: white !important;
    color: #374151 !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    min-height: 44px !important;
}

.swib-view-row a:hover {
    background: #f3f4f6 !important;
}

.swib-view-row a.active {
    background: #0d9488 !important;
    color: white !important;
    border-color: #0d9488 !important;
}

.swib-filter-row {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    padding-top: 15px !important;
    border-top: 1px solid #e5e7eb !important;
}

.swib-filter-row .filter-label {
    font-size: 16px !important;
    font-weight: 700 !important;
    color: #1f2937 !important;
}

.swib-filter-row button {
    display: inline-flex !important;
    align-items: center !important;
    padding: 12px 20px !important;
    border: 2px solid #d1d5db !important;
    border-radius: 10px !important;
    background: white !important;
    color: #374151 !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    min-height: 44px !important;
}

.swib-filter-row button:hover {
    background: #f3f4f6 !important;
}

.swib-filter-row button.active {
    background: #0d9488 !important;
    color: white !important;
    border-color: #0d9488 !important;
}

/* =============================================
   MAIN CONTAINER
   ============================================= */
.tribe-events,
.tribe-common,
.tribe-events-view,
.tribe-events-l-container,
main.tribe-events,
#tribe-events {
    width: 100% !important;
    max-width: 1400px !important;
    margin: 0 auto !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
    display: block !important;
}

/* =============================================
   LIST VIEW STYLES
   ============================================= */
.tribe-events-view--list .tribe-events-calendar-list,
.tribe-events-calendar-list {
    display: block !important;
    width: 100% !important;
}

.tribe-events-calendar-list__event-row,
.tribe-common-g-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 16px !important;
    margin-bottom: 20px !important;
    width: 100% !important;
}

.tribe-events-calendar-list__event-date-tag {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 12px !important;
    background: #0d9488 !important;
    border-radius: 10px !important;
    color: white !important;
    min-width: 70px !important;
    max-width: 80px !important;
    flex-shrink: 0 !important;
}

.tribe-events-calendar-list__event-date-tag-daynum {
    font-size: 32px !important;
    font-weight: 800 !important;
    color: white !important;
    line-height: 1 !important;
}

.tribe-events-calendar-list__event-date-tag-weekday {
    font-size: 14px !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    color: rgba(255,255,255,0.95) !important;
}

.tribe-events-calendar-list__event-wrapper,
.tribe-events-calendar-list__event {
    flex: 1 !important;
    background: white !important;
    border-radius: 10px !important;
    padding: 20px !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1) !important;
    border: 1px solid #e5e7eb !important;
    width: auto !important;
}

.tribe-events-calendar-list__event-details {
    display: block !important;
    width: 100% !important;
}

.tribe-events-calendar-list__event-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    margin-bottom: 10px !important;
    line-height: 1.3 !important;
}

.tribe-events-calendar-list__event-title a {
    color: #1f2937 !important;
    text-decoration: none !important;
}

.tribe-events-calendar-list__event-datetime-wrapper,
.tribe-events-calendar-list__event-datetime {
    font-size: 16px !important;
    color: #4b5563 !important;
    display: block !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

.tribe-events-calendar-list__month-separator {
    width: 100% !important;
    margin: 30px 0 20px !important;
    padding: 16px 20px !important;
    background: #0d9488 !important;
    border-radius: 10px !important;
}

.tribe-events-calendar-list__month-separator-text {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: white !important;
}

/* =============================================
   MONTH VIEW - CALENDAR GRID - FULL WIDTH FIX
   ============================================= */
.tribe-events-view--month,
.tribe-events-calendar-month,
.tribe-events-pro-month-grid {
    display: block !important;
    width: 100% !important;
}

/* Force full-width table */
table.tribe-events-calendar-month,
.tribe-events-calendar-month {
    display: table !important;
    width: 100% !important;
    border-collapse: collapse !important;
    background: white !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    table-layout: fixed !important;
}

/* Header row - FORCE FULL WIDTH */
thead.tribe-events-calendar-month__header,
.tribe-events-calendar-month__header {
    display: table-header-group !important;
    width: 100% !important;
}

tr.tribe-events-calendar-month__header-row,
.tribe-events-calendar-month__header-row {
    display: table-row !important;
    width: 100% !important;
}

th.tribe-events-calendar-month__header-column,
.tribe-events-calendar-month__header-column {
    display: table-cell !important;
    width: 14.28% !important;
    background: #0d9488 !important;
    color: white !important;
    padding: 14px 8px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-align: center !important;
    text-transform: uppercase !important;
    border: none !important;
}

/* Body rows */
tbody.tribe-events-calendar-month__body,
.tribe-events-calendar-month__body {
    display: table-row-group !important;
    width: 100% !important;
}

tr.tribe-events-calendar-month__week,
.tribe-events-calendar-month__week {
    display: table-row !important;
    width: 100% !important;
}

/* Day cells - FORCE EQUAL WIDTH */
td.tribe-events-calendar-month__day,
.tribe-events-calendar-month__day {
    display: table-cell !important;
    width: 14.28% !important;
    border: 1px solid #e5e7eb !important;
    vertical-align: top !important;
    min-height: 100px !important;
    height: 120px !important;
    padding: 8px !important;
    background: white !important;
}

/* Day number styling */
.tribe-events-calendar-month__day-date,
.tribe-events-calendar-month__day-date-link {
    display: block !important;
    text-decoration: none !important;
}

.tribe-events-calendar-month__day-date-daynum {
    display: inline-block !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #374151 !important;
    margin-bottom: 6px !important;
}

/* Today highlight */
.tribe-events-calendar-month__day--current .tribe-events-calendar-month__day-date-daynum {
    background: #0d9488 !important;
    color: white !important;
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Events in calendar cells */
.tribe-events-calendar-month__calendar-event,
.tribe-events-calendar-month__events {
    display: block !important;
}

.tribe-events-calendar-month__calendar-event-title,
.tribe-events-calendar-month__calendar-event-title-link {
    display: block !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    padding: 3px 5px !important;
    background: #ecfdf5 !important;
    border-left: 3px solid #0d9488 !important;
    border-radius: 3px !important;
    margin-bottom: 3px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    text-decoration: none !important;
}

/* Multi-day events that span */
.tribe-events-calendar-month__multiday-event-bar-inner {
    background: #d1fae5 !important;
    border-left: 3px solid #0d9488 !important;
    padding: 4px 8px !important;
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    border-radius: 3px !important;
}

/* Other month days */
.tribe-events-calendar-month__day--past,
.tribe-events-calendar-month__day--other-month {
    background: #f9fafb !important;
}

.tribe-events-calendar-month__day--other-month .tribe-events-calendar-month__day-date-daynum {
    color: #9ca3af !important;
}

/* Month navigation at bottom */
.tribe-events-calendar-month-nav {
    display: flex !important;
    justify-content: space-between !important;
    padding: 20px 0 !important;
    margin-top: 20px !important;
}

/* =============================================
   NAVIGATION (for all views)
   ============================================= */
.tribe-events-c-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    padding: 20px 0 !important;
    margin-top: 20px !important;
    border-top: 1px solid #e5e7eb !important;
}

.tribe-events-c-nav__list {
    display: flex !important;
    justify-content: space-between !important;
    width: 100% !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.tribe-events-c-nav__list-item {
    display: inline-flex !important;
}

.tribe-events-c-nav__list-item--today {
    display: none !important;
}

.tribe-events-c-nav__prev,
.tribe-events-c-nav__next,
.tribe-events-c-nav__list-item a,
.tribe-events-c-nav__list-item button {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 14px 24px !important;
    background: #0d9488 !important;
    color: white !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    border: none !important;
    white-space: nowrap !important;
    min-height: 48px !important;
}

.tribe-events-c-nav__list-item button[disabled] {
    background: #e5e7eb !important;
    color: #6b7280 !important;
}

/* =============================================
   WEEK VIEW STYLES
   ============================================= */
.tribe-events-pro-week-grid {
    width: 100% !important;
}

.tribe-events-pro-week-grid__header {
    background: #0d9488 !important;
}

.tribe-events-pro-week-grid__header-column-weekday {
    color: white !important;
    font-weight: 700 !important;
}

/* =============================================
   MAP VIEW STYLES
   ============================================= */
.tribe-events-pro-map {
    width: 100% !important;
}

.tribe-events-pro-map__container {
    min-height: 500px !important;
    border-radius: 12px !important;
    overflow: hidden !important;
}

/* =============================================
   SUMMARY VIEW STYLES
   ============================================= */
.tribe-events-pro-summary {
    width: 100% !important;
}

.tribe-events-pro-summary__event-row {
    padding: 16px !important;
    border-bottom: 1px solid #e5e7eb !important;
}

/* =============================================
   MOBILE RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .swib-toolbar {
        padding: 16px !important;
        margin: 12px !important;
    }
    
    .swib-search-row {
        flex-direction: column !important;
    }
    
    .swib-search-row > div {
        min-width: 100% !important;
    }
    
    .swib-search-row button#swib-find-events {
        width: 100% !important;
        margin-top: 8px !important;
    }
    
    .swib-view-row {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .swib-view-row a {
        flex-shrink: 0 !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
    }
    
    .swib-filter-row {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
    }
    
    .swib-filter-row button {
        flex-shrink: 0 !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
    }
    
    /* Mobile list view */
    .tribe-events-calendar-list__event-row {
        flex-direction: column !important;
    }
    
    .tribe-events-calendar-list__event-date-tag {
        flex-direction: row !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
    
    /* Mobile month view */
    td.tribe-events-calendar-month__day {
        min-height: 50px !important;
        height: auto !important;
        padding: 4px !important;
    }
    
    .tribe-events-calendar-month__day-date-daynum {
        font-size: 12px !important;
    }
    
    .tribe-events-calendar-month__calendar-event-title-link,
    .tribe-events-calendar-month__multiday-event-bar-inner {
        font-size: 9px !important;
        padding: 2px 3px !important;
    }
    
    th.tribe-events-calendar-month__header-column {
        padding: 8px 2px !important;
        font-size: 10px !important;
    }
}

/* =============================================
   AGGRESSIVE CALENDAR HEADER FIX
   ============================================= */

/* Force table layout on the entire calendar */
.tribe-events-calendar-month {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
}

/* Force thead to be table-header-group */
.tribe-events-calendar-month > thead,
thead.tribe-events-calendar-month__header {
    display: table-header-group !important;
    width: 100% !important;
}

/* Force tr to be table-row */
.tribe-events-calendar-month > thead > tr,
.tribe-events-calendar-month__header > tr,
.tribe-events-calendar-month__header-row {
    display: table-row !important;
    width: 100% !important;
}

/* Force th to be table-cell with equal width */
.tribe-events-calendar-month > thead > tr > th,
.tribe-events-calendar-month__header > tr > th,
.tribe-events-calendar-month__header-column,
th.tribe-events-calendar-month__header-column {
    display: table-cell !important;
    width: 14.2857% !important;
    min-width: 14.2857% !important;
    max-width: 14.2857% !important;
    background: #0d9488 !important;
    color: white !important;
    padding: 16px 8px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-align: center !important;
    vertical-align: middle !important;
    border: none !important;
    box-sizing: border-box !important;
}

/* Style the inner div */
.tribe-events-calendar-month__header-column-title {
    display: block !important;
    text-align: center !important;
    color: white !important;
    font-weight: 700 !important;
}

.tribe-events-calendar-month__header-column-title span[aria-hidden="true"] {
    display: inline !important;
    color: white !important;
    font-weight: 700 !important;
    font-size: 14px !important;
}

/* Force tbody to be table-row-group */
.tribe-events-calendar-month > tbody,
tbody.tribe-events-calendar-month__body {
    display: table-row-group !important;
    width: 100% !important;
}

/* Force week rows */
.tribe-events-calendar-month > tbody > tr,
.tribe-events-calendar-month__week {
    display: table-row !important;
    width: 100% !important;
}

/* Force day cells */
.tribe-events-calendar-month > tbody > tr > td,
.tribe-events-calendar-month__day,
td.tribe-events-calendar-month__day {
    display: table-cell !important;
    width: 14.2857% !important;
    min-width: 14.2857% !important;
    max-width: 14.2857% !important;
    vertical-align: top !important;
    box-sizing: border-box !important;
}

/* Ensure no flexbox or grid is applied */
.tribe-events-calendar-month,
.tribe-events-calendar-month *,
.tribe-events-calendar-month thead,
.tribe-events-calendar-month tbody,
.tribe-events-calendar-month tr,
.tribe-events-calendar-month th,
.tribe-events-calendar-month td {
    flex: none !important;
    flex-direction: unset !important;
    flex-wrap: unset !important;
}

/* =============================================
   FIX NAVIGATION BUTTONS
   ============================================= */
.tribe-events-c-nav,
nav.tribe-events-c-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    max-width: 1400px !important;
    margin: 20px auto !important;
    padding: 20px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.tribe-events-c-nav__list {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 20px !important;
}

.tribe-events-c-nav__list-item {
    display: inline-flex !important;
    flex-shrink: 0 !important;
}

.tribe-events-c-nav__list-item--prev,
.tribe-events-c-nav__list-item--next {
    flex: 0 0 auto !important;
}

.tribe-events-c-nav__prev,
.tribe-events-c-nav__next,
.tribe-events-c-nav__list-item a,
.tribe-events-c-nav__list-item button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 14px 24px !important;
    background: #0d9488 !important;
    color: white !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    border: none !important;
    white-space: nowrap !important;
    min-height: 48px !important;
    min-width: 150px !important;
    overflow: visible !important;
}

.tribe-events-c-nav__list-item a:hover {
    background: #0f766e !important;
}

.tribe-events-c-nav__list-item button[disabled] {
    background: #e5e7eb !important;
    color: #9ca3af !important;
    cursor: not-allowed !important;
}

/* Ensure button text is visible */
.tribe-events-c-nav__prev-label,
.tribe-events-c-nav__next-label {
    display: inline !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

/* Fix any container overflow issues */
.tribe-events,
.tribe-events-l-container,
.tribe-events-view,
main.tribe-events {
    overflow: visible !important;
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
    .tribe-events-c-nav {
        padding: 15px !important;
    }
    
    .tribe-events-c-nav__list {
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    
    .tribe-events-c-nav__prev,
    .tribe-events-c-nav__next,
    .tribe-events-c-nav__list-item a,
    .tribe-events-c-nav__list-item button {
        padding: 12px 16px !important;
        min-width: 130px !important;
        font-size: 14px !important;
    }
}

/* =============================================
   FIX NAVIGATION BUTTON LAYOUT
   ============================================= */
.tribe-events-c-nav__list-item a,
.tribe-events-c-nav__list-item button,
a.tribe-events-c-nav__prev,
a.tribe-events-c-nav__next,
button.tribe-events-c-nav__prev,
button.tribe-events-c-nav__next {
    flex-direction: row !important;
    text-align: center !important;
}

/* Ensure text and icon are on same line */
.tribe-events-c-nav__list-item a span,
.tribe-events-c-nav__list-item button span,
.tribe-events-c-nav__prev span,
.tribe-events-c-nav__next span,
.tribe-events-c-nav__prev-label,
.tribe-events-c-nav__next-label {
    display: inline !important;
    vertical-align: middle !important;
}

/* Icon styling */
.tribe-events-c-nav__list-item a svg,
.tribe-events-c-nav__list-item button svg,
.tribe-events-c-nav__list-item a img,
.tribe-events-c-nav__list-item button img {
    display: inline-block !important;
    vertical-align: middle !important;
    margin-right: 8px !important;
    width: 16px !important;
    height: 16px !important;
}

.tribe-events-c-nav__list-item--next a svg,
.tribe-events-c-nav__list-item--next button svg,
.tribe-events-c-nav__list-item--next a img,
.tribe-events-c-nav__list-item--next button img {
    margin-right: 0 !important;
    margin-left: 8px !important;
}

/* Button inner span */
.tribe-events-c-nav__list-item a > span,
.tribe-events-c-nav__list-item button > span {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}
