/**
 * Custom CSS overrides for Printable Calendar Plugin
 * 
 * This file contains custom CSS to override specific behaviors while
 * preserving the original plugin files.
 */

/* Match all buttons exactly like navigation buttons with more specific selectors */
.printable-calendar-container .printable-calendar-button.printable-calendar-print,
.printable-calendar-container .printable-calendar-button.download-monthly-calendar,
.printable-calendar-container .printable-calendar-button.printable-calendar-download,
.printable-calendar-container .printable-calendar-button.printable-calendar-share,
.printable-calendar-container .printable-calendar-button.printable-calendar-settings,
.printable-calendar-container .printable-calendar-add-holidays,
.printable-calendar-container .printable-calendar-remove-holidays,
.printable-calendar-container .printable-calendar-month-select,
.printable-calendar-container .printable-calendar-year-select {
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 15px !important;
    border-radius: 4px !important;
    border: 1px solid #ddd !important;
    background-color: #f5f5f5 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    color: #333 !important;
    vertical-align: middle !important;
    text-transform: capitalize !important;
    transition: none !important;
    margin: 0 !important;
    font-weight: normal !important;
    box-shadow: none !important;
}

/* Additional styles for dropdowns to maintain functionality */
.printable-calendar-container .printable-calendar-month-select,
.printable-calendar-container .printable-calendar-year-select {
    padding-right: 30px !important; /* Extra space for dropdown arrow */
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="6"><path d="M0,0 L12,0 L6,6 Z" fill="%23333"/></svg>') !important;
    background-position: calc(100% - 10px) center !important;
    background-repeat: no-repeat !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    text-align: left !important;
}

.printable-calendar-container .printable-calendar-button.printable-calendar-print:hover,
.printable-calendar-container .printable-calendar-button.download-monthly-calendar:hover,
.printable-calendar-container .printable-calendar-button.printable-calendar-download:hover,
.printable-calendar-container .printable-calendar-button.printable-calendar-share:hover,
.printable-calendar-container .printable-calendar-button.printable-calendar-settings:hover,
.printable-calendar-container .printable-calendar-add-holidays:hover,
.printable-calendar-container .printable-calendar-remove-holidays:hover,
.printable-calendar-container .printable-calendar-month-select:hover,
.printable-calendar-container .printable-calendar-year-select:hover {
    background-color: #e9e9e9 !important;
    color: #000 !important;
    border-color: #ccc !important;
}

/* Remove grey background from weekend cells but keep it for empty cells */
.printable-calendar-weekend {
    background-color: transparent !important;
}

/* Keep the background for empty cells */
.printable-calendar-empty {
    background-color: #f9f9f9 !important;
}

/* Consistent height and styling for ALL interactive elements */
.printable-calendar-button.printable-calendar-print,
.printable-calendar-button.download-monthly-calendar,
.printable-calendar-button.printable-calendar-download,
.printable-calendar-button.printable-calendar-share,
.printable-calendar-button.printable-calendar-settings,
.printable-calendar-add-holidays,
.printable-calendar-remove-holidays,
.printable-calendar-selectors select,
.printable-calendar-month-select,
.printable-calendar-year-select {
    height: 38px !important;
    box-sizing: border-box !important;
    border-radius: 4px !important;
    border: 1px solid #ddd !important;
    background-color: #f5f5f5 !important;
    font-size: 14px !important;
    color: #333 !important;
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    line-height: 1 !important; /* Ensure consistent line height */
}

/* Fix dropdown select overlapping issue */
.printable-calendar-month-select,
.printable-calendar-year-select {
    padding: 0 30px 0 10px !important; /* Add extra padding for the dropdown arrow */
    text-overflow: ellipsis !important;
    position: relative !important;
    background-position: calc(100% - 8px) center !important;
    background-repeat: no-repeat !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    height: 38px !important; /* Ensure exact same height */
    margin: 0 !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
}

/* Custom styles for action buttons (print, download, share, settings) */
.printable-calendar-button.printable-calendar-print,
.printable-calendar-button.download-monthly-calendar,
.printable-calendar-button.printable-calendar-download,
.printable-calendar-button.printable-calendar-share,
.printable-calendar-button.printable-calendar-settings {
    font-weight: 500 !important;
    padding: 0 12px !important;
    margin: 0 !important;
    justify-content: center !important;
}

