/**
 * ServPro - Enhanced Calendar Styles
 * 
 * Comprehensive styling for the schedule calendar with modern design
 * and enhanced user experience
 * 
 * @version 1.0.0
 * @author ServPro Team
 */

/* Calendar Container Enhancements - Monochrome Theme */
#calendar {
    background: #ffffff;
    border-radius: 0.35rem;
    overflow: hidden;
    border: 1px solid #e3e6f0;
}

/* FullCalendar Customization */
.fc {
    font-family: 'Nunito', sans-serif;
}

.fc-toolbar {
    background: #f8f9fc;
    color: #5a5c69;
    padding: 1rem;
    border-radius: 0.35rem 0.35rem 0 0;
    border-bottom: 2px solid #e3e6f0;
}

.fc-toolbar-title {
    color: #5a5c69 !important;
    font-weight: 600;
    font-size: 1.25rem;
}

.fc-button {
    background: #ffffff !important;
    border: 1px solid #d1d3e2 !important;
    color: #5a5c69 !important;
    font-weight: 600;
    transition: all 0.3s ease;
}

.fc-button:hover {
    background: #e3e6f0 !important;
    border-color: #858796 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.fc-button-active {
    background: #d1d3e2 !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Event Styling - Monochrome Theme with Minimal Accents */
.fc-event {
    border-radius: 0.25rem;
    border: 1px solid #d1d3e2;
    border-left: 3px solid #858796;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 4px 8px;
    margin: 2px 0;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    background: #ffffff;
    color: #5a5c69;
}

.fc-event:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-color: #858796;
    z-index: 10;
}

/* Service Type Indicators - Subtle Grayscale with Minimal Accents */
.fc-event.installation {
    background: #f8f9fc;
    border-left: 3px solid #6c757d;
    color: #5a5c69;
}

.fc-event.cleaning {
    background: #f8f9fc;
    border-left: 3px solid #858796;
    color: #5a5c69;
}

.fc-event.repair {
    background: #f8f9fc;
    border-left: 3px solid #6c757d;
    color: #5a5c69;
}

.fc-event.check-up {
    background: #f8f9fc;
    border-left: 3px solid #858796;
    color: #5a5c69;
}

.fc-event.maintenance {
    background: #f8f9fc;
    border-left: 3px solid #6c757d;
    color: #5a5c69;
}

/* Status-based styling - Minimal Color Accents */
.fc-event.completed {
    opacity: 0.75;
    background: #f0f4f0;
    border-left: 3px solid #6c8e6c;
    color: #5a5c69;
}

.fc-event.pending {
    background: #f8f8f0;
    border-left: 3px solid #b8b896;
    color: #5a5c69;
}

.fc-event.cancelled {
    opacity: 0.5;
    background: #f5f5f5;
    border-left: 3px solid #999999;
    color: #858796;
    text-decoration: line-through;
}

/* Priority indicators - Monochrome */
.fc-event.high-priority {
    border: 2px solid #5a5c69;
    box-shadow: 0 0 8px rgba(90, 92, 105, 0.2);
}

.fc-event.urgent {
    animation: urgent-pulse 1s infinite;
}

/* Event content styling */
.fc-event-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fc-event-time {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Enhanced Month View Event Cards */
.event-content-month {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.25rem;
    font-size: 0.75rem;
    line-height: 1.3;
}

.event-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.25rem;
    font-weight: 600;
    color: #5a5c69;
}

.event-title-row .event-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-aircon-badge {
    background: #e3e6f0;
    color: #5a5c69;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    white-space: nowrap;
}

.event-time-row,
.event-location-row {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.7rem;
    color: #858796;
}

.event-time-row i,
.event-location-row i {
    font-size: 0.65rem;
    width: 12px;
    color: #6c757d;
}

.event-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.125rem;
}

