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

.buttons-group .btn {
    flex: 1;
    min-width: 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: rgb(229, 231, 235)
}

.buttons-group .btn:hover {
    background-color: rgb(248, 249, 250)
}

.alert-dismissible .btn-close {
    z-index: 0;
}

.font-semibold {
    font-weight: 600;
}

.flatpickr-wrapper input {
    z-index: 0 !important;
}

/* Loading backdrop */
.loading-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    background: white;
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#match-list-container {
    /*max-height: 90vh;*/
    overflow-y: auto;
    padding-right: 10px
}

#match-list-container::-webkit-scrollbar {
    width: 8px;
}

#match-list-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#match-list-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#match-list-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.month-delimiter {
    display: flex;
    align-items: center;
    margin: 0 3rem 0.7rem 3rem;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.month-delimiter::before,
.month-delimiter::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dee2e6;
}

.month-delimiter::before {
    margin-right: 4px;
}

.month-delimiter::after {
    margin-left: 4px;
}

.month-delimiter-text {
    white-space: nowrap;
}

.go-to-top-btn {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    background-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: white;
}

.go-to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

.go-to-top-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}


/* Month matches container styling */
.month-events-container {
    display: flex;
    flex-direction: column;
    min-height: 0; /* Allow flex item to shrink */
}

.month-matches-header {
    flex-shrink: 0;
    padding: 1rem 1.5rem 0.5rem 1.5rem;
    border-bottom: 1px solid #f1f1f1;
    margin-bottom: 0;
}

.month-events-content {
    flex: 1;
    overflow-y: auto;
    padding-left: 1rem;
    padding-right: 1rem;
    min-height: 30vh;
}


.month-event-link {
    display: flex; /* Change to flex for better layout control */
    padding: 0.5rem 0.75rem;
    padding-left: 0; /* Remove left padding since handle will provide spacing */
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.15s ease;
    overflow: hidden;
    text-overflow: ellipsis;
}

.month-event-link:hover {
    background-color: #f8f9fa;
}

.month-event-date {
    font-size: 0.8rem;
    line-height: 1.1;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.month-event-title {
    font-size: 0.9rem;
    font-weight: 390;
}

.event-color-indicator {
    display: block; /* Change to block for full height */
    width: 10px; /* Wider handle */
    min-width: 5px; /* Ensure it doesn't shrink */
    flex-shrink: 0; /* Prevent shrinking */
    margin-right: 0.75rem; /* Space between handle and content */
    align-self: stretch; /* Stretch to full height of parent */
    border-radius: 0; /* Remove border radius for cleaner look */
}

.month-event-content {
    flex: 1; /* Take up remaining space */
    min-width: 0; /* Allow content to shrink if needed */
}

/* Custom scrollbar for month events */
.month-events-content::-webkit-scrollbar {
    width: 6px;
}

.month-events-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.month-events-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.month-events-content::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.calendar-divider {
    border-bottom: 1px solid #dee2e6;
    height: 1px;
    margin-left: 1rem;
    margin-right: 1rem;
    flex-shrink: 0;
}

.calendar-container {
    position: relative;
}

#calendar-block {
    z-index: 10;
    border-radius: 0.375rem;
}

/* Desktop Styles */
@media (min-width: 992px) {
    .filter-panel-container {
        position: sticky;
        top: 20px;
        height: calc(100vh - 110px);
        margin-bottom: 0;
    }

    .filter-panel {
        border: 1px solid #dee2e6;
        border-radius: 12px;
        background: white;
        height: 100%;
        overflow-y: auto;
    }

    .filter-content {
        padding: 1.5rem;
    }

    .results-content {
        height: calc(100vh - 180px);
        display: flex;
        flex-direction: column;
        position: relative;
    }

    #match-list-container {
        flex: 1;
        max-height: none;
        overflow-y: auto;
        padding-right: 10px;
        min-height: 0;
    }

    .load-more-container {
        flex-shrink: 0;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 1rem;
        padding: 1rem 0 0.5rem 0;
    }

    .calendar-container {
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        background: white;
        padding: 0;
        position: sticky;
        top: 20px;
        height: calc(100vh - 110px);
        max-height: calc(100vh - 110px);
        overflow: hidden;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }

    .calendar-widget {
        flex: 1;
        padding: 1rem;
        overflow: hidden;
        border-radius: 12px;
    }

    .month-events-container {
        flex: 1;
        min-height: 30vh;
    }

    .mobile-tabs {
        display: none !important;
    }

    .results-section .calendar-section {
        display: block;
    }
}

/* Tablet and Mobile Styles */
@media (max-width: 991.98px) {
    .results-section.hide {
        display: none;
    }

    .results-content {
        display: flex;
        flex-direction: column;
        position: relative;
        height: calc(100vh - 200px);
        min-height: 0;
    }

    #match-list-container {
        flex: 1;
        overflow-y: auto;
        padding-right: 10px;
        min-height: 0;
    }

    .load-more-container {
        position: sticky;
        bottom: 0;
        flex-shrink: 0;
        padding: 0.3rem 0;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
        z-index: 10;
    }

    .load-more-container > * {
        pointer-events: auto;
    }

    /* Mobile tabs styling */
    .mobile-tabs .btn-group {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        border-radius: 0.375rem;
        overflow: hidden;
        width: 100%;
        display: flex;
    }

    .mobile-tabs .btn {
        border-radius: 0;
        border: none;
        font-weight: 500;
        flex: 1;
    }

    .mobile-tabs .btn-check:checked + .btn {
        background-color: #0d6efd;
        color: white;
        box-shadow: none;
    }

    /* Filter panel slide-out */
    .filter-panel-container {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        z-index: 1050;
        transition: left 0.3s ease;
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }

    .filter-panel-container.show {
        left: 0;
    }

    .filter-panel {
        height: 100%;
        overflow-y: auto;
        border: none;
    }

    .filter-content {
        padding: 1.5rem;
        padding-top: 2rem;
    }

    /* Backdrop */
    .filter-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .filter-backdrop.show {
        opacity: 1;
        visibility: visible;
    }

    /* Calendar section hidden by default on mobile */
    .calendar-section {
        display: none;
    }

    .calendar-section.show {
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
        background: white;
        padding: 0;
        margin-top: 1rem;
        margin-bottom: 1rem;
        min-height: min-content;
        max-height: none;
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    /* Make inner container fill and enable internal scroll areas */
    .calendar-container {
        display: flex;
        flex-direction: column;
        min-height: min-content;
        overflow: visible;
    }

    .calendar-widget {
        flex-shrink: 0;
        padding: 1rem;
        overflow: hidden;
        border-radius: 12px;
        min-height: 400px;
    }

    .month-events-container {
        flex-shrink: 0;
        min-height: 20vh;
        overflow: visible;
        max-width: 100%;
        display: flex;
        flex-direction: column;
    }

    .month-events-content {
        overflow-y: auto;
        max-height: 50vh;
        min-height: 20vh;
    }

}

/* Form styling */
.form-check-label small {
    font-size: 0.875rem;
}

.form-check {
    padding-left: 1.5rem;
}

/* Button group styling */
.btn-group > .btn-check:checked + .btn {
    z-index: 0 !important;
}

/* Close button for mobile filter panel */
.filter-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    border: none;
}

/* Calendar widget styling */
#calendar {
    height: 100%;
    min-height: 400px;
    max-height: calc(100vh - 200px);
}

@media (max-width: 991.98px) {
    #calendar {
        min-height: 400px;
        max-height: 70vh;
    }
}
