/* =========================================
   FullCalendar Event Styling
   ========================================= */

/* Add a pointer cursor and smooth opacity transitions to all calendar events[cite: 2] */
.fc-event {
    cursor: pointer !important; 
    transition: opacity 0.2s ease, filter 0.2s ease !important; 
}

/* Reduce opacity on hover for better user feedback[cite: 2] */
.fc-event:hover {
    opacity: 0.75 !important;
}

/* Add right margin to time-grid events to prevent them from touching the edge[cite: 2] */
.fc-v-event, .fc-timegrid-event {
    margin-right: 10px !important; 
}

/* =========================================
   Custom Machine Dropdown Styling
   ========================================= */

/* Base styling for the custom machine color options in the dropdown[cite: 2] */
.color-option {
    margin-bottom: 8px;        
    border-radius: 6px;       
    padding: 10px 15px;        
    cursor: pointer;          
    font-weight: 500;
    transition: opacity 0.2s, transform 0.1s;
}

/* Remove bottom margin from the last color option item[cite: 2] */
.color-option:last-child {
    margin-bottom: 0;
}

/* Add hover effects (slight transparency and scale down) to color options[cite: 2] */
.color-option:hover {
    opacity: 0.85;
    transform: scale(0.98); 
}

/* =========================================
   Global Layout & Responsive Fixes
   ========================================= */

/* Prevent horizontal scrolling across the entire page[cite: 2] */
html, body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
}

/* FullCalendar Header Layout Adjustments[cite: 2] */
.fc-toolbar-chunk:first-child {
    display: flex !important;
    align-items: center !important;
    gap: 8px;
    max-width: 85%; 
}

/* Ensure the calendar title truncates with an ellipsis (...) instead of wrapping or breaking layout[cite: 2] */
.fc-toolbar-title {
    white-space: nowrap !important;       
    overflow: hidden !important;          
    text-overflow: ellipsis !important;   
    font-size: 1.1rem !important;
    margin: 0 !important;
}

/* Mobile-Specific Styles (Screens smaller than 768px)[cite: 2] */
@media (max-width: 768px) {
    /* Hide the default view selection buttons (Day/3 Days/Week) on mobile[cite: 2] */
    .fc-header-toolbar .fc-toolbar-chunk:last-child .fc-button-group {
        display: none !important;
    }

    /* Adjust the main header toolbar layout for mobile screens[cite: 2] */
    .fc-header-toolbar {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important; 
        align-items: center !important;
        margin-bottom: 12px !important;
    }

    /* Reduce padding and font size for calendar buttons on mobile to save space[cite: 2] */
    .fc .fc-button {
        padding: 0.2em 0.4em !important;
        font-size: 0.95rem !important;
    }
}

/* Desktop-Specific Styles (Screens 769px and wider)[cite: 2] */
@media (min-width: 769px) {
    /* Hide the custom mobile dropdown menu on desktop devices[cite: 2] */
    #mobileViewDropdown {
        display: none !important;
    }
}

/* Navbar Brand Styling[cite: 2] */
/* Truncate the main application title in the navbar to prevent overlap on small screens[cite: 2] */
.navbar-brand {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important; 
    
    /* Reserve space for the mobile toggle button[cite: 2] */
    max-width: calc(100% - 75px) !important; 
}

/* =========================================
   Calendar Header Cell Enhancements
   ========================================= */

/* Format the date headers (e.g., "24 Fri") to be black and remove the default link underline[cite: 2] */
.fc-col-header-cell-cushion {
    color: #212529 !important; 
    text-decoration: none !important; 
}

/* Maintain black color and no underline when hovering over the date headers[cite: 2] */
.fc-col-header-cell-cushion:hover {
    color: #000 !important; 
    text-decoration: none !important;
}