.service-type-badge-small,
.status-badge-small {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.service-type-badge-small {
    background: #e3e6f0;
    color: #5a5c69;
    border: 1px solid #d1d3e2;
}

.status-badge-small.completed {
    background: #e8e8e8;
    color: #5a5c69;
    border: 1px solid #d1d3e2;
}

.status-badge-small.pending {
    background: #f0f0f0;
    color: #5a5c69;
    border: 1px solid #d1d3e2;
}

.status-badge-small.cancelled {
    background: #f5f5f5;
    color: #858796;
    border: 1px solid #d1d3e2;
}

.technician-badge-small {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 0.2rem;
    background: #f8f9fc;
    color: #5a5c69;
    border: 1px solid #e3e6f0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.technician-badge-small i {
    font-size: 0.6rem;
    color: #6c757d;
}

.event-details-compact {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.125rem;
    flex-wrap: wrap;
}

.service-type-small {
    font-size: 0.7rem;
    color: #858796;
    font-weight: 500;
}

/* Popover event enhancements */
.event-content-popover .event-technician {
    font-size: 0.75rem !important;
    color: #858796 !important;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.event-content-popover .event-technician i {
    font-size: 0.7rem !important;
    color: #6c757d !important;
}

.event-content-popover .event-aircon-count {
    font-size: 0.75rem !important;
    color: #858796 !important;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.event-content-popover .event-aircon-count i {
    font-size: 0.7rem !important;
    color: #6c757d !important;
}

/* Calendar grid styling - Monochrome */
.fc-daygrid-day {
    transition: background-color 0.2s ease;
    border-color: #e3e6f0;
}

.fc-daygrid-day:hover {
    background-color: #f8f9fc;
}

.fc-daygrid-day.fc-day-today {
    background-color: #f0f0f0;
    border: 2px solid #858796;
}

.fc-daygrid-day.fc-day-past {
    background-color: rgba(108, 117, 125, 0.05);
}

/* Week and Day view enhancements */
.fc-timegrid-slot {
    border-color: #e3e6f0;
}

.fc-timegrid-slot-label {
    background-color: #f8f9fc;
    color: #5a5c69;
    font-weight: 600;
}

.fc-timegrid-col.fc-day-today {
    background-color: #f0f0f0;
}

/* Time Grid Event Styling - Fix for white font issue */
.fc-timegrid-event {
    background-color: #ffffff !important;
    color: #5a5c69 !important;
    border: 1px solid #e3e6f0 !important;
    border-radius: 0.25rem !important;
    padding: 2px 4px !important;
    margin: 1px 0 !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

/* Force text color on all time grid event elements */
.fc-timegrid-event,
.fc-timegrid-event *,
.fc-timegrid-event .fc-event-title,
.fc-timegrid-event .fc-event-time,
.fc-timegrid-event .fc-event-main,
.fc-timegrid-event .fc-event-main-frame,
.fc-timegrid-event .fc-event-main-title,
.fc-timegrid-event .fc-event-main-time {
    color: #5a5c69 !important;
}

.fc-timegrid-event:hover {
    transform: scale(1.02) !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1) !important;
    z-index: 10 !important;
}

.fc-timegrid-event .fc-event-title {
    color: #5a5c69 !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.fc-timegrid-event .fc-event-time {
    color: #5a5c69 !important;
    font-size: 0.75rem !important;
    opacity: 0.8 !important;
}

/* Additional specific selectors for time grid events */
.fc-timegrid-event .fc-event-main-title,
.fc-timegrid-event .fc-event-main-time,
.fc-timegrid-event .fc-event-title,
.fc-timegrid-event .fc-event-time,
.fc-timegrid-event a,
.fc-timegrid-event span,
.fc-timegrid-event div {
    color: #5a5c69 !important;
}

/* Override any inherited white color */
.fc-timegrid-event[style*="color: white"],
.fc-timegrid-event[style*="color: #fff"],
.fc-timegrid-event[style*="color: #ffffff"] {
    color: #5a5c69 !important;
}

.fc-timegrid-event[style*="color: white"] *,
.fc-timegrid-event[style*="color: #fff"] *,
.fc-timegrid-event[style*="color: #ffffff"] * {
    color: #5a5c69 !important;
}

/* Ultra-specific selectors to override any conflicting styles */
#calendar .fc-timegrid-event,
#calendar .fc-timegrid-event *,
#calendar .fc-timegrid-event .fc-event-title,
#calendar .fc-timegrid-event .fc-event-time,
#calendar .fc-timegrid-event .fc-event-main,
#calendar .fc-timegrid-event .fc-event-main-frame,
#calendar .fc-timegrid-event .fc-event-main-title,
#calendar .fc-timegrid-event .fc-event-main-time {
    color: #5a5c69 !important;
}

/* Target FullCalendar's internal event structure */
.fc-timegrid-event .fc-event-main,
.fc-timegrid-event .fc-event-main-frame,
.fc-timegrid-event .fc-event-main-title,
.fc-timegrid-event .fc-event-main-time,
.fc-timegrid-event .fc-event-title,
.fc-timegrid-event .fc-event-time {
    color: #5a5c69 !important;
}

/* Override any Bootstrap or other framework styles */
.fc-timegrid-event.text-white,
.fc-timegrid-event.text-white *,
.fc-timegrid-event[class*="text-white"],
.fc-timegrid-event[class*="text-white"] * {
    color: #5a5c69 !important;
}

