.gic-tee-calendar-wrapper {
    margin: 20px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    font-family: var(--gic-font-family, 'inherit');
    height: auto;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.gic-tee-calendar-wrapper *,
.gic-tee-calendar-wrapper *::before,
.gic-tee-calendar-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

.gic-tee-calendar-wrapper table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

.gic-tee-calendar-wrapper button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.gic-tee-calendar-wrapper a {
    text-decoration: none;
    color: inherit;
}

.gic-tee-calendar-wrapper ul,
.gic-tee-calendar-wrapper ol {
    list-style: none;
}

/* Calendar Event Styling */
.gic-calendar-event {
    width: 100%;
    padding: 6px 8px;
    border-radius: 4px;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.3;
    margin: 2px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.gic-event-content {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.gic-event-left {
    flex-shrink: 0;
}

.gic-event-middle {
    flex-grow: 1;
    min-width: 0; /* Allows text truncation to work */
}

.gic-event-right {
    flex-shrink: 0;
}

.gic-user-avatar,
.gic-bay-image {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    background: #fff;
    object-fit: cover; /* Maintain aspect ratio */
}

.gic-bay-image {
    border-radius: 4px;
    border-width: 1px;
}

.gic-event-time {
    font-size: 12px;
    color: #fff;
    font-weight: 500;
    text-shadow: 0 1px 1px rgba(0,0,0,0.1);
    line-height: 1.3;
    margin: 2px 0;
}

.gic-event-duration {
    font-size: 11px;
    opacity: 0.9;
    display: block;
    margin-top: 1px;
}

.gic-event-details {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.gic-event-user {
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gic-event-bay {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.8);
}

/* Adjust FullCalendar's event spacing */
.fc-daygrid-event {
    margin-top: 1px !important;
    margin-bottom: 1px !important;
}

.fc .fc-daygrid-day-events {
    margin-top: 1px !important;
    margin-bottom: 1px !important;
}

/* Make sure the "more" link is visible */
.fc-daygrid-more-link {
    font-size: 11px;
    margin: 1px 5px;
    color: #666;
}

/* FullCalendar Overrides */
.fc .fc-toolbar-title {
    font-size: 1.5em;
    font-weight: 500;
}

.fc .fc-button {
    background-color: var(--gic-primary-color, #2196f3);
    border-color: var(--gic-primary-color, #2196f3);
}

.fc .fc-button:hover {
    background-color: var(--gic-primary-hover, #1976d2);
    border-color: var(--gic-primary-hover, #1976d2);
}

.fc .fc-button-primary:not(:disabled).fc-button-active {
    background-color: var(--gic-primary-active, #1565c0);
    border-color: var(--gic-primary-active, #1565c0);
}

/* Tooltip Customization */
.tooltip-inner {
    max-width: 300px;
    padding: 8px 12px;
    background-color: rgba(0, 0, 0, 0.9);
    border-radius: 4px;
}

.tooltip.show {
    opacity: 1;
}

/* Week view mobile specific styling */
@media screen and (max-width: 1170px) {
    .fc-dayGridWeek-view .gic-event-left,
    .fc-dayGridWeek-view .gic-event-right {
        display: none;
    }

    .fc-dayGridWeek-view .gic-calendar-event {
        min-height: auto;
        height: auto;
    }

    .fc-dayGridWeek-view .gic-event-content {
        padding: 2px 4px;
    }

    .fc-dayGridWeek-view .gic-event-middle {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    .fc-dayGridWeek-view .gic-event-user,
    .fc-dayGridWeek-view .gic-event-time,
    .fc-dayGridWeek-view .gic-event-bay {
        white-space: normal;
        overflow: visible;
        font-size: 0.8em;
        line-height: 1.1;
    }

    .fc-dayGridWeek-view .gic-event-bay {
        word-break: normal;
        word-wrap: break-word;
        hyphens: auto;
    }
}

/* Maintain month view styling */
.fc-dayGridMonth-view .gic-event-left,
.fc-dayGridMonth-view .gic-event-right {
    display: flex;
}

/* Calendar header table styling */
.fc .fc-col-header {
    margin: 0 !important;
}

.fc .fc-col-header-cell-cushion {
    font-weight: 700; /* Make headers bold */
    padding: 8px 4px;
    color: #333;
}

/* Remove unwanted borders */
.fc-theme-standard td, 
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
    border: none !important;
}

/* Add subtle bottom border just for column headers */
.fc .fc-col-header-cell {
    border-bottom: 1px solid #eee !important;
}

/* Optional: Add subtle border between days if desired */
.fc-theme-standard td {
    border-right: 1px solid #f5f5f5 !important;
}

/* Remove scrollgrid borders */
.fc .fc-scrollgrid {
    border: none !important;
}

/* Button group and toolbar styling */
.gic-tee-calendar-wrapper .fc-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gic-tee-calendar-wrapper .fc-toolbar-chunk {
    display: flex;
    align-items: center;
    gap: 4px;
}

.gic-tee-calendar-wrapper .fc-button-group {
    display: flex;
    align-items: center;
}

.gic-tee-calendar-wrapper .fc-button {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    height: 35px;
    min-width: 35px;
}

.gic-tee-calendar-wrapper .fc-button .fc-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: auto;
    width: auto;
    font-size: 1.2em;
    margin: 0;
    padding: 0;
}

/* Ensure consistent button sizing */
.gic-tee-calendar-wrapper .fc-prev-button,
.gic-tee-calendar-wrapper .fc-next-button {
    padding: 0;
    width: 35px;
}

/* Maintain mobile responsiveness */
@media screen and (max-width: 768px) {
    .gic-tee-calendar-wrapper .fc-toolbar {
        flex-direction: column;
    }
}

/* Filter container and base styles */
.gic-calendar-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

/* Filter boxes */
.gic-bay-filter,
.gic-user-filter {
    flex: 1;
    min-width: 250px;
}

/* Labels */
.gic-bay-filter label,
.gic-user-filter label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 14px;
    color: #333;
}

/* Select2 base container */
.select2-container {
    width: 100% !important;
    z-index: 1;
}

/* Selection box styling */
.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
    border: 1px solid #ddd;
    border-radius: 4px;
    min-height: 38px;
    margin-bottom: 14px;
}

/* Selected items styling */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: transparent;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 4px;
    color: white;
}

/* Remove (x) button styling */
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white !important;
    opacity: 0.8;
    margin-right: 5px;
    border: none;
    background: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: none;
    opacity: 1;
    color: white !important;
}

/* Search field styling */
.select2-container--default .select2-search--inline .select2-search__field {
    margin: 0;
    padding: 0;
    padding-top: 8px;
    font-family: inherit;
}

/* Dropdown styling */
.select2-dropdown {
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--gic-primary-color, #2196f3);
}

/* Mobile responsiveness */
@media screen and (max-width: 768px) {
    .gic-calendar-filters {
        flex-direction: column;
        gap: 15px;
    }
    
    .gic-bay-filter,
    .gic-user-filter {
        width: 100%;
        min-width: 100%;
    }
}

/* Dropdown positioning */
.select2-container--default.select2-container--open .select2-dropdown--below {
    margin-top: -14px;
}

/* User filter selected items styling */
.gic-user-filter .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: var(--gic-primary-color, #2196f3);
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    margin: 4px;
}

.gic-user-filter .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white !important;
    opacity: 0.8;
    margin-right: 5px;
    border: none;
    background: none;
}

.gic-user-filter .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    background: none;
    opacity: 1;
    color: white !important;
}

/* Hide scrollbar while maintaining scroll functionality */
.fc-scroller {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;     /* Firefox */
}

.fc-scroller::-webkit-scrollbar {
    display: none;            /* Chrome, Safari and Opera */
}

/* Mobile optimizations */
@media screen and (max-width: 768px) {
    /* Adjust calendar header */
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }

    .fc .fc-toolbar-title {
        font-size: 1.2em;
    }

    /* Optimize button group layout */
    .fc .fc-button-group {
        display: flex;
        gap: 4px;
    }

    /* Make day cells more compact */
    .fc .fc-daygrid-day-frame {
        min-height: auto;
    }

    /* Adjust event content */
    .gic-calendar-event {
        padding: 4px 6px;
        font-size: 12px;
    }

    .gic-event-content {
        gap: 4px;
    }

    /* Smaller avatars on mobile */
    .gic-user-avatar,
    .gic-bay-image {
        width: 24px;
        height: 24px;
    }

    /* Optimize month view specifically */
    .fc-dayGridMonth-view .fc-daygrid-day-frame {
        padding-top: 4px !important;
    }

    /* Adjust day number size */
    .fc .fc-daygrid-day-top {
        font-size: 0.9em;
    }

    /* Make the "more" link more visible */
    .fc-daygrid-more-link {
        margin: 0;
        padding: 2px 4px;
        background: rgba(0,0,0,0.05);
        border-radius: 3px;
    }
}

@media screen and (max-width: 768px) {
    /* Hide month and week view buttons/tabs on mobile */
    .fc-dayGridMonth-button,
    .fc-timeGridWeek-button,
    .fc-dayGridMonth-view,
    .fc-timeGridWeek-view {
        display: none !important;
    }
    
    /* Ensure day view button stays visible and active */
    .fc-timeGridDay-button {
        display: inline-block !important;
    }
}

/* Set a specific height for the calendar */
#gic-tee-calendar {
    height: auto;
    min-height: 600px;
    max-height: 750px;
}

/* Adjust the day grid height */
.fc .fc-daygrid-body {
    min-height: auto !important;
}

.fc .fc-daygrid-day-frame {
    min-height: auto !important;
}

/* Mobile specific adjustments */
@media screen and (max-width: 768px) {
    #gic-tee-calendar {
        min-height: 800px;
        max-height: 1200px;
    }
}

