/* ============================================
   Thriving Oregon Events - Modern Minimalist
   Color Palette:
   - #2F4858 (Dark Blue-Gray)
   - #33658A (Medium Blue)
   - #86BBD8 (Light Blue)
   - #F1B71B (Golden Yellow)
   - Black & White
   ============================================ */

/* ========== Reset & Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #2F4858;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========== Header ========== */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

.title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: #2F4858;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    font-size: 1.1rem;
    color: #33658A;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.status-bar {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.status-item {
    background: white;
    border-radius: 12px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 4px 18px rgba(47, 72, 88, 0.1);
    min-width: 170px;
}

.status-item span {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6c757d;
    margin-bottom: 0.35rem;
}

.status-item strong {
    font-size: 1.1rem;
    color: #2F4858;
}

/* ========== Controls Section ========== */
.controls-section {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    position: relative;
    z-index: 1;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(47, 72, 88, 0.08);
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.controls-title-wrapper {
    margin-bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.controls-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2F4858;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    display: inline-flex;
    align-items: center;
}

.visitor-counter {
    font-size: 0.875rem;
    color: #33658A;
    font-weight: 500;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.visitor-counter #visitor-count {
    font-weight: 600;
    color: #2F4858;
}

/* ========== Filters ========== */
.filters {
    display: flex;
    flex-direction: row;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: flex-end;
    flex: 1;
    justify-content: flex-start;
    width: 100%;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 200px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #2F4858;
}

.filter-group label svg {
    stroke: #33658A;
}

.filter-group input,
.filter-group select {
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: #2F4858;
    background: white;
    transition: all 0.3s ease;
}

/* Invert colors when filter is selected */
.filter-group select.filter-selected,
.filter-group input.filter-selected {
    background: #2F4858;
    color: white;
    border-color: #2F4858;
}

/* Style for active (enabled) options - inverted colors for better contrast */
.filter-group select option:not(:disabled) {
    background: white !important;
    color: #2F4858 !important;
    font-weight: 500;
}

/* Ensure selected option text is readable when select has dark background */
.filter-group select.filter-selected option:not(:disabled) {
    background: white !important;
    color: #2F4858 !important;
    font-weight: 500;
}

.filter-group select.filter-selected option:checked {
    background: #2F4858 !important;
    color: white !important;
    font-weight: 600;
}

/* Style for disabled options (unavailable filter options) - keep them clearly grayed out */
.filter-group select option:disabled {
    color: #999 !important;
    background: #f8f9fa !important;
    font-style: italic;
    opacity: 0.6;
    cursor: not-allowed;
    font-weight: normal;
}

.filter-group select.filter-selected option:disabled {
    color: #999 !important;
    background: #f8f9fa !important;
    font-weight: normal;
}

.filter-group input:focus,
.filter-group select:focus {
    outline: none;
    border-color: #33658A;
    box-shadow: 0 0 0 3px rgba(51, 101, 138, 0.1);
}

/* Category custom dropdown (Duck Games expandable) - high z-index so it opens above Featured Events */
.category-filter-wrapper {
    position: relative;
    z-index: 9999;
}

.category-filter-wrapper .category-filter-select {
    position: relative;
    width: 100%;
}

.category-filter-trigger {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: #2F4858;
    background: white;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.category-filter-trigger::after {
    content: '';
    width: 10px;
    height: 6px;
    margin-left: 0.5rem;
    flex-shrink: 0;
    background-color: currentColor;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1 L5 5 L9 1' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
    mask-size: contain;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1 L5 5 L9 1' stroke='black' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
    -webkit-mask-size: contain;
}

.category-filter-trigger:hover,
.category-filter-trigger:focus {
    outline: none;
    border-color: #33658A;
    box-shadow: 0 0 0 3px rgba(51, 101, 138, 0.1);
}

.category-filter-trigger.filter-selected {
    background: #2F4858;
    color: white;
    border-color: #2F4858;
}


.category-filter-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 320px;
    width: max-content;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: min(380px, 55vh);
    overflow-y: auto;
    z-index: 9999;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
}

.category-filter-dropdown[hidden] {
    display: none !important;
}

/* Venue and City: desktop uses native select, mobile uses custom dropdown like Category */
.venue-filter-wrapper,
.city-filter-wrapper {
    position: relative;
}

.venue-filter-select,
.city-filter-select {
    display: none;
    position: relative;
    width: 100%;
}

.venue-filter-native,
.city-filter-native {
    display: block;
    width: 100%;
}

.category-filter-dropdown-item {
    padding: 0.25rem 1rem;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    font-weight: 500;
    color: #2F4858;
    line-height: 1.35;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.category-filter-dropdown-item:hover:not(.category-filter-duck-header):not(.disabled) {
    background: #f0f4f8;
}

.category-filter-dropdown-item.disabled {
    color: #999;
    font-style: italic;
    cursor: not-allowed;
    opacity: 0.7;
}

.category-filter-duck-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.category-filter-duck-header:hover {
    background: #f0f4f8;
}

.category-filter-duck-arrow {
    flex-shrink: 0;
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-filter-duck-arrow svg {
    display: block;
}

.category-filter-duck-header.expanded .category-filter-duck-arrow {
    transform: rotate(90deg);
}

.category-filter-duck-subitems {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.2s ease;
}

.category-filter-duck-header.expanded + .category-filter-duck-subitems {
    max-height: 500px;
}

.category-filter-dropdown-subitem {
    padding: 0.25rem 1rem 0.25rem 1.75rem;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    font-weight: 500;
    color: #2F4858;
    line-height: 1.35;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.category-filter-dropdown-subitem:hover:not(.disabled) {
    background: #f0f4f8;
}

.category-filter-dropdown-subitem.disabled {
    color: #999;
    font-style: italic;
    cursor: not-allowed;
    opacity: 0.7;
}

.label-clear-button {
    background: #2F4858;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.8;
    margin-left: 0.5rem;
}

.label-clear-button:hover {
    background: #1a2f3a;
    opacity: 1;
    transform: scale(1.1);
}

.label-clear-button svg {
    stroke: white !important;
    stroke-width: 2;
    fill: none;
}

.date-range-group {
    min-width: 260px;
}

.date-range-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.date-input-wrapper input {
    flex: 1;
}

.date-placeholder {
    position: absolute;
    left: 0.75rem;
    pointer-events: none;
    color: #6c757d;
    font-size: 0.95rem;
    z-index: 1;
    opacity: 0;
}

.date-input-wrapper input:invalid + .date-placeholder {
    opacity: 1;
}

.date-input-wrapper input:valid + .date-placeholder {
    opacity: 0;
}

.date-range-inputs input {
    flex: 1;
}

.date-range-separator {
    font-weight: 600;
    color: #33658A;
}

.quick-date-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.range-chip {
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid #33658A;
    background: white;
    color: #33658A;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.range-chip:hover,
.range-chip.active {
    background: #33658A;
    color: white;
}

.active-filters {
    display: none; /* Hidden - active filters section removed */
}

.active-filters-empty {
    font-size: 0.85rem;
    color: #6c757d;
}

.active-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #eef5f9;
    color: #2F4858;
    border-radius: 999px;
    padding: 0.35rem 0.55rem 0.35rem 0.85rem;
    font-size: 0.85rem;
}

.active-filter-chip button {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.15rem;
    cursor: pointer;
}

.active-filter-chip button:hover {
    color: #a94452;
}

.favorites-button {
    padding: 0.65rem 1.2rem;
    border-radius: 10px;
    border: 1px solid #F1B71B;
    background: white;
    color: #F1B71B;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.favorites-button:hover {
    background: #F1B71B;
    color: white;
}

/* ========== Find Button ========== */
.find-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #F1B71B 0%, #e5a80a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(241, 183, 27, 0.3);
    white-space: nowrap;
}

.find-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 183, 27, 0.4);
    background: linear-gradient(135deg, #e5a80a 0%, #d49509 100%);
}

.find-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(241, 183, 27, 0.3);
}

.find-button svg {
    stroke: white;
    stroke-width: 2;
    flex-shrink: 0;
}

/* ========== Calendar Wrapper ========== */
.calendar-wrapper {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(47, 72, 88, 0.12);
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* ========== Controls Actions Bar ========== */
.controls-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e0e0e0;
    width: 100%;
    flex-wrap: nowrap;
}

.controls-actions-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.controls-actions-right {
    display: flex;
    align-items: center;
    margin-left: auto;
    flex-shrink: 0;
}

/* ========== Featured Events Section ========== */
.featured-events-wrapper {
    margin-top: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(47, 72, 88, 0.1);
    padding: 1.5rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.featured-events-title-wrapper {
    margin-bottom: 1.5rem;
}

.featured-events-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2F4858;
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.featured-events-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

/* Rolodex Card Style */
.featured-event-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(47, 72, 88, 0.12);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    border: 1px solid #e9ecef;
    border-top: 4px solid #33658A;
}

.featured-event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(47, 72, 88, 0.2);
    border-top-color: #F1B71B;
}