/* Force override for any inline styles */
.fc-timegrid-event[style*="color"] {
    color: #5a5c69 !important;
}

.fc-timegrid-event[style*="color"] * {
    color: #5a5c69 !important;
}

/* Time Grid Event Colors by Service Type - Monochrome */
.fc-timegrid-event.installation {
    background: #f8f9fc !important;
    border-left: 3px solid #6c757d !important;
    color: #5a5c69 !important;
}

.fc-timegrid-event.installation .fc-event-title,
.fc-timegrid-event.installation .fc-event-time {
    color: #5a5c69 !important;
}

.fc-timegrid-event.cleaning {
    background: #f8f9fc !important;
    border-left: 3px solid #858796 !important;
    color: #5a5c69 !important;
}

.fc-timegrid-event.cleaning .fc-event-title,
.fc-timegrid-event.cleaning .fc-event-time {
    color: #5a5c69 !important;
}

.fc-timegrid-event.repair {
    background: #f8f9fc !important;
    border-left: 3px solid #6c757d !important;
    color: #5a5c69 !important;
}

.fc-timegrid-event.repair .fc-event-title,
.fc-timegrid-event.repair .fc-event-time {
    color: #5a5c69 !important;
}

.fc-timegrid-event.check-up {
    background: #f8f9fc !important;
    border-left: 3px solid #858796 !important;
    color: #5a5c69 !important;
}

.fc-timegrid-event.check-up .fc-event-title,
.fc-timegrid-event.check-up .fc-event-time {
    color: #5a5c69 !important;
}

.fc-timegrid-event.maintenance {
    background: #f8f9fc !important;
    border-left: 3px solid #6c757d !important;
    color: #5a5c69 !important;
}

.fc-timegrid-event.maintenance .fc-event-title,
.fc-timegrid-event.maintenance .fc-event-time {
    color: #5a5c69 !important;
}

/* Time Grid Event Status Styling - Minimal Accents */
.fc-timegrid-event.completed {
    opacity: 0.75 !important;
    background: #f0f4f0 !important;
    border-left: 3px solid #6c8e6c !important;
    color: #5a5c69 !important;
}

.fc-timegrid-event.completed .fc-event-title,
.fc-timegrid-event.completed .fc-event-time {
    color: #5a5c69 !important;
}

.fc-timegrid-event.pending {
    background: #f8f8f0 !important;
    border-left: 3px solid #b8b896 !important;
    color: #5a5c69 !important;
}

.fc-timegrid-event.pending .fc-event-title,
.fc-timegrid-event.pending .fc-event-time {
    color: #5a5c69 !important;
}

.fc-timegrid-event.cancelled {
    opacity: 0.5 !important;
    background: #f5f5f5 !important;
    border-left: 3px solid #999999 !important;
    color: #858796 !important;
    text-decoration: line-through !important;
}

.fc-timegrid-event.cancelled .fc-event-title,
.fc-timegrid-event.cancelled .fc-event-time {
    color: #858796 !important;
}

/* Time Grid Column Headers */
.fc-timegrid-col-header {
    background-color: #f8f9fc !important;
    border-color: #e3e6f0 !important;
}

.fc-timegrid-col-header-cell {
    background-color: #f8f9fc !important;
    color: #5a5c69 !important;
    font-weight: 600 !important;
    border-color: #e3e6f0 !important;
}

.fc-timegrid-col-header-cell a {
    color: #5a5c69 !important;
    text-decoration: none !important;
}

.fc-timegrid-col-header-cell.fc-day-today {
    background-color: #f0f0f0 !important;
    color: #5a5c69 !important;
    font-weight: 700 !important;
}

.fc-timegrid-col-header-cell.fc-day-today a {
    color: #5a5c69 !important;
}

/* Time Grid Now Indicator - Monochrome */
.fc-timegrid-now-indicator-line {
    border-color: #5a5c69 !important;
    border-width: 2px !important;
}

.fc-timegrid-now-indicator-arrow {
    border-color: #5a5c69 !important;
    border-width: 5px !important;
}

/* Time Grid Business Hours */
.fc-timegrid-col-bg .fc-nonbusiness {
    background-color: rgba(108, 117, 125, 0.05) !important;
}

/* Time Grid Event Overlap */
.fc-timegrid-event-harness {
    margin: 1px 0 !important;
}

/* Time Grid Empty Slots */
.fc-timegrid-slot-lane {
    background-color: #ffffff !important;
}

.fc-timegrid-slot-lane.fc-slot-lun {
    background-color: rgba(108, 117, 125, 0.02) !important;
}

