/* Calendar Styling */
.fc-event-rsvp {
    font-size: 0.75rem;
    margin-top: 2px;
}

.fc-toolbar-title {
    font-size: 1.25rem !important;
    font-weight: bold;
}

.fc-button-primary {
    background-color: #54A300 !important;
    border-color: #54A300 !important;
}

.fc-button-primary:hover {
    background-color: #448200 !important;
    border-color: #448200 !important;
}

.calendar-container {
    display: flex;
    gap: 1.5rem;
}

.calendar-sidebar {
    width: 250px;
    flex-shrink: 0;
}

.calendar-main {
    flex: 1;
    min-width: 0;
}

.filter-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.filter-section h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: #333;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
}

.filter-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.75rem;
    cursor: pointer;
}

.filter-checkbox label {
    cursor: pointer;
    margin: 0;
    font-size: 0.95rem;
}

.fc {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fc-toolbar-title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: #333;
}

.fc-toolbar {
    gap: 1rem;
    margin-bottom: 1.5rem !important;
}

.fc-toolbar-chunk {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fc-button {
    background-color: #54A300 !important;
    border-color: #54A300 !important;
    text-transform: capitalize !important;
}

.fc-button:hover {
    background-color: #468a00 !important;
    border-color: #468a00 !important;
}

.fc-button-active {
    background-color: #468a00 !important;
}

/* Event styling */
.fc-event {
    cursor: pointer;
    border: none !important;
    padding: 4px 6px;
    margin-bottom: 2px;
    overflow: hidden;
}

.fc-event-main {
    overflow: hidden;
}

.fc-event-title {
    font-weight: 600;
    font-size: 0.85rem;
    gap: 4px;
    font-size: 0.7rem;
    opacity: 0.9;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event-team-badge {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.event-avatars-row {
    display: flex;
    gap: 2px;
    margin-top: 4px;
    flex-wrap: nowrap;
    overflow: hidden;
}

.event-player-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid;
    flex-shrink: 0;
}

.event-player-avatar.rsvp-yes {
    border-color: #28a745;
}

.event-player-avatar.rsvp-no {
    border-color: #dc3545;
}

.event-player-avatar.rsvp-maybe {
    border-color: #ffc107;
}

.event-player-avatar.rsvp-none {
    border-color: #6c757d;
    opacity: 0.6;
}

/* List view styling */
.fc-list-event {
    cursor: pointer !important;
}

.fc-list-event:hover {
    background-color: #f8f9fa !important;
}

.fc-list-event-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 0;
}

.list-event-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.list-event-team {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #666;
}

.list-event-avatars {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.event-location {
    font-size: 0.7rem;
    color: #666;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Custom Tooltip */
.fc-event-tooltip {
    position: absolute;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    min-width: 200px;
    max-width: 300px;
    pointer-events: none;
}

.tooltip-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #333;
}

.tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #666;
}

.tooltip-row i {
    width: 14px;
    color: #54A300;
}

.tooltip-avatars {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.select2-container {
    width: 100% !important;
}

.select2-container--default .select2-selection--multiple {
    border-radius: 6px;
    border-color: #dee2e6;
}

/* Mini Calendar Datepicker */
.mini-calendar {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.mini-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mini-calendar-header h6 {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.mini-calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.mini-calendar-nav button {
    background: none;
    border: none;
    color: #54A300;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mini-calendar-nav button:hover {
    background-color: #f0f0f0;
}

.mini-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.mini-calendar-day-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    padding: 4px 0;
}

.mini-calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.mini-calendar-day:hover {
    background-color: #f0f0f0;
}

.mini-calendar-day.other-month {
    color: #ccc;
}

.mini-calendar-day.today {
    background-color: #54A300;
    color: white;
    font-weight: 700;
}

.mini-calendar-day.selected {
    background-color: #468a00;
    color: white;
    font-weight: 600;
}

.mini-calendar-day.in-period {
    background-color: #f0f0f0;
}

.mini-calendar-day.in-period.today {
    background-color: #54A300;
    color: white;
}

.mini-calendar-day.in-period.selected {
    background-color: #468a00;
    color: white;
}

.mini-calendar-day.has-events::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background-color: #54A300;
}

.mini-calendar-day.today.has-events::after,
.mini-calendar-day.selected.has-events::after {
    background-color: white;
}

/* Mobile responsive */
@media (max-width: 992px) {
    .calendar-container {
        flex-direction: column;
    }

    .calendar-sidebar {
        width: 100%;
        display: none;
        /* Hidden by default on mobile, shown in offcanvas */
    }

    /* Hide month and week view buttons on mobile */
    .fc-dayGridMonth-button,
    .fc-timeGridWeek-button {
        display: none !important;
    }

    .fc-toolbar-title {
        font-size: 1.25rem !important;
    }

    .fc-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Filter toggle button for mobile */
.filter-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #54A300;
    border: none;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.filter-toggle-btn:hover {
    background-color: #468a00;
    transform: scale(1.1);
}

@media (max-width: 992px) {
    .filter-toggle-btn {
        display: flex;
    }
}

/* Select2 Custom Styles for Bootstrap 5 Theme */
.select2-container--default .select2-selection--multiple {
    background-color: #fff;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    cursor: text;
    padding-bottom: 5px;
    padding-right: 5px;
    min-height: 38px;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

/* Grundee Green Focus */
.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #54A300;
    box-shadow: 0 0 0 0.25rem rgba(84, 163, 0, 0.25);
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #54A300;
    border: 1px solid #4a9000;
    border-radius: 4px;
    color: #fff;
    font-size: 0.875rem;
    margin-top: 5px;
    margin-left: 5px;
    padding: 2px 8px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: #fff;
    border-right: 1px solid #4a9000;
    margin-right: 5px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background-color: #4a9000;
    color: #fff;
}

.select2-dropdown {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.select2-results__option--highlighted[aria-selected] {
    background-color: #54A300;
    color: white;
}

/* Ensure full width */
.select2-container {
    width: 100% !important;
    display: block;
}

/* Calendar Sync Modal Styles */
#calendarSyncModal .modal-content {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

#calendarSyncModal .modal-header {
    background: linear-gradient(135deg, #54A300 0%, #468a00 100%);
    color: white;
    border-radius: 16px 16px 0 0;
    padding: 1.5rem;
}

#calendarSyncModal .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

#calendarSyncModal .modal-title {
    font-weight: 700;
    font-size: 1.25rem;
}

#calendarSyncModal .alert-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    border-radius: 8px;
}

#calendarSyncModal .form-label {
    color: #333;
    font-size: 0.95rem;
}

#calendarSyncModal #calendarFeedUrl {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

#calendarSyncModal #copyFeedUrlBtn {
    background-color: #54A300;
    border-color: #54A300;
    transition: all 0.3s ease;
}