.featured-event-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #33658A 0%, #86BBD8 100%);
    transition: all 0.3s ease;
}

.featured-event-card:hover::before {
    background: linear-gradient(90deg, #F1B71B 0%, #e5a80a 100%);
}

/* Date Section at Top - Narrow and Horizontal */
.featured-event-date {
    background: #2F4858; /* Dark blue */
    color: white;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
}

.featured-event-card:hover .featured-event-date {
    background: #2F4858; /* Keep dark blue on hover */
}

.featured-event-date-month {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0.9;
}

.featured-event-date-day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    font-family: 'Inter', sans-serif;
}

.featured-event-date-weekday {
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Event Details Section at Bottom */
.featured-event-details {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: white; /* White background */
    color: #2F4858; /* Dark blue text */
}

.featured-event-category {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white !important;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: fit-content;
}

.featured-event-name {
    font-size: 1rem;
    font-weight: 600;
    color: #2F4858; /* Dark blue text */
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

.featured-event-time {
    font-size: 0.85rem;
    color: #2F4858; /* Dark blue text */
    font-weight: 500;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.featured-event-time svg {
    width: 14px;
    height: 14px;
    stroke: #2F4858; /* Dark blue */
    flex-shrink: 0;
}

.featured-event-location {
    font-size: 0.8rem;
    color: #2F4858; /* Dark blue text */
    margin: 0.5rem 0 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.featured-event-link {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2F4858; /* Dark blue text */
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.featured-event-link:hover {
    color: #33658A; /* Slightly lighter blue on hover */
}

.featured-event-link svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    transition: transform 0.2s ease;
}

.featured-event-card:hover .featured-event-link svg {
    transform: translateX(4px);
}

.featured-event-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
    font-size: 0.95rem;
}

/* Responsive: 2 columns on tablets */
@media (max-width: 1024px) {
    .featured-events-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Responsive: 1 column on mobile */
@media (max-width: 768px) {
    .featured-events-wrapper {
        margin-top: 1.5rem;
        padding: 1rem;
    }
    
    .featured-events-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .featured-event-card {
        min-height: 240px;
    }
    
    .featured-event-date-day {
        font-size: 1.75rem;
    }
}


.event-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: 2px solid #2F4858;
    background: white;
    color: #2F4858;
    border-radius: 24px;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
}

.event-count-badge .event-count-label {
    font-size: 0.95rem;
    font-weight: 500;
    color: #2F4858;
}

.event-count-badge .event-count-number {
    font-size: 0.95rem;
    font-weight: 700;
    color: #2F4858;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}


/* ========== FullCalendar Customization ========== */
.fc {
    font-family: 'Inter', sans-serif;
}

.fc .fc-toolbar-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 600;
    color: #2F4858;
}

.fc .fc-button {
    background: #2F4858;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 500;
    text-transform: capitalize;
    transition: all 0.3s ease;
}

.fc .fc-button:hover {
    background: #33658A;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(51, 101, 138, 0.3);
}

.fc .fc-button:active {
    transform: translateY(0);
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background: #F1B71B;
}

.fc-theme-standard .fc-scrollgrid {
    border-color: #e9ecef;
}

.fc .fc-col-header-cell {
    background: #f8f9fa;
    padding: 1rem 0.5rem;
    font-weight: 600;
    color: #2F4858;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    border-color: #e9ecef;
}

.fc .fc-daygrid-day {
    transition: background 0.2s ease;
    cursor: pointer;
    padding: 0.25rem;
}

.fc .fc-daygrid-day:hover {
    background: #f8f9fa;
}

.fc .fc-daygrid-day:hover .fc-daygrid-day-number {
    color: #33658A;
    font-weight: 600;
}

.fc .fc-daygrid-day-number {
    padding: 0.5rem 0.75rem;
    color: #2F4858;
    font-weight: 500;
    font-size: 0.95rem;
}

.fc .fc-daygrid-day.fc-day-today {
    background: rgba(241, 183, 27, 0.08) !important;
}

.fc .fc-daygrid-day.fc-day-today .fc-daygrid-day-number {
    background: #F1B71B;
    color: white;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.fc .fc-event {
    border: none;
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    margin: 3px 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    line-height: 1.3;
}

.fc .fc-event:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.fc .fc-event-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.fc-timegrid-slot {
    height: 3rem;
}

.fc-timegrid-event {
    border-radius: 6px;
}

/* All-day events section styling */
.fc .fc-timegrid-axis-cushion,
.fc .fc-timegrid-slot-label-cushion {
    font-size: 0.875rem;
    color: #2F4858;
    font-weight: 500;
}

.fc .fc-timegrid-divider {
    background: #e9ecef;
    padding: 0.5rem 0;
}

.fc .fc-daygrid-day-frame {
    min-height: 80px;
}

.fc .fc-more-link {
    padding: 0.35rem 0.6rem;
    margin: 3px 6px;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    background: rgba(51, 101, 138, 0.1);
    color: #33658A;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.fc .fc-more-link:hover {
    background: rgba(51, 101, 138, 0.2);
    transform: translateY(-1px);
}

.fc .fc-timegrid-event .fc-event-title {
    font-weight: 500;
}

/* All-day events in week view */
.fc .fc-timegrid-event.fc-event-start {
    border-left-width: 4px;
}

.fc-direction-ltr .fc-timegrid-col-events {
    margin: 0 2px;
}

/* ========== Modal ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(47, 72, 88, 0.8);
    backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

/* Event modal should appear on top of filter/day modals */
#event-modal {
    z-index: 1100;
}

/* Category badge text color - all badges should have white text */
#modal-category,
.modal-category,
.day-event-category,
span[class*="category"] {
    color: white !important;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.4s ease-out;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Only form modals should be wide - Add Event and Review modals */
.modal-content.wide-modal {
    max-width: 960px !important;
}

/* Ensure regular modals stay portrait */
.modal-content:not(.wide-modal) {
    max-width: 500px !important;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #f8f9fa;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.modal-close:hover {
    background: #2F4858;
    transform: rotate(90deg);
}

.modal-close:hover svg {
    stroke: white;
}

.modal-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
}

.modal-category {
    display: inline-block;
    padding: 0.25rem 0.65rem;
    border-radius: 16px;
    font-size: 0.7rem;
    font-weight: 600;
    color: white !important;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.modal-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2F4858;
    line-height: 1.3;
    margin: 0;
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Optimize Add Event modal to fit without scrolling */
.modal-content.wide-modal .modal-body {
    padding: 1rem 1.5rem;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
}

.modal-content.wide-modal .form-grid {
    gap: 0.6rem;
}

.modal-content.wide-modal .form-group {
    gap: 0.3rem;
}

.modal-content.wide-modal .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.2rem;
}

.modal-content.wide-modal .form-group input,
.modal-content.wide-modal .form-group textarea {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

.modal-detail {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    align-items: flex-start;
}

.modal-detail svg {
    flex-shrink: 0;
    stroke: #33658A;
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
}

.modal-detail strong {
    display: block;
    font-weight: 600;
    color: #2F4858;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.modal-detail p {
    color: #495057;
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

.modal-description {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #e9ecef;
}

.modal-description strong {
    display: block;
    font-weight: 600;
    color: #2F4858;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.modal-description p {
    color: #495057;
    line-height: 1.6;
    font-size: 0.9rem;
}

.modal-map {
    margin-top: 1.5rem;
}

.modal-map strong {
    display: block;
    font-weight: 600;
    color: #2F4858;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.map-frame {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(47, 72, 88, 0.18);
    border: 1px solid #e9ecef;
    height: 180px;
}

.map-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex-shrink: 0;
}

/* Base: row layout for desktop - PERMANENT: buttons must stay on one line */
/* Highest specificity to override everything */
@media (min-width: 769px) {
    #event-modal .modal-footer-actions,
    .modal-content .modal-footer-actions,
    .modal-footer-actions {
        display: flex !important;
        flex-direction: row !important;
        gap: 0.75rem !important;
        flex-wrap: nowrap !important;
        margin-bottom: 1rem !important;
    }
    
    #event-modal .modal-footer-actions .btn-secondary,
    .modal-content .modal-footer-actions .btn-secondary,
    .modal-footer-actions .btn-secondary {
        width: auto !important;
        flex: 1 1 auto !important;
        max-width: none !important;
    }
}

/* Mobile: column layout */
@media (max-width: 768px) {
    .modal-footer-actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.75rem !important;
        flex-wrap: nowrap !important;
        margin-bottom: 1rem !important;
    }
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1rem;
    border-radius: 10px;
    border: 1px solid #33658A;
    background: white;
    color: #33658A;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
}

.btn-secondary:hover {
    background: #33658A;
    color: white;
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary.is-active {
    background: #F1B71B;
    border-color: #F1B71B;
    color: white;
}

.btn-primary {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #F1B71B 0%, #e5a80a 100%);
    color: white;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(241, 183, 27, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(241, 183, 27, 0.4);
}

/* ========== Day Modal ========== */
.day-modal-content {
    max-width: 600px;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
}

/* Fix for mobile browser viewport height issue */
@supports (height: 100svh) {
    .day-modal-content {
        max-height: calc(100svh - 2rem);
    }
}

/* ========== Add Event Section ========== */
.add-event-wrapper {
    margin-top: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(47, 72, 88, 0.1);
    padding: 1.25rem;
}

.add-event-wrapper .find-button {
    width: auto;
    justify-content: flex-start;
}

.add-event-title-wrapper {
    margin-bottom: 0.75rem;
}

.add-event-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2F4858;
    margin: 0;
}

.add-event-subtitle {
    color: #6c757d;
    margin-top: 0.25rem;
    font-size: 0.9rem;
}

/* Add Event Modal form */
/* Base form grid - desktop 2 columns, mobile 1 column */
.form-grid {
    display: grid;
    gap: 0.75rem;
}

@media (min-width: 769px) {
    .form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .form-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Ensure wide modal form grid uses 2 columns on desktop only */
@media (min-width: 769px) {
    .modal-content.wide-modal .form-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 0.6rem;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-group-full {
    grid-column: 1 / -1;
}

.required-asterisk {
    color: #dc3545;
    font-weight: bold;
    margin-left: 2px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2F4858;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 0.9rem;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    color: #2F4858;
    background: white;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #33658A;
    box-shadow: 0 0 0 3px rgba(51, 101, 138, 0.1);
}

.detected-city {
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: #33658A;
    min-height: 1.2em;
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(20%);
}

.review-warning {
    margin-top: 0.4rem;
    color: #c0392b;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .day-modal-content {
        max-height: calc(100svh - 1rem);
    }
    
    @supports not (height: 100svh) {
        .day-modal-content {
            max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1rem);
        }
    }
}

/* ========== Toast ==========
   lightweight success/error popup at bottom center */
.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%) translateY(20px);
    background: #2fb36c; /* success green */
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 1200;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    background: #c0392b; /* error red */
}

.toast a {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
    margin-left: 0.5rem;
}

.day-modal-subtitle {
    color: #33658A;
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.day-modal-body {
    padding: 1.25rem 1.5rem 1.5rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.day-events-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

@media (max-width: 768px) {
    .day-events-list {
        width: 100% !important;
        max-width: 100% !important;
    }
}

.day-event-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.25rem;
    border-left: 4px solid #2F4858;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
    position: relative;
}

.day-event-card.is-favorite {
    position: relative;
    border-left-color: #F1B71B;
}

.favorite-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #F1B71B;
}

.day-event-card:hover {
    background: white;
    box-shadow: 0 4px 12px rgba(47, 72, 88, 0.12);
    transform: translateX(4px);
}

.remove-favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #dc3545;
    padding: 0;
    z-index: 10;
}

.remove-favorite-btn:hover {
    background: rgba(220, 53, 69, 0.2);
    border-color: #dc3545;
    transform: scale(1.1);
}

.remove-favorite-btn svg {
    width: 16px;
    height: 16px;
}

.day-event-time {
    font-weight: 600;
    color: #33658A;
    font-size: 0.9rem;
    min-width: 80px;
    padding-top: 0.25rem;
}

.day-event-content {
    flex: 1;
    min-width: 0; /* Allow flex item to shrink below content size */
}

.day-event-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white !important;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.day-event-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2F4858;
    margin: 0.5rem 0 0.25rem;
    line-height: 1.4;
    min-width: 0; /* Allow flex item to shrink */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.day-event-location {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0; /* Allow flex item to shrink */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.day-event-location::before {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1.1em;
    min-width: 1em;
    margin-right: 0.35em;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
    vertical-align: -0.15em;
}

.no-events {
    text-align: center;
    color: #6c757d;
    padding: 3rem 1rem;
    font-size: 1rem;
}

/* ========== Animations ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ========== Responsive Design ========== */
/* COMPREHENSIVE MOBILE FORMATTING - All rules use !important to override desktop */
@media (max-width: 768px) {
    /* Main page layout */
    .container {
        padding: 1rem !important;
    }

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

    .title {
        font-size: 1.75rem !important;
    }

    .subtitle {
        font-size: 0.85rem !important;
    }

    .controls-section {
        flex-direction: column !important;
        align-items: stretch !important;
        padding: 0.75rem !important;
        gap: 0.6rem !important;
        margin-bottom: 1.25rem !important;
    }

    .controls-title-wrapper {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Hide desktop visitor counter on mobile */
    .visitor-counter:not(.visitor-counter-mobile) {
        display: none !important;
    }

    /* Mobile visitor counter: same line as "Search By", right-justified */
    .visitor-counter-mobile {
        display: flex !important;
        font-size: 0.8rem !important;
        margin-left: auto !important;
        flex: none !important;
    }

    /* Filters - stacked vertically, full width, left-aligned */
    .filters {
        flex-direction: column !important;
        width: 100% !important;
        justify-content: stretch !important;
        gap: 0.6rem !important;
    }
    
    .filter-group {
        width: 100% !important;
        min-width: 100% !important;
        align-items: flex-start !important;
        text-align: left !important;
        flex: none !important;
    }
    
    .filter-group label {
        justify-content: flex-start !important;
        text-align: left !important;
        width: 100% !important;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100% !important;
        text-align: left !important;
    }
    
    /* Date range inputs - stacked vertically */
    .date-range-group {
        width: 100% !important;
        min-width: 100% !important;
    }
    
    .date-range-inputs {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }
    
    .date-input-wrapper {
        width: 100% !important;
        flex: none !important;
        min-width: 100% !important;
    }
    
    .date-range-separator {
        display: none !important;
    }
    
    /* Date placeholder: visible "mm/dd/yyyy" when empty (JS adds .date-empty), dark blue */
    .date-input-wrapper .date-placeholder {
        color: #2F4858 !important;
        font-size: 0.75rem !important;
        left: 0.6rem !important;
    }
    .date-input-wrapper.date-empty .date-placeholder {
        opacity: 1 !important;
    }
    .date-input-wrapper:not(.date-empty) .date-placeholder {
        opacity: 0 !important;
    }
    .date-input-wrapper.date-empty input {
        color: transparent !important;
    }
    .date-input-wrapper:not(.date-empty) input {
        color: #2F4858 !important;
    }
    /* Keep date inputs readable when a date is selected (don't use filter-selected dark background) */
    .date-input-wrapper input.filter-selected {
        background: white !important;
        color: #2F4858 !important;
        border-color: #ced4da !important;
    }
    
    /* Action buttons - stacked vertically */
    .controls-actions {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.75rem !important;
    }
    
    .controls-actions-left,
    .controls-actions-right {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .controls-actions .find-button,
    .controls-actions .favorites-button {
        width: 100% !important;
        justify-content: center !important;
    }
    
    /* ALL MODALS - Full width, proper mobile formatting */
    .modal.active {
        padding: 0.5rem !important;
        align-items: flex-start !important;
        padding-top: 2rem !important;
    }
    
    .modal-content {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        max-height: calc(100vh - 1rem) !important;
        border-radius: 16px 16px 0 0 !important;
    }
    
    .modal-content.wide-modal {
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .modal-header {
        padding: 1rem 1.25rem 0.75rem !important;
    }
    
    .modal-body {
        padding: 1.25rem !important;
    }
    
    /* Form grids - single column on mobile */
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        display: grid !important;
    }
    
    .modal-content.wide-modal .form-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
        display: grid !important;
    }
    
    .form-group {
        width: 100% !important;
    }
    
    /* Modal footer - buttons stacked vertically */
    .modal-footer {
        padding: 1rem 1.5rem 1.5rem !important;
    }
    
    .modal-footer-actions {
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        display: flex !important;
        gap: 0.75rem !important;
        width: 100% !important;
    }
    
    .modal-footer-actions .btn-secondary,
    .modal-footer-actions .btn-primary {
        width: 100% !important;
        flex: none !important;
        max-width: 100% !important;
        min-width: 100% !important;
    }
    
    /* All buttons full width on mobile */
    .btn-primary,
    .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
        max-width: 100% !important;
    }
    
    /* Reduced font sizes for mobile to fit more content */
    /* Filter labels and inputs */
    .filter-group label {
        font-size: 0.75rem !important;
    }
    
    .filter-group select,
    .filter-group input {
        font-size: 0.8rem !important;
        padding: 0.6rem 0.75rem !important;
    }
    
    /* Category filter: match Venue and City font size on mobile */
    .category-filter-trigger,
    .category-filter-dropdown,
    .category-filter-dropdown-item,
    .category-filter-dropdown-subitem {
        font-size: 0.8rem !important;
    }
    
    /* Venue and City: on mobile use custom dropdown (like Category), hide native select */
    .venue-filter-select,
    .city-filter-select {
        display: block !important;
    }
    .venue-filter-native,
    .city-filter-native {
        display: none !important;
    }
    .venue-filter-wrapper .venue-filter-trigger,
    .city-filter-wrapper .city-filter-trigger {
        font-size: 0.8rem !important;
        touch-action: manipulation;
    }
    .venue-filter-wrapper,
    .city-filter-wrapper {
        touch-action: manipulation;
    }
    .venue-filter-dropdown,
    .city-filter-dropdown {
        font-size: 0.8rem !important;
        min-width: 100%;
        width: 100%;
    }
    
    /* Date inputs */
    .date-input-wrapper input {
        font-size: 0.75rem !important;
        padding: 0.5rem 0.6rem !important;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary {
        font-size: 0.85rem !important;
        padding: 0.65rem 1rem !important;
    }
    
    .btn-label {
        font-size: 0.85rem !important;
    }
    
    /* Modal headers */
    .modal-title {
        font-size: 1.1rem !important;
    }
    
    .modal-header {
        font-size: 0.9rem !important;
    }
    
    /* Modal body text */
    .modal-body {
        font-size: 0.85rem !important;
    }
    
    .modal-body p,
    .modal-body strong {
        font-size: 0.85rem !important;
        line-height: 1.4 !important;
    }
    
    .modal-detail {
        font-size: 0.85rem !important;
        margin-bottom: 1rem !important;
    }
    
    .modal-detail strong {
        font-size: 0.8rem !important;
    }
    
    .modal-detail p {
        font-size: 0.85rem !important;
    }
    
    .modal-description {
        font-size: 0.85rem !important;
    }
    
    .modal-description strong {
        font-size: 0.8rem !important;
    }
    
    .modal-description p {
        font-size: 0.85rem !important;
        line-height: 1.5 !important;
    }
    
    /* Form labels and inputs */
    .form-group label {
        font-size: 0.75rem !important;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 0.8rem !important;
        padding: 0.6rem 0.75rem !important;
    }
    
    /* Modal footer buttons */
    .modal-footer-actions .btn-secondary,
    .modal-footer-actions .btn-primary {
        font-size: 0.8rem !important;
        padding: 0.6rem 0.9rem !important;
    }
    
    .modal-footer-actions .btn-label {
        font-size: 0.8rem !important;
    }
}

/* Desktop styles - must come after mobile to override */
@media (min-width: 769px) {
    /* Hide mobile visitor counter on desktop */
    .visitor-counter-mobile {
        display: none !important;
    }

    /* Show desktop visitor counter on desktop */
    .visitor-counter:not(.visitor-counter-mobile) {
        display: block !important;
    }
    
    /* Desktop: Ensure day-event-card uses row layout */
    .day-event-card {
        flex-direction: row !important;
    }
    
    /* Desktop: day-event-content should use flex: 1 in row layout */
    .day-event-content {
        flex: 1 !important;
        width: auto !important;
    }
    .filters {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: flex-end;
    }

    .filter-group {
        min-width: 160px;
        width: auto;
        flex: 1 1 160px;
        max-width: 220px;
    }

    .date-range-group {
        min-width: 300px;
        flex: 1 1 300px;
        max-width: 100%;
    }

    .date-range-inputs {
        width: 100%;
        min-width: 0;
    }

    .date-input-wrapper {
        flex: 1 1 0;
        min-width: 0;
    }

    .date-input-wrapper input {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
    
    /* Ensure action buttons stay on one line */
    .controls-actions {
        flex-direction: row !important;
        justify-content: space-between !important;
    }
    
    .controls-actions-left,
    .controls-actions-right {
        width: auto !important;
        justify-content: flex-start !important;
    }
    
    .controls-actions-right {
        justify-content: flex-end !important;
    }
    
    .controls-actions .find-button,
    .controls-actions .favorites-button {
        width: auto !important;
    }
    
    /* Ensure Add Event button is portrait and left-justified */
    .add-event-wrapper .find-button {
        width: auto !important;
        justify-content: flex-start !important;
    }
    
    /* Keep modal footer actions in a row on desktop - PERMANENT: DO NOT CHANGE */
    /* This MUST override all other rules - highest specificity */
    #event-modal .modal-footer-actions,
    .modal-content .modal-footer-actions,
    .modal-footer-actions {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.75rem !important;
        margin-bottom: 1rem !important;
    }
    
    #event-modal .modal-footer-actions .btn-secondary,
    .modal-content .modal-footer-actions .btn-secondary,
    .modal-footer-actions .btn-secondary {
        width: auto !important;
        flex: 1 1 auto !important;
        max-width: none !important;
        min-width: 0 !important;
    }

    .filter-group label {
        font-size: 0.75rem;
        gap: 0.3rem;
    }

    .filter-group label svg {
        width: 13px;
        height: 13px;
    }

    .filter-group input,
    .filter-group select {
        width: 100%;
        padding: 0.5rem 0.65rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .category-filter-trigger {
        padding: 0.5rem 0.65rem;
        font-size: 0.85rem;
        border-radius: 8px;
    }

    .category-filter-dropdown {
        font-size: 0.85rem;
    }

    .date-range-group {
        min-width: unset; /* Remove min-width constraint */
        width: 100%;
    }

    .date-range-inputs {
        gap: 0.3rem;
    }

    .date-input-wrapper {
        flex: 1;
    }

    .date-input-wrapper input {
        padding: 0.5rem 0.45rem;
        font-size: 0.8rem;
        min-width: 120px;
        color: #2F4858 !important;
        background-color: white !important;
        flex: 1;
    }

    .date-placeholder {
        font-size: 0.8rem;
        left: 0.45rem;
        color: #6c757d;
    }

    .date-input-wrapper input:invalid {
        color: transparent; /* Hide default text when empty */
    }

    .date-input-wrapper input:valid {
        color: #2F4858 !important; /* Show date text when valid */
    }

    .date-range-inputs input::-webkit-calendar-picker-indicator {
        opacity: 1; /* Ensure calendar icon is visible */
        cursor: pointer;
        position: relative; /* Ensure it's above placeholder */
        z-index: 2;
    }

    .date-range-separator {
        font-size: 0.75rem;
        padding: 0 0.2rem;
    }

    .quick-date-buttons {
        gap: 0.35rem;
        margin-top: 0.4rem;
    }

    .range-chip {
        padding: 0.3rem 0.6rem;
        font-size: 0.75rem;
        border-radius: 999px;
    }

    .label-clear-button {
        width: 16px; /* Reduced from 18px */
        height: 16px;
        margin-left: 0.35rem; /* Reduced from 0.5rem */
    }

    .label-clear-button svg {
        width: 10px; /* Reduced from 12px */
        height: 10px;
    }

    .find-button {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
        width: 100%;
        justify-content: center;
        margin-top: 0.2rem;
    }

    .find-button svg {
        width: 13px;
        height: 13px;
    }

    .favorites-button {
        padding: 0.55rem 0.9rem;
        font-size: 0.8rem;
        width: 100%;
        justify-content: center;
        margin-top: 0.2rem;
    }

    .favorites-button svg {
        width: 13px;
        height: 13px;
    }

    .favorites-button .btn-label {
        font-size: 0.8rem;
    }

    .active-filters {
        justify-content: flex-start;
        margin-top: 0.6rem;
        gap: 0.35rem;
    }

    .active-filter-chip {
        padding: 0.25rem 0.45rem 0.25rem 0.6rem;
        font-size: 0.75rem;
    }

    .status-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .calendar-wrapper {
        padding: 1rem;
    }

    .fc .fc-toolbar-title {
        font-size: 1.35rem;
    }

    .modal.active {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    .modal-content {
        margin: 0;
        max-width: 100%;
        max-height: calc(100vh - 1rem);
        border-radius: 16px 16px 0 0;
        width: 100%;
    }

    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    .modal-header {
        padding: 1rem 1.25rem 0.75rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }

    .modal-body {
        padding: 1.25rem;
    }

    .day-modal-content {
        max-width: 100%;
        max-height: calc(100svh - 1rem);
        border-radius: 16px 16px 0 0;
    }
    
    @supports not (height: 100svh) {
        .day-modal-content {
            max-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 1rem);
        }
    }

    .day-modal-body {
        padding: 1rem 1.25rem 1.25rem;
    }
    
    /* Mobile: Improve spacing for saved events cards and search results */
    .day-event-card {
        padding: 1rem !important;
        gap: 0.75rem !important;
        flex-direction: column !important;
        display: flex !important;
        position: relative;
        align-items: stretch !important; /* Ensure children can span full width */
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Date/time and category badge on left, full width on mobile */
    .day-event-time {
        font-size: 0.8rem !important;
        min-width: unset !important;
        max-width: 100% !important;
        padding-top: 0 !important;
        margin-bottom: 0.5rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        order: 1 !important;
        width: 100% !important;
        flex: 0 0 auto !important;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
        align-self: stretch !important;
        box-sizing: border-box !important;
    }
    
    /* Category badge container - must span full width to allow children to span full width */
    .day-event-content {
        order: 2 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        position: relative;
        margin-bottom: 0.5rem !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-right: 2.5rem !important; /* Account for remove button */
        padding-left: 0 !important;
        flex: 0 0 auto !important; /* Override desktop flex: 1 - don't grow or shrink */
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
        flex-basis: auto !important;
        align-self: stretch !important; /* Stretch to full width */
        box-sizing: border-box !important;
        overflow: visible !important;
    }
    
    /* Category badge on first line, left justified */
    .day-event-content .day-event-category,
    .day-event-content .modal-category {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
        margin-bottom: 0.25rem;
        margin-top: 0;
        margin-left: 0;
        margin-right: auto; /* Left justify */
        order: 1;
        width: fit-content;
        display: inline-block;
    }
    
    /* Favorite indicator below category badge */
    .day-event-content .favorite-indicator {
        order: 2;
        margin-bottom: 0.5rem;
        margin-top: 0;
    }
    
    /* Remove button on first line, right justified */
    .remove-favorite-btn {
        position: absolute;
        top: 0;
        right: 0;
        width: 28px;
        height: 28px;
        z-index: 10;
    }
    
    .remove-favorite-btn svg {
        width: 14px;
        height: 14px;
    }
    
    /* Event title - span full width inside content container, break any constraints */
    .day-event-content .day-event-title,
    .day-event-card .day-event-content .day-event-title {
        font-size: 0.95rem !important;
        margin: 0.5rem 0 0.25rem 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
        line-height: 1.3 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        order: 3 !important;
        flex: none !important;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
        flex-basis: auto !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        box-sizing: border-box !important;
        align-self: stretch !important;
        display: block !important;
        position: relative !important;
    }
    
    /* Location - span full width inside content container, break any constraints */
    .day-event-content .day-event-location,
    .day-event-card .day-event-content .day-event-location {
        font-size: 0.8rem !important;
        margin: 0.25rem 0 0 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        order: 4 !important;
        flex: none !important;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
        flex-basis: auto !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        box-sizing: border-box !important;
        align-self: stretch !important;
        display: block !important;
        position: relative !important;
    }

    .modal-footer {
        padding: 1rem 1.5rem 1.5rem;
    }

    .modal-footer-actions {
        flex-direction: column !important;
        gap: 0.75rem !important;
        display: flex !important;
        flex-wrap: nowrap !important;
    }

    .btn-primary,
    .btn-secondary {
        width: 100% !important;
        justify-content: center !important;
        max-width: 100% !important;
    }
    
    /* Hide calendar on mobile, show vertical day list */
    #calendar {
        display: none !important;
    }
    
    #mobile-day-list {
        display: block !important;
    }
    
    /* Hide active filters section on mobile */
    .active-filters {
        display: none !important;
    }
    
    /* Stack controls actions vertically on mobile */
    .controls-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .controls-actions-left,
    .controls-actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .controls-actions .find-button,
    .controls-actions .favorites-button {
        width: 100%;
        justify-content: center;
    }
}

/* ========== Mobile Vertical Day List ========== */
.mobile-day-list {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: calc(100svh - 300px);
    overflow-y: auto;
    padding: 0;
    gap: 0;
}

.mobile-month-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
    margin: 0;
}

.mobile-month-btn {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #33658A;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mobile-month-btn:hover {
    background-color: #e0e0e0;
}

.mobile-month-btn:active {
    background-color: #d0d0d0;
}

.mobile-month-title {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
    text-align: center;
    flex: 1;
}

.mobile-days-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.mobile-day-card {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(47, 72, 88, 0.1);
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid #e9ecef;
}

.mobile-day-card:hover {
    box-shadow: 0 4px 12px rgba(47, 72, 88, 0.15);
    transform: translateX(2px);
}

.mobile-day-today {
    border-left-color: #F1B71B;
    background: rgba(241, 183, 27, 0.05);
}

.mobile-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.mobile-day-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-day-name {
    font-weight: 600;
    color: #33658A;
    font-size: 0.85rem;
    min-width: 40px;
}

.mobile-day-number {
    font-weight: 700;
    color: #2F4858;
    font-size: 1.25rem;
    min-width: 28px;
}

.mobile-day-month {
    font-weight: 500;
    color: #6c757d;
    font-size: 0.85rem;
}

.mobile-day-count {
    font-size: 0.75rem;
    color: #6c757d;
    font-weight: 500;
}

.mobile-day-events {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-event-badge {
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-event-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.mobile-event-favorite {
    position: relative;
}

.mobile-event-favorite::before {
    content: '\2665';
    margin-right: 0.25rem;
}

.mobile-more-link {
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    background: rgba(51, 101, 138, 0.1);
    color: #33658A;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.mobile-more-link:hover {
    background: rgba(51, 101, 138, 0.2);
    transform: translateY(-1px);
}

.mobile-no-events {
    color: #6c757d;
    font-size: 0.8rem;
    font-style: italic;
}

@media (min-width: 769px) {
    #mobile-day-list {
        display: none !important;
    }
    
    #calendar {
        display: block !important;
    }
}

/* ========== Loading Spinner ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding-top: 120px;
    z-index: 10000;
    pointer-events: none;
    animation: fadeIn 0.2s ease-out;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    text-align: center;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(47, 72, 88, 0.15);
    animation: fadeInScale 0.3s ease-out;
}

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(241, 183, 27, 0.2);
    border-top-color: #F1B71B;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    animation: spin 0.8s linear infinite;
}

.loading-text {
    color: #2F4858;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}


.modal-content.wide-modal .form-grid textarea {
    min-height: 140px;
}
@media (max-width: 768px) {
    /* Explicitly force full-width layout within the Search Results modal */
    #filter-modal .day-event-card {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    #filter-modal .day-event-time {
        width: 100% !important;
        min-width: 0 !important;
        margin: 0 0 0.5rem 0 !important;
        padding: 0 !important;
    }

    #filter-modal .day-event-content {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        display: block !important;
        padding-right: 2.5rem !important; /* space for remove button in favorites */
        padding-left: 0 !important;
        box-sizing: border-box !important;
    }

    #filter-modal .day-event-content .day-event-title,
    #filter-modal .day-event-content .day-event-location {
        display: block !important;
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        box-sizing: border-box !important;
        align-self: stretch !important;
    }
}
/* Force vertical layout for Search Results modal on all breakpoints */
#filter-modal .day-event-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
}