/* Time Grid Responsive */
@media (max-width: 768px) {
    .fc-timegrid-event {
        font-size: 0.75rem !important;
        padding: 1px 2px !important;
    }
    
    .fc-timegrid-event .fc-event-title {
        font-size: 0.7rem !important;
    }
    
    .fc-timegrid-event .fc-event-time {
        font-size: 0.65rem !important;
    }
}

/* List view enhancements */
.fc-list-event {
    border-radius: 0.25rem;
    margin: 2px 0;
    transition: all 0.2s ease;
}

.fc-list-event:hover {
    background-color: rgba(78, 115, 223, 0.1);
    transform: translateX(5px);
}

.fc-list-event-dot {
    border-width: 8px;
}

/* Filter panel styling - Monochrome */
.filter-panel {
    background: #f8f9fc;
    border-radius: 0.35rem;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #e3e6f0;
}

.filter-control {
    transition: all 0.2s ease;
    border-color: #d1d3e2;
}

.filter-control:focus {
    border-color: #858796;
    box-shadow: 0 0 0 0.2rem rgba(90, 92, 105, 0.15);
}

/* Summary cards styling */
.summary-card {
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
}

.summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 2rem 0 rgba(58, 59, 69, 0.25);
}

/* Quick actions styling */
.quick-action-btn {
    transition: all 0.3s ease;
    border-radius: 0.35rem;
    font-weight: 600;
}

.quick-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Navigation buttons - Monochrome */
.calendar-nav-btn {
    transition: all 0.2s ease;
    border-radius: 0.25rem;
    border-color: #d1d3e2;
    color: #5a5c69;
}

.calendar-nav-btn:hover {
    background-color: #e3e6f0;
    border-color: #858796;
    color: #5a5c69;
    transform: translateY(-1px);
}

/* Loading states */
.calendar-loading {
    position: relative;
    min-height: 400px;
}

.calendar-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #858796;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Conflict indicators - Monochrome */
.conflict-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #5a5c69;
    border-radius: 50%;
    border: 2px solid white;
    animation: conflict-pulse 1s infinite;
}

/* Animations */
@keyframes pulse {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes urgent-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(90, 92, 105, 0.5);
    }
    50% { 
        box-shadow: 0 0 0 10px rgba(90, 92, 105, 0);
    }
}

@keyframes conflict-pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.2);
        opacity: 0.7;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Event tooltip enhancements - Monochrome */
.fc-event-tooltip {
    background: #ffffff;
    color: #5a5c69;
    border-radius: 0.35rem;
    padding: 0;
    font-size: 0.875rem;
    max-width: 350px;
    z-index: 1000;
    border: 1px solid #d1d3e2;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.tooltip-header {
    background: #f8f9fc;
    padding: 0.75rem;
    border-bottom: 1px solid #e3e6f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.tooltip-title {
    color: #5a5c69;
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
}

.tooltip-section {
    padding: 0.75rem;
}

.tooltip-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #5a5c69;
}

.tooltip-row:last-child {
    margin-bottom: 0;
}

.tooltip-row i {
    color: #6c757d;
    font-size: 0.75rem;
    width: 14px;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.tooltip-row span {
    flex: 1;
    word-wrap: break-word;
}

.tooltip-row strong {
    color: #5a5c69;
    font-weight: 600;
    margin-right: 0.25rem;
}

/* Status badges - Monochrome with Minimal Accents */
.status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-badge.completed {
    background: #e8e8e8;
    color: #5a5c69;
    border: 1px solid #d1d3e2;
}

.status-badge.pending {
    background: #f0f0f0;
    color: #5a5c69;
    border: 1px solid #d1d3e2;
}

.status-badge.cancelled {
    background: #f5f5f5;
    color: #858796;
    border: 1px solid #d1d3e2;
}

/* Enhanced modal styling - Monochrome */
.calendar-modal .modal-content {
    border-radius: 0.5rem;
    border: 1px solid #e3e6f0;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.15);
}

.calendar-modal .modal-header {
    background: #f8f9fc;
    color: #5a5c69;
    border-radius: 0.5rem 0.5rem 0 0;
    border-bottom: 2px solid #e3e6f0;
}

.calendar-modal .modal-title {
    font-weight: 600;
    color: #5a5c69;
}

/* Export button styling - Monochrome */
.export-btn {
    background: #ffffff;
    border: 1px solid #d1d3e2;
    color: #5a5c69;
    font-weight: 600;
    transition: all 0.3s ease;
}

.export-btn:hover {
    background: #e3e6f0;
    border-color: #858796;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #5a5c69;
}

/* Today button styling - Monochrome */
.today-btn {
    background: #ffffff;
    border: 1px solid #d1d3e2;
    color: #5a5c69;
    font-weight: 600;
    transition: all 0.3s ease;
}

.today-btn:hover {
    background: #e3e6f0;
    border-color: #858796;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #5a5c69;
}

/* Refresh button styling - Monochrome */
.refresh-btn {
    background: #ffffff;
    border: 1px solid #d1d3e2;
    color: #5a5c69;
    font-weight: 600;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    background: #e3e6f0;
    border-color: #858796;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    color: #5a5c69;
}

.refresh-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

/* Date range display - Monochrome */
.date-range-display {
    background: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 0.25rem;
    padding: 0.5rem 1rem;
    font-weight: 600;
    color: #5a5c69;
}

/* Empty state styling */
.calendar-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.calendar-empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.calendar-empty-state h4 {
    margin-bottom: 0.5rem;
    color: #5a5c69;
}

.calendar-empty-state p {
    margin-bottom: 1.5rem;
    opacity: 0.7;
}

/* FullCalendar More Link Popover Styles */
.fc-daygrid-more-link {
    color: #4e73df !important;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fc-daygrid-more-link:hover {
    color: #224abe !important;
    text-decoration: underline;
}

/* Popover container for more events */
.fc-popover {
    max-width: 400px !important;
    min-width: 300px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2) !important;
    border: none !important;
    border-radius: 0.5rem !important;
    overflow: hidden !important;
    z-index: 9999 !important;
}