#calendarSyncModal #copyFeedUrlBtn:hover {
    background-color: #468a00;
    border-color: #468a00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(84, 163, 0, 0.3);
}

#calendarSyncModal #copyFeedUrlBtn.btn-success {
    animation: successPulse 0.5s ease;
}

@keyframes successPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

#calendarSyncModal .nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

#calendarSyncModal .nav-tabs .nav-link {
    color: #666;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 0.75rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

#calendarSyncModal .nav-tabs .nav-link:hover {
    color: #54A300;
    border-bottom-color: #54A30050;
}

#calendarSyncModal .nav-tabs .nav-link.active {
    color: #54A300;
    border-bottom-color: #54A300;
    background-color: transparent;
}

#calendarSyncModal .sync-instructions {
    padding-left: 1.5rem;
    line-height: 1.8;
}

#calendarSyncModal .sync-instructions li {
    margin-bottom: 0.5rem;
    color: #555;
}

#calendarSyncModal .sync-instructions strong {
    color: #333;
    font-weight: 600;
}

#calendarSyncModal .alert-info {
    background-color: #e7f3ff;
    border-color: #b3d9ff;
    color: #004085;
    border-radius: 8px;
}

#calendarSyncModal #regenerateUrlBtn {
    transition: all 0.3s ease;
}

#calendarSyncModal #regenerateUrlBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

/* Responsive adjustments for sync button */
@media (max-width: 768px) {
    .row.mb-4 .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem;
    }

    .row.mb-4 .btn {
        width: 100%;
    }

    #calendarSyncModal .modal-dialog {
        margin: 0.5rem;
    }

    #calendarSyncModal .nav-tabs .nav-link {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Weekend Styling */
.fc-weekend-day {
    background-color: #f8f9fa !important;
}

/* Weekend styling for day grid cells */
.fc-day-sat,
.fc-day-sun {
    background-color: #f8f9fa;
}

/* Ensure weekend styling works in different views */
.fc-daygrid-day.fc-day-sat,
.fc-daygrid-day.fc-day-sun,
.fc-timegrid-col.fc-day-sat,
.fc-timegrid-col.fc-day-sun {
    background-color: #f8f9fa;
}