/* Prevent page overflow */
.gic-tee-calendar-wrapper {
    margin: 20px 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    font-family: var(--gic-font-family, 'inherit');
    height: auto;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

/* Ensure filters don't overflow */
.gic-calendar-filters {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Ensure Select2 dropdowns don't cause overflow */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure all calendar elements stay within bounds */
.fc {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden;
}

.fc-view-harness,
.fc-view-harness-active,
.fc-daygrid,
.fc-daygrid-body,
.fc table,
.fc-scrollgrid,
.fc-scrollgrid-sync-table {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Mobile optimizations */
@media screen and (max-width: 768px) {
    .fc-toolbar {
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .fc-header-toolbar {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* Style the day numbers */
.fc .fc-daygrid-day-top {
    display: flex;
    justify-content: center; /* Keep numbers centered */
    padding-top: 6px;
    padding-bottom: 8px; /* Keep the spacing */
}

.fc .fc-daygrid-day-top a {
    font-weight: 700;
    font-size: 13px;
    color: #333;
    text-decoration: none;
    line-height: 1;
}

/* Style for today's date */
.fc .fc-day-today .fc-daygrid-day-top a {
    color: var(--gic-primary-color, #2196f3);
}

/* Style today's cell background */
.fc .fc-daygrid-day.fc-day-today {
    background-color: #f5f5f5 !important;
    border-radius: 8px;
}

/* Keep today's date number styling */
.fc .fc-day-today .fc-daygrid-day-top a {
    color: #333; /* Change to dark gray for better readability */
}

/* Remove box shadows */
.fc-scrollgrid-section.fc-scrollgrid-section-body {
    box-shadow: none;
}

.fc-scrollgrid-sync-inner {
    box-shadow: none;
}

.fc-scrollgrid-section.fc-scrollgrid-section-header {
    position: static;
}

.fc-scrollgrid-section.fc-scrollgrid-section-body {
    position: static;
}

.fc-scrollgrid-sync-inner {
    position: static;
}