/* Ensure popover doesn't get cut off */
.fc-popover.fc-popover-bottom {
    margin-top: 0.5rem !important;
}

.fc-popover.fc-popover-top {
    margin-bottom: 0.5rem !important;
}

.fc-popover.fc-popover-left {
    margin-right: 0.5rem !important;
}

.fc-popover.fc-popover-right {
    margin-left: 0.5rem !important;
}

/* Responsive popover sizing */
@media (max-width: 768px) {
    .fc-popover {
        max-width: 90vw !important;
        min-width: 280px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
    
    .fc-popover-body {
        max-height: 300px !important;
    }
}

@media (max-width: 480px) {
    .fc-popover {
        max-width: 95vw !important;
        min-width: 250px !important;
    }
    
    .fc-popover-body {
        max-height: 250px !important;
    }
    
    .fc-popover-body .event-content-popover .event-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
    
    .fc-popover-body .event-content-popover .event-time {
        align-self: flex-start;
    }
}

.fc-popover-header {
    background: #f8f9fc !important;
    color: #5a5c69 !important;
    padding: 0.75rem 1rem !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #e3e6f0 !important;
    border-radius: 0.5rem 0.5rem 0 0 !important;
}

.fc-popover-header-title {
    color: #5a5c69 !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
}

.fc-popover-close {
    color: #5a5c69 !important;
    opacity: 0.7 !important;
    transition: opacity 0.2s ease !important;
}

.fc-popover-close:hover {
    opacity: 1 !important;
    color: #5a5c69 !important;
}

/* Popover body with scrollable content */
.fc-popover-body {
    padding: 0 !important;
    max-height: 400px !important;
    overflow-y: auto !important;
    background: white !important;
    border-radius: 0 0 0.5rem 0.5rem !important;
}

/* Scrollbar styling for popover */
.fc-popover-body::-webkit-scrollbar {
    width: 6px;
}

.fc-popover-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.fc-popover-body::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.fc-popover-body::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Events list in popover */
.fc-popover-body .fc-daygrid-event-harness {
    margin: 0 !important;
    border-radius: 0 !important;
}

.fc-popover-body .fc-event {
    margin: 0.25rem 0.5rem !important;
    border-radius: 0.25rem !important;
    padding: 0.5rem !important;
    font-size: 0.85rem !important;
    border: 1px solid #e3e6f0 !important;
    background: #ffffff !important;
    color: #5a5c69 !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

.fc-popover-body .fc-event:hover {
    transform: translateX(3px) !important;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1) !important;
    background: #f8f9fc !important;
}

/* Enhanced popover event content styling */
.fc-popover-body .event-content-popover {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fc-popover-body .event-content-popover .event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.25rem;
}

.fc-popover-body .event-content-popover .event-title {
    font-weight: 600 !important;
    color: #5a5c69 !important;
    font-size: 0.9rem !important;
    line-height: 1.2 !important;
    flex: 1;
    margin-right: 0.5rem;
}

.fc-popover-body .event-content-popover .event-time {
    font-size: 0.75rem !important;
    color: #858796 !important;
    font-weight: 500 !important;
    white-space: nowrap;
    background: #f8f9fc;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    border: 1px solid #e3e6f0;
}

.fc-popover-body .event-content-popover .event-details {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.fc-popover-body .event-content-popover .service-type-badge {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    padding: 0.125rem 0.375rem !important;
    border-radius: 0.25rem !important;
    background: #e3e6f0 !important;
    color: #5a5c69 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.fc-popover-body .event-content-popover .status-badge {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    padding: 0.125rem 0.375rem !important;
    border-radius: 0.25rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

.fc-popover-body .event-content-popover .status-badge.completed {
    background: #e8e8e8 !important;
    color: #5a5c69 !important;
}

.fc-popover-body .event-content-popover .status-badge.pending {
    background: #f0f0f0 !important;
    color: #5a5c69 !important;
}

.fc-popover-body .event-content-popover .status-badge.cancelled {
    background: #f5f5f5 !important;
    color: #858796 !important;
}

.fc-popover-body .event-content-popover .event-location {
    font-size: 0.75rem !important;
    color: #858796 !important;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.fc-popover-body .event-content-popover .event-location i {
    font-size: 0.7rem !important;
    color: #6c757d !important;
}

.fc-popover-body .fc-event-title {
    font-weight: 500 !important;
    margin-bottom: 0.25rem !important;
    color: #5a5c69 !important;
}

.fc-popover-body .fc-event-time {
    font-size: 0.75rem !important;
    color: #858796 !important;
    font-weight: 500 !important;
}

/* Service type styling in popover - Monochrome */
.fc-popover-body .fc-event.installation {
    border-left: 3px solid #6c757d !important;
    color: #5a5c69 !important;
}

.fc-popover-body .fc-event.cleaning {
    border-left: 3px solid #858796 !important;
    color: #5a5c69 !important;
}

.fc-popover-body .fc-event.repair {
    border-left: 3px solid #6c757d !important;
    color: #5a5c69 !important;
}

.fc-popover-body .fc-event.check-up {
    border-left: 3px solid #858796 !important;
    color: #5a5c69 !important;
}

.fc-popover-body .fc-event.maintenance {
    border-left: 3px solid #6c757d !important;
    color: #5a5c69 !important;
}

/* Status styling in popover - Monochrome */
.fc-popover-body .fc-event.completed {
    opacity: 0.75 !important;
    border-left: 3px solid #6c8e6c !important;
    color: #5a5c69 !important;
}

.fc-popover-body .fc-event.pending {
    background: #f8f8f0 !important;
    border-left: 3px solid #b8b896 !important;
    color: #5a5c69 !important;
}

.fc-popover-body .fc-event.cancelled {
    opacity: 0.5 !important;
    border-left: 3px solid #999999 !important;
    color: #858796 !important;
    text-decoration: line-through !important;
}

/* Priority indicators in popover - Monochrome */
.fc-popover-body .fc-event.high-priority {
    border: 2px solid #5a5c69 !important;
    box-shadow: 0 0 8px rgba(90, 92, 105, 0.2) !important;
}

/* Empty state for popover */
.fc-popover-body:empty::after {
    content: "No events to display";
    display: block;
    text-align: center;
    padding: 2rem;
    color: #858796;
    font-style: italic;
}

/* Calendar Event Modal Styles */
#calendarEventModal .modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

#calendarEventModal .modal-dialog {
    max-width: 1140px; /* Ensure maximum width for better layout */
}

#calendarEventModal .modal-header {
    background: #f8f9fc;
    color: #5a5c69;
    border-radius: 0.75rem 0.75rem 0 0;
    border-bottom: 2px solid #e3e6f0;
    padding: 1.5rem 2rem;
}

#calendarEventModal .modal-title {
    color: #5a5c69;
    font-weight: 600;
    font-size: 1.25rem;
}

#calendarEventModal .close {
    color: #5a5c69;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

#calendarEventModal .close:hover {
    opacity: 1;
    color: #5a5c69;
}

#calendarEventModal .modal-body {
    padding: 2rem;
}

#calendarEventModal .modal-footer {
    border-top: 1px solid #e3e6f0;
    padding: 1.5rem 2rem;
    background: #f8f9fc;
    border-radius: 0 0 0.75rem 0.75rem;
}

/* Event header styling - Monochrome */
.event-header {
    background: #f8f9fc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e3e6f0;
    border-left: 3px solid #858796;
    margin-bottom: 2rem;
}

.event-header h4 {
    color: #5a5c69;
    font-weight: 600;
    margin-bottom: 1rem;
}

.event-meta .badge {
    font-size: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    font-weight: 500;
}

.event-date, .event-time {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.event-date i, .event-time i {
    margin-right: 0.5rem;
    width: 16px;
}

/* Card styling */
#calendarEventModal .card {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

#calendarEventModal .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

#calendarEventModal .card-header {
    border-bottom: none;
    font-weight: 600;
    padding: 1.25rem 1.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
}

#calendarEventModal .card-header h6 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

#calendarEventModal .card-body {
    padding: 1.75rem;
}

/* Optimize spacing for wider modal */
#calendarEventModal .row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