#filter-modal .day-event-content {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
}

#filter-modal .day-event-time {
    width: 100% !important;
    min-width: 0 !important;
    margin-top: 0.25rem !important;
}

@media (min-width: 769px) {
    #filter-modal .day-event-card {
        flex-direction: column !important;
    }
    #filter-modal .day-event-content,
    #filter-modal .day-event-time {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Desktop: Order elements - category, title, location, then date/time */
    #filter-modal .day-event-content {
        display: flex !important;
        flex-direction: column !important;
        order: 1 !important;
    }
    
    #filter-modal .day-event-content .day-event-category,
    #filter-modal .day-event-content .modal-category {
        order: 1 !important;
    }
    
    #filter-modal .day-event-content .day-event-title {
        order: 2 !important;
    }
    
    #filter-modal .day-event-content .day-event-location {
        order: 3 !important;
    }
    
    #filter-modal .day-event-time {
        order: 4 !important;
        margin-top: 0.5rem !important;
        margin-bottom: 0 !important;
    }
}

/* ========== Share Menu ========== */
.share-button-wrapper {
    position: relative;
    display: inline-block;
}

.share-menu {
    position: absolute;
    bottom: 100%;
    left: 0;
    margin-bottom: 0.5rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    z-index: 10000;
    display: none;
    padding: 0.5rem;
}

.share-menu.active {
    display: block;
}

.share-menu[aria-hidden="true"] {
    display: none;
}

.share-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    color: #2F4858;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    /* Removed transition for instant response */
}

.share-menu-item:hover {
    background: #f8f9fa;
}

.share-menu-item:active {
    background: #e9ecef;
}

.share-menu-item svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.share-menu-item span {
    flex: 1;
}

/* Mobile adjustments for share menu */
@media (max-width: 768px) {
    .share-menu {
        left: auto;
        right: 0;
        min-width: 200px;
    }
    
    .share-menu-item {
        padding: 0.85rem 1rem;
        font-size: 1rem;
    }
    
    /* Ensure share menu is visible on mobile */
    .share-button-wrapper {
        z-index: 10000;
        position: relative;
    }
    
    .share-menu {
        z-index: 10001;
    }
}