.printable-calendar-button.printable-calendar-print:hover,
.printable-calendar-button.download-monthly-calendar:hover,
.printable-calendar-button.printable-calendar-download:hover,
.printable-calendar-button.printable-calendar-share:hover,
.printable-calendar-button.printable-calendar-settings:hover {
    background-color: #e9e9e9 !important;
    color: #000 !important;
    border-color: #ccc !important;
}

/* Fix icon alignment in buttons */
.printable-calendar-button [class^="ti-"] {
    margin-right: 6px !important;
    font-size: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure share dropdown is properly positioned and styled */
.printable-calendar-share-dropdown {
    position: relative !important;
    display: inline-block !important;
}

.printable-calendar-share-content {
    right: 0 !important;
    top: 100% !important;
    margin-top: 5px !important;
    z-index: 100 !important;
    min-width: 180px !important;
}

/* Fix navigation layout structure */
.printable-calendar-navigation {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-direction: row !important; /* Use row for proper layout */
    position: relative !important;
    padding-top: 0 !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    min-height: 38px !important;
    margin-bottom: 15px !important;
    height: 38px !important; /* Fixed height to ensure proper alignment */
    box-sizing: border-box !important; /* To ensure padding doesn't affect height */
}

/* Position nav-links and make container non-blocking */
.printable-calendar-nav-links {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    pointer-events: none !important; /* This makes the container non-blocking */
    z-index: 5 !important;
    max-width: none !important;
    height: 38px !important; /* Fixed height to match navigation */
}

/* Navigation button styling - ensure they're clickable */
.printable-calendar-navigation a {
    height: 38px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 15px !important;
    border-radius: 4px !important;
    border: 1px solid #ddd !important;
    background-color: #f5f5f5 !important;
    text-decoration: none !important;
    font-size: 14px !important;
    color: #333 !important;
    vertical-align: middle !important;
    pointer-events: auto !important; /* Make buttons clickable */
    position: relative !important;
    z-index: 20 !important; /* Increased z-index to ensure clickability */
    box-sizing: border-box !important; /* To ensure padding doesn't affect height */
}

.printable-calendar-navigation a .ti-arrow-left,
.printable-calendar-navigation a .ti-arrow-right {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    vertical-align: middle !important;
}

.printable-calendar-navigation a .nav-text {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
}

.printable-calendar-navigation a:hover {
    background-color: #e9e9e9 !important;
    color: #000 !important;
    border-color: #ccc !important;
}

/* Properly position navigation buttons */
.printable-calendar-prev {
    margin-right: auto !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 20 !important; /* Increased z-index */
    pointer-events: auto !important; /* Explicitly make clickable */
    min-width: 90px !important; /* Ensure space for text */
    text-align: left !important;
}

.printable-calendar-next {
    margin-left: auto !important;
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    z-index: 20 !important; /* Increased z-index */
    pointer-events: auto !important; /* Explicitly make clickable */
    min-width: 90px !important; /* Ensure space for text */
    text-align: right !important;
}

/* Previous button icon alignment */
.printable-calendar-prev .ti-arrow-left {
    margin-right: 6px !important;
}

/* Next button icon alignment */
.printable-calendar-next .ti-arrow-right {
    margin-left: 6px !important;
}

/* Center month-year text */
.printable-calendar-month-year {
    margin: 0 auto !important;
    text-align: center !important;
    position: relative !important;
    z-index: 2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 38px !important;
    padding: 0 60px !important; /* Make space for navigation buttons */
    pointer-events: auto !important;
}

/* Styling for the new month-year-text span wrapper */
.printable-calendar-month-year .month-year-text {
    text-align: center !important;
    margin: 0 auto !important;
    display: inline-block !important;
    position: relative !important;
    z-index: 10 !important;
    font-size: inherit !important;
    line-height: inherit !important;
    white-space: nowrap !important;
}

/* Make sure the year link is properly styled and clickable */
.printable-calendar-year-link {
    display: inline !important;
    color: inherit !important;
    text-decoration: none !important;
    border-bottom: 1px dotted #666 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 3 !important;
}

.printable-calendar-year-link:hover {
    color: #4d90fe !important;
    border-bottom-color: #4d90fe !important;
}

/* Mobile specific adjustments */
@media (max-width: 768px) {
    /* Ensure proper centering of month-year text */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
        font-size: 18px !important;
        padding: 0 45px !important; /* Increased padding for better centering */
        width: 100% !important;
        text-align: center !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        position: relative !important;
        margin: 0 auto !important;
        z-index: 5 !important;
        transform: none !important;
        left: auto !important;
        pointer-events: auto !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .month-year-text {
        text-align: center !important;
        margin: 0 auto !important;
        display: inline-block !important;
    }
    
    /* Hide nav text on mobile, show only icons */
    .printable-calendar-navigation a .nav-text {
        display: none !important;
    }
    
    /* Make nav buttons square */
    .printable-calendar-navigation a {
        padding: 0 !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Remove margins when text is hidden */
    .printable-calendar-prev .ti-arrow-left,
    .printable-calendar-next .ti-arrow-right {
        margin: 0 !important;
    }
    
    /* Ensure prev/next don't have min-width in mobile */
    .printable-calendar-prev,
    .printable-calendar-next {
        min-width: 38px !important;
    }
    
    /* High-specificity rule to ensure buttons are square in mobile */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev,
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next {
        width: 38px !important;
        min-width: 38px !important;
        padding: 0 !important;
    }
    
    /* High-specificity rule to hide nav text in mobile */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev .nav-text,
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next .nav-text {
        display: none !important;
    }
    
    /* Remove icon margins in mobile */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev .ti-arrow-left,
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next .ti-arrow-right {
        margin: 0 !important;
    }
}

/* Extra small screen overrides */
@media (max-width: 480px) {
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
        position: relative !important;
        z-index: 5 !important;
        transform: none !important;
        left: auto !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .month-year-text {
        text-align: center !important;
        display: inline-block !important;
        margin: 0 auto !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format {
        display: inline !important;
        text-align: center !important;
        font-weight: normal !important;
        border-bottom: 1px dotted #666 !important;
        color: inherit !important;
        text-decoration: none !important;
        pointer-events: auto !important;
        font-size: 16px !important;
    }
    
    /* Ensure nav buttons are clickable on mobile */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev,
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next {
        pointer-events: auto !important;
        z-index: 30 !important;
        position: absolute !important;
        width: 38px !important;
        height: 38px !important;
    }
    
    /* Ensure month-year-text styling */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .month-year-text {
        text-align: center !important;
        display: inline-block !important;
        margin: 0 auto !important;
    }
}

/* Ensure text and icons are properly aligned in all buttons */
.printable-calendar-button span,
.printable-calendar-add-holidays span,
.printable-calendar-remove-holidays span {
    display: inline-flex !important;
    align-items: center !important;
}

/* Improve dropdown styling for better consistency */
.printable-calendar-selectors {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* Make sure all UI controls are vertical-aligned with each other */
.printable-calendar-navigation,
.printable-calendar-selectors,
.printable-calendar-actions {
    display: flex !important;
    align-items: center !important;
    min-height: 38px !important;
}

/* Reposition UI elements - move selectors to the left of action buttons */
.printable-calendar-container {
    display: flex !important;
    flex-direction: column !important;
}

.printable-calendar-controls {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 5px !important;
}

.printable-calendar-selectors {
    order: 1 !important;
    margin-right: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    height: 38px !important;
}

.printable-calendar-actions {
    order: 2 !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    height: 38px !important;
}

/* Make nav text consistent with button text */
.printable-calendar-navigation a .nav-text {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    /* Make month/year text responsive */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
        font-size: 18px !important;
        white-space: nowrap !important;
        width: 100% !important; /* Full width to enable centering */
        text-align: center !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        position: relative !important;
        z-index: 2 !important;
        height: 38px !important; /* Match height of nav buttons */
        line-height: 38px !important; /* Center text vertically */
        margin: 0 auto !important;
        order: 2 !important;
        flex: 1 !important;
        transform: none !important;
        left: auto !important;
    }
    
    /* Restructure the navigation for mobile */
    .printable-calendar-navigation {
        padding-top: 0 !important;
        position: relative !important;
        margin-bottom: 15px !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        display: flex !important;
    }

    /* Ensure prev button is on left and next is on right */
    .printable-calendar-prev {
        order: 1 !important;
        flex: 0 0 auto !important;
        margin-right: 0 !important;
    }

    .printable-calendar-next {
        order: 3 !important; 
        flex: 0 0 auto !important;
        margin-left: 0 !important;
    }
    
    /* Create proper space for centered month/year text */
    .printable-calendar-navigation {
        padding-top: 0 !important;
        position: relative !important;
        margin-bottom: 15px !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
    }
    
    /* Make sure navigation links are positioned correctly */
    .printable-calendar-nav-links {
        width: auto !important;
        justify-content: space-between !important;
        margin-bottom: 0 !important;
        display: flex !important;
        flex: 0 0 auto !important;
    }
    
    /* Ensure button texts are hidden and only icons show in mobile */
    .printable-calendar-button span.button-text {
        display: none !important;
    }

    /* Action button icon alignment */
    .printable-calendar-actions .printable-calendar-button [class^="ti-"],
    .printable-calendar-actions .printable-calendar-add-holidays [class^="ti-"],
    .printable-calendar-actions .printable-calendar-remove-holidays [class^="ti-"] {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
    }
    
    /* Force buttons to be square with consistent dimensions */
    .printable-calendar-actions .printable-calendar-button,
    .printable-calendar-actions .printable-calendar-add-holidays,
    .printable-calendar-actions .printable-calendar-remove-holidays {
        position: relative !important;
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        overflow: hidden !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Hide nav text on mobile, show only icons */
    .printable-calendar-navigation a .nav-text {
        display: none !important;
    }
    
    /* Remove margins when text is hidden */
    .printable-calendar-prev .ti-arrow-left,
    .printable-calendar-next .ti-arrow-right {
        margin: 0 !important;
    }
    
    /* Make sure the month/year text doesn't wrap to next line */
    .printable-calendar-navigation {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
    }
    
    /* Make nav buttons square when only showing icons */
    .printable-calendar-navigation a {
        padding: 0 !important;
        width: 38px !important;
        min-width: 38px !important;
        height: 38px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 auto !important;
    }
    
    /* Hide button text, show only icons on mobile and tablet */
    .printable-calendar-button.printable-calendar-print span.button-text,
    .printable-calendar-button.download-monthly-calendar span.button-text,
    .printable-calendar-button.printable-calendar-download span.button-text,
    .printable-calendar-button.printable-calendar-share span.button-text,
    .printable-calendar-button.printable-calendar-settings span.button-text,
    .printable-calendar-add-holidays span.button-text,
    .printable-calendar-remove-holidays span.button-text {
        display: none !important;
        width: 0 !important;
        overflow: hidden !important;
        opacity: 0 !important;
        visibility: hidden !important;
        max-width: 0 !important;
    }
    
    /* Adjust padding for icon-only buttons */
    .printable-calendar-button.printable-calendar-print,
    .printable-calendar-button.download-monthly-calendar,
    .printable-calendar-button.printable-calendar-download,
    .printable-calendar-button.printable-calendar-share,
    .printable-calendar-button.printable-calendar-settings,
    .printable-calendar-add-holidays,
    .printable-calendar-remove-holidays {
        padding: 0 !important;
        min-width: 38px !important;
        justify-content: center !important;
        max-width: 38px !important; /* Force buttons to be square */
        width: 38px !important; /* Force buttons to be square */
        height: 38px !important;
        overflow: hidden !important;
        display: inline-flex !important;
        align-items: center !important;
    }
    
    /* Adjust spacing in the controls area */
    .printable-calendar-controls {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    
    .printable-calendar-selectors,
    .printable-calendar-actions {
        margin: 5px 0 !important;
        width: 100% !important;
    }
    
    .printable-calendar-selectors {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
    
    .printable-calendar-actions {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 5px !important;
    }
    
    /* Increase height of editable area in mobile view */
    .printable-calendar-editable-area {
        min-height: 70px !important;
        height: 70px !important;
        overflow: visible !important; /* Show all content without scrollbars */
    }
    
    .printable-calendar-editable-area:focus {
        overflow: visible !important; /* Keep content visible when editing on mobile */
    }
    
    .printable-calendar-table td {
        height: 100px !important;
    }
    
    /* Mobile-specific adjustments for editable area */
    .printable-calendar-editable-area {
        padding: 1px !important;
        border-radius: 5px !important; /* More rounded corners on mobile */
    }
    
    .printable-calendar-editable-area:focus {
        border-radius: 5px !important; /* Keep more rounded corners when focused on mobile */
    }
    
    /* Ensure buttons are properly sized and spaced */
    .printable-calendar-navigation a,
    .printable-calendar-button {
        margin: 2px !important;
    }
    
    /* Fix calendar table display on very small screens */
    .printable-calendar-table {
        table-layout: fixed !important;
        width: 100% !important;
        margin: 0 !important;
        font-size: 12px !important;
    }
    
    /* Ensure all cells have consistent styling */
    .printable-calendar-table td,
    .printable-calendar-table th {
        padding: 2px !important;
    }
    
    /* Ensure thead has proper height on mobile devices */
    .printable-calendar-table th {
        height: 38px !important;
        min-height: 38px !important;
        padding: 4px 2px !important;
        vertical-align: middle !important;
        font-weight: 500 !important;
    }
    
    /* Optimize for touch interaction */
    .printable-calendar-day {
        min-height: 80px !important;
        touch-action: manipulation !important;
    }

    /* Additional icon centering for mobile buttons */
    .printable-calendar-actions .printable-calendar-button [class^="ti-"],
    .printable-calendar-actions .printable-calendar-add-holidays [class^="ti-"],
    .printable-calendar-actions .printable-calendar-remove-holidays [class^="ti-"] {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        margin: 0 !important;
    }
    
    /* Force buttons to be square with consistent dimensions */
    .printable-calendar-actions .printable-calendar-button,
    .printable-calendar-actions .printable-calendar-add-holidays,
    .printable-calendar-actions .printable-calendar-remove-holidays {
        position: relative !important;
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
}

/* Extra small screen overrides */
@media (max-width: 480px) {
    /* Further reduce font sizes */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
        font-size: 16px !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        position: relative !important;
        z-index: 5 !important;
        transform: none !important;
        left: auto !important;
    }
    
    /* Optimize selectors for small screens */
    .printable-calendar-selectors select {
        font-size: 12px !important;
        padding-left: 5px !important;
        padding-right: 20px !important;
    }
    
    /* Maintain thead height even on small screens */
    html body .printable-calendar-container .printable-calendar-table th {
        height: 38px !important;
        min-height: 38px !important;
        padding: 4px 2px !important;
        vertical-align: middle !important;
        font-weight: 500 !important;
    }
    
    /* Optimize selectors size on small screens */
    .printable-calendar-selectors select,
    .printable-calendar-month-select,
    .printable-calendar-year-select {
        max-width: 110px !important;
        min-width: 80px !important;
    }
    
    /* Reduce gap between buttons */
    .printable-calendar-actions {
        gap: 3px !important;
    }
    
    /* Make sure editable areas can handle touch input */
    .printable-calendar-editable-area {
        font-size: 10px !important;
    }
    
    /* Enhanced month/year text styling for smaller screens */
    .printable-calendar-month-year:not(.printable-calendar-button):not(button):not(.button):not(.wp-block-button__link) {
        font-size: 16px !important;
        margin: 5px auto !important;
        line-height: 1.2 !important;
    }
}

/* Make sure the month-year text is properly styled on all screen sizes */
.printable-calendar-month-year:not(.printable-calendar-button):not(button):not(.button):not(.wp-block-button__link) {
    font-weight: bold !important;
    margin: 0 auto !important;
    text-align: center !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    line-height: 1.3 !important;
    position: static !important;
    transform: none !important;
    left: auto !important;
    top: auto !important;
    flex: 1 !important;
}

/* Media query to handle the month-year display when screens are very small */
@media (max-width: 360px) {
    .printable-calendar-month-year:not(.printable-calendar-button):not(button):not(.button):not(.wp-block-button__link) {
        font-size: 14px !important;
        white-space: normal !important;
        height: auto !important;
        margin: 5px auto !important;
        line-height: 1.2 !important;
    }
}

/* Make sure the year link is properly styled on all screen sizes */
.printable-calendar-year-link:not(.printable-calendar-button):not(button):not(.button):not(.wp-block-button__link) {
    border-bottom: 1px dotted #666 !important;
    font-weight: bold !important;
    text-decoration: none !important;
}

/* Make prev/next buttons align to left and right */
.printable-calendar-prev {
    margin-right: auto !important;
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 20 !important; /* Increased z-index */
    pointer-events: auto !important; /* Explicitly make clickable */
}

.printable-calendar-next {
    margin-left: auto !important;
    position: absolute !important;
    right: 0 !important;
    top: 0 !important;
    z-index: 20 !important; /* Increased z-index */
    pointer-events: auto !important; /* Explicitly make clickable */
}

/* Navigation links container - don't make it full width */
.printable-calendar-nav-links {
    display: flex !important;
    justify-content: space-between !important;
    width: auto !important;
    flex: 0 0 auto !important;
}

/* Remove absolute positioning adjustment for month-year */
.printable-calendar-nav-links + .printable-calendar-month-year {
    z-index: 1 !important;
    position: static !important;
    left: auto !important;
    transform: none !important;
}

/* Fix for action buttons alignment */
.printable-calendar-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
}

/* Make sure button icons are centered */
.printable-calendar-button [class^="ti-"],
.printable-calendar-add-holidays [class^="ti-"],
.printable-calendar-remove-holidays [class^="ti-"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    vertical-align: middle !important;
    font-size: 14px !important;
    position: relative !important;
    margin: auto !important;
}

/* Fix for today cell styling across all templates */
.printable-calendar-today {
    background-color: var(--calendar-today-bg, #f0f8ff) !important;
}

/* Add inner highlight instead of changing border */
.printable-calendar-today .printable-calendar-day {
    box-shadow: inset 0 0 6px rgba(77, 144, 254, 0.3) !important;
}

/* Ensure editable area scroll behavior is consistent in all themes */
.printable-calendar-editable-area {
    overflow: hidden !important;
}

.printable-calendar-editable-area:focus {
    overflow: auto !important;
}

/* Override global theme styles for editable area */
.printable-calendar-editable-area {
    border-radius: 5px !important; /* More rounded corners (5px) */
    -webkit-border-radius: 5px !important;
    -moz-border-radius: 5px !important;
}

.printable-calendar-editable-area:focus {
    border-radius: 5px !important; /* Keep more rounded corners when focused */
    -webkit-border-radius: 5px !important;
    -moz-border-radius: 5px !important;
}

.printable-calendar-button.printable-calendar-print span.button-text,
.printable-calendar-button.download-monthly-calendar span.button-text,
.printable-calendar-button.printable-calendar-download span.button-text,
.printable-calendar-button.printable-calendar-share span.button-text,
.printable-calendar-button.printable-calendar-settings span.button-text,
.printable-calendar-add-holidays span.button-text,
.printable-calendar-remove-holidays span.button-text {
    display: inline-flex !important;
    align-items: center !important;
}

.printable-calendar-button.printable-calendar-print,
.printable-calendar-button.download-monthly-calendar,
.printable-calendar-button.printable-calendar-download,
.printable-calendar-button.printable-calendar-share,
.printable-calendar-button.printable-calendar-settings,
.printable-calendar-add-holidays,
.printable-calendar-remove-holidays {
    padding: 0 12px !important;
    margin: 0 !important;
    justify-content: center !important;
}

/* Fix button styling exclusion for month/year header */
.printable-calendar-month-year:not(.printable-calendar-button):not(button):not(.button):not(.wp-block-button__link) {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    text-transform: none !important;
}

/* Fix hyperlink styling exclusion for year link */
.printable-calendar-year-link:not(.printable-calendar-button):not(button):not(.button):not(.wp-block-button__link) {
    background: none !important;
    border: none !important;
    border-bottom: 1px dotted #666 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    display: inline !important;
    height: auto !important;
    padding: 0 !important;
}

/* Extra specific rule to force larger font size for month/year header */
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
    font-size: 20px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    pointer-events: auto !important; /* Ensure hyperlinks are clickable */
    z-index: 10 !important; /* Higher z-index to ensure clickability */
}

/* Match the link text size inside the month/year header */
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable-calendar-year-link {
    font-size: 20px !important;
    font-weight: normal !important;
    display: inline !important;
    text-decoration: none !important;
    border-bottom: 1px dotted #666 !important;
    color: inherit !important;
    pointer-events: auto !important; /* Ensure hyperlinks are clickable */
    cursor: pointer !important;
    position: relative !important;
    z-index: 15 !important; /* Higher z-index to ensure clickability */
}

/* Mobile specific adjustments for the month/year display */
@media (max-width: 768px) {
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
        font-size: 18px !important;
        padding: 0 40px !important;
        width: 100% !important;
        text-align: center !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 5 !important;
        position: relative !important;
        pointer-events: auto !important;
        transform: none !important;
        left: auto !important;
        margin: 0 auto !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable-calendar-year-link {
        font-size: 18px !important;
        display: inline !important;
        position: relative !important;
        text-decoration: none !important;
        border-bottom: 1px dotted #666 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
        z-index: 15 !important;
    }
}

/* Fix for action buttons alignment - appended to end of file */
.printable-calendar-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
}

/* Make sure button icons are centered */
.printable-calendar-button [class^="ti-"],
.printable-calendar-add-holidays [class^="ti-"],
.printable-calendar-remove-holidays [class^="ti-"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    vertical-align: middle !important;
    font-size: 14px !important;
    position: relative !important;
    margin: auto !important;
}

/* Extra small screen overrides for month-year display */
@media (max-width: 480px) {
    /* Further optimize month-year display on small screens */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
        font-size: 16px !important;
        padding: 0 35px !important;
        line-height: 1.4 !important;
        height: auto !important;
        min-height: 38px !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        position: relative !important;
        z-index: 5 !important;
        transform: none !important;
        left: auto !important;
        margin: 0 auto !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable-calendar-year-link {
        font-size: 16px !important;
        line-height: 1.4 !important;
        display: inline !important;
    }
}

/* Extra styling for month-year */
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
    font-size: 20px !important;
    font-weight: 500 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    pointer-events: auto !important;
    z-index: 2 !important;
    width: 100% !important;
    padding: 0 60px !important;
}

/* Match the link text size inside the month/year header */
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable-calendar-year-link {
    font-size: 20px !important;
    font-weight: normal !important;
    display: inline !important;
    text-decoration: none !important;
    border-bottom: 1px dotted #666 !important;
    color: inherit !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Fix for action buttons alignment - ensure it's included */
.printable-calendar-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
}

/* Make sure button icons are centered */
.printable-calendar-button [class^="ti-"],
.printable-calendar-add-holidays [class^="ti-"],
.printable-calendar-remove-holidays [class^="ti-"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    vertical-align: middle !important;
    font-size: 14px !important;
    position: relative !important;
    margin: auto !important;
}

/* High-specificity rules to ensure month-year is properly centered on mobile - always add at the end */
@media (max-width: 768px) {
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
        position: relative !important;
        z-index: 5 !important;
        font-size: 18px !important;
        padding: 0 40px !important;
        height: 38px !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .month-year-text {
        text-align: center !important;
        display: inline-block !important;
        margin: 0 auto !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format {
        display: inline !important;
        text-align: center !important;
        font-weight: 500 !important;
        border-bottom: 1px dotted #666 !important;
        color: inherit !important;
        text-decoration: none !important;
        pointer-events: auto !important;
    }

    /* Ensure nav buttons are clickable on mobile */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev,
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next {
        pointer-events: auto !important;
        z-index: 30 !important;
        position: absolute !important;
        width: 38px !important;
        height: 38px !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev {
        left: 0 !important;
        top: 0 !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next {
        right: 0 !important;
        top: 0 !important;
    }
    
    /* Ensure nav links container allows clicks to pass through */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-nav-links {
        pointer-events: none !important;
        width: 100% !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* Ensure clickability of nav buttons */
    html body .printable-calendar-container .printable-calendar-navigation a {
        pointer-events: auto !important;
        z-index: 30 !important;
    }
    
    /* Ensure month-year-text styling */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .month-year-text {
        text-align: center !important;
        display: inline-block !important;
        margin: 0 auto !important;
    }
}

@media (max-width: 480px) {
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
        text-align: center !important;
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 0 auto !important;
        position: relative !important;
        z-index: 5 !important;
        font-size: 16px !important;
        padding: 0 35px !important;
        height: 38px !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .month-year-text {
        text-align: center !important;
        display: inline-block !important;
        margin: 0 auto !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format {
        display: inline !important;
        text-align: center !important;
        font-weight: normal !important;
        border-bottom: 1px dotted #666 !important;
        color: inherit !important;
        text-decoration: none !important;
        pointer-events: auto !important;
        font-size: 16px !important;
    }
    
    /* Ensure nav buttons are clickable on mobile */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev,
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next {
        pointer-events: auto !important;
        z-index: 30 !important;
        position: absolute !important;
        width: 38px !important;
        height: 38px !important;
    }
    
    /* Ensure month-year-text styling */
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .month-year-text {
        text-align: center !important;
        display: inline-block !important;
        margin: 0 auto !important;
    }
}

/* Fix specific styling for the new hyperlink format */
.printable-calendar-container .printable-calendar-month-year .printable_calendar_yearlink_format {
    display: inline !important;
    text-align: center !important;
    font-weight: normal !important; /* Changed from 500 to normal */
    border-bottom: 1px dotted #666 !important;
    line-height: inherit !important;
    font-size: inherit !important;
    color: inherit !important;
    text-decoration: none !important;
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 15 !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    width: auto !important;
}

/* Remove all hover effects */
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format:hover,
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format:focus,
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format:active {
    background: none !important;
    color: inherit !important; /* Changed from blue to inherit to remove hover color change */
    border: none !important;
    border-bottom: 1px dotted #666 !important; /* Changed from blue to same as normal state */
    box-shadow: none !important;
    text-decoration: none !important;
    font-weight: normal !important;
}

/* Final override for centering the month-year text */
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year {
    text-align: center !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    margin: 0 auto !important;
    position: relative !important; /* Changed from absolute to relative */
    left: auto !important; /* Reset transform-based positioning */
    transform: none !important; /* Reset transform-based positioning */
    top: auto !important;
    z-index: 2 !important;
}

html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .month-year-text {
    text-align: center !important;
    margin: 0 auto !important;
    display: inline-block !important;
}

/* Fix navigation structure to ensure everything works correctly */
html body .printable-calendar-container .printable-calendar-navigation {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    width: 100% !important;
    height: 38px !important;
    margin-bottom: 15px !important;
    flex-wrap: nowrap !important;
    box-sizing: border-box !important;
}

html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-nav-links {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    pointer-events: none !important;
    height: 38px !important;
    z-index: 5 !important;
}

html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev,
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next {
    pointer-events: auto !important;
    position: absolute !important;
    z-index: 30 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 38px !important;
    padding: 0 15px !important; /* Restore padding for desktop view */
}

/* Ensure text is visible on desktop */
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev .nav-text,
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next .nav-text {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
}

/* Only for mobile screens, override to hide text and make buttons square */
@media (max-width: 768px) {
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev,
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next {
        width: 38px !important;
        padding: 0 !important;
    }
    
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-prev .nav-text,
    html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-next .nav-text {
        display: none !important;
    }
}

/* Final overrides to ensure yearlink is just plain text with hyperlink styling */
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format {
    display: inline !important;
    background: none !important;
    border: none !important;
    border-bottom: 1px dotted #666 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    line-height: inherit !important;
    font-size: inherit !important;
    border-radius: 0 !important;
    text-align: inherit !important;
    font-weight: normal !important; /* Changed from inherit to normal to ensure no bold */
    color: inherit !important;
    width: auto !important;
    min-width: 0 !important;
    vertical-align: baseline !important;
    text-decoration: none !important;
}

/* Remove all hover effects */
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format:hover,
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format:focus,
html body .printable-calendar-container .printable-calendar-navigation .printable-calendar-month-year .printable_calendar_yearlink_format:active {
    background: none !important;
    color: inherit !important; /* Changed from blue to inherit to remove hover color change */
    border: none !important;
    border-bottom: 1px dotted #666 !important; /* Changed from blue to same as normal state */
    box-shadow: none !important;
    text-decoration: none !important;
    font-weight: normal !important;
} 