#calendarEventModal .col-md-6 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

#calendarEventModal .col-12 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Label styling */
.font-weight-bold.text-muted {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #858796 !important;
    margin-bottom: 0.25rem;
}

/* Price styling */
.h5 {
    font-weight: 600;
    margin-bottom: 0;
    font-size: 1.25rem;
}

/* Action buttons */
#calendarEventModal .btn {
    border-radius: 0.375rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

#calendarEventModal .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#calendarEventModal .btn-outline-primary:hover {
    background-color: #e3e6f0;
    border-color: #858796;
    color: #5a5c69;
}

#calendarEventModal .btn-outline-success:hover {
    background-color: #e3e6f0;
    border-color: #858796;
    color: #5a5c69;
}

#calendarEventModal .btn-outline-warning:hover {
    background-color: #e3e6f0;
    border-color: #858796;
    color: #5a5c69;
}

#calendarEventModal .btn-outline-info:hover {
    background-color: #e3e6f0;
    border-color: #858796;
    color: #5a5c69;
}

#calendarEventModal .btn-outline-secondary:hover {
    background-color: #e3e6f0;
    border-color: #858796;
    color: #5a5c69;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    #calendarEventModal .modal-dialog {
        max-width: 95%;
        margin: 1rem auto;
    }
}

@media (max-width: 768px) {
    #calendarEventModal .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    #calendarEventModal .modal-body {
        padding: 1rem;
    }
    
    #calendarEventModal .modal-header,
    #calendarEventModal .modal-footer {
        padding: 1rem;
    }
    
    .event-header {
        padding: 1rem;
    }
    
    .event-header .row {
        flex-direction: column;
    }
    
    .event-header .col-md-4 {
        text-align: left !important;
        margin-top: 1rem;
    }
    
    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    .d-flex.justify-content-between > div {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    #calendarEventModal .btn {
        flex: 1;
        min-width: 120px;
    }
    
    #calendarEventModal .card-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    #calendarEventModal .modal-body {
        padding: 0.75rem;
    }
    
    #calendarEventModal .modal-header,
    #calendarEventModal .modal-footer {
        padding: 0.75rem;
    }
    
    .event-header {
        padding: 0.75rem;
    }
    
    #calendarEventModal .card-body {
        padding: 0.75rem;
    }
    
    .h5 {
        font-size: 1rem;
    }
    
    #paymentStatus {
        font-size: 1.25rem;
    }
    
    #paymentStatus i {
        font-size: 1.25rem;
    }
}

/* Payment Status Styling */
#paymentStatus {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0;
    font-size: 1.5rem;
}

#paymentStatus.text-success {
    color: #28a745 !important;
}

#paymentStatus.text-warning {
    color: #ffc107 !important;
}

#paymentStatus.text-danger {
    color: #dc3545 !important;
}

#paymentStatus i {
    font-size: 1.5rem;
}

#paymentDetails {
    font-size: 0.9rem;
    font-style: italic;
    margin-top: 0.5rem;
    color: #6c757d;
}

/* Payment status icons */
#paymentStatus .fa-check-circle {
    color: #28a745;
}

#paymentStatus .fa-clock {
    color: #ffc107;
}

#paymentStatus .fa-times-circle {
    color: #dc3545;
}

/* Responsive design - Mobile Optimizations for Field Technicians */
@media (max-width: 768px) {
    .fc-toolbar {
        flex-direction: column;
        gap: 1rem;
        padding: 0.75rem;
    }
    
    .fc-toolbar-chunk {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .filter-panel .d-flex {
        flex-direction: column;
    }
    
    .filter-panel .d-flex > div {
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .quick-actions .row {
        margin: 0;
    }
    
    .quick-actions .col-md-3 {
        padding: 0.25rem;
    }
    
    /* Enhanced Month View Event Cards - Mobile */
    .event-content-month {
        font-size: 0.7rem;
        padding: 0.2rem;
        gap: 0.2rem;
    }
    
    .event-title-row {
        font-size: 0.7rem;
    }
    
    .event-time-row,
    .event-location-row {
        font-size: 0.65rem;
    }
    
    .event-meta-row {
        gap: 0.2rem;
    }
    
    .service-type-badge-small,
    .status-badge-small,
    .technician-badge-small {
        font-size: 0.6rem;
        padding: 0.1rem 0.3rem;
    }
    
    /* Event cards - ensure readability on small screens */
    .fc-event {
        font-size: 0.75rem;
        padding: 3px 5px;
        min-height: 60px;
    }
    
    /* Calendar grid - better spacing on mobile */
    .fc-daygrid-day {
        min-height: 80px;
    }
    
    /* Popover - full width on mobile */
    .fc-popover {
        max-width: 95vw !important;
        min-width: 280px !important;
    }
    
    /* Tooltip - adjust for mobile */
    .fc-event-tooltip {
        max-width: 90vw;
        font-size: 0.8rem;
    }
    
    .tooltip-header {
        padding: 0.5rem;
    }
    
    .tooltip-section {
        padding: 0.5rem;
    }
    
    .tooltip-row {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }
}

/* Extra Small Devices - Phones */
@media (max-width: 480px) {
    /* Even more compact for small phones */
    .event-content-month {
        font-size: 0.65rem;
        padding: 0.15rem;
    }
    
    .event-title-row .event-title {
        font-size: 0.65rem;
    }
    
    .event-time-row,
    .event-location-row {
        font-size: 0.6rem;
    }
    
    .fc-event {
        font-size: 0.7rem;
        padding: 2px 4px;
        min-height: 50px;
    }
    
    .fc-daygrid-day {
        min-height: 70px;
    }
    
    /* Navigation buttons - larger touch targets */
    .calendar-nav-btn {
        padding: 0.5rem 0.75rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    .refresh-btn {
        padding: 0.5rem 0.75rem;
        min-width: 44px;
        min-height: 44px;
    }
    
    /* Modal adjustments for small screens */
    #calendarEventModal .modal-dialog {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
    }
    
    #calendarEventModal .modal-body {
        padding: 1rem 0.75rem;
    }
    
    .event-header {
        padding: 1rem;
    }
    
    .card-body {
        padding: 1rem 0.75rem;
    }
    
    /* Ensure text is readable */
    .text-dark {
        font-size: 0.9rem;
    }
    
    .font-weight-bold.text-muted {
        font-size: 0.75rem;
    }
}

/* Tablet Optimizations */
@media (min-width: 481px) and (max-width: 768px) {
    .event-content-month {
        font-size: 0.72rem;
    }
    
    .fc-event {
        font-size: 0.8rem;
        min-height: 65px;
    }
    
    .fc-daygrid-day {
        min-height: 85px;
    }
}

/* Touch-friendly improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .fc-event {
        min-height: 50px;
        padding: 4px 6px;
    }
    
    .fc-button {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
    
    /* Remove hover effects on touch devices */
    .fc-event:hover {
        transform: none;
    }
    
    /* Better spacing for touch */
    .event-meta-row {
        gap: 0.3rem;
    }
}

/* Override FullCalendar's default event styling */
.fc-event,
.fc-event-main,
.fc-event-main-frame,
.fc-event-main-title,
.fc-event-main-time {
    color: inherit !important;
}

/* Specific override for time grid events */
.fc-timegrid-event,
.fc-timegrid-event .fc-event-main,
.fc-timegrid-event .fc-event-main-frame,
.fc-timegrid-event .fc-event-main-title,
.fc-timegrid-event .fc-event-main-time {
    color: #5a5c69 !important;
}

/* Override any FullCalendar default colors */
.fc-event-main-title,
.fc-event-main-time {
    color: inherit !important;
}

/* Ensure proper contrast for all calendar events */
.fc-event {
    color: #5a5c69 !important;
}

.fc-event * {
    color: inherit !important;
}

/* Override any white text that might be set by FullCalendar */
.fc-event[style*="color: white"],
.fc-event[style*="color: #fff"],
.fc-event[style*="color: #ffffff"],
.fc-timegrid-event[style*="color: white"],
.fc-timegrid-event[style*="color: #fff"],
.fc-timegrid-event[style*="color: #ffffff"] {
    color: #5a5c69 !important;
}

.fc-event[style*="color: white"] *,
.fc-event[style*="color: #fff"] *,
.fc-event[style*="color: #ffffff"] *,
.fc-timegrid-event[style*="color: white"] *,
.fc-timegrid-event[style*="color: #fff"] *,
.fc-timegrid-event[style*="color: #ffffff"] * {
    color: #5a5c69 !important;
} 