/* Wrapper for the whole calendar */
.di-cal-wrapper {
    width: 100%;
    max-width: 1200px;
    z-index: 200;
}

.di-cal-calendar {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    max-width: 1200px;
}

/* Calendar month heading */
.di-cal-calendar-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.di-cal-calendar-header h2 {
    font-size: 24px;
    margin: 0;
    font-weight: 600;
    color: #333;
    width: 100%;
}

/* Calendar grid layout */
.di-cal-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    min-width: 550px;
}
.di-cal-calendar-grid-wrapper {
    position: relative;
}
/* Hide default scrollbar and create custom one */
.di-custom-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;          /* Firefox */
    scrollbar-color: #b8b8b8 transparent; /* Firefox */
}

/* Chrome, Edge, Safari */
.di-custom-scroll::-webkit-scrollbar {
    height: 5px; /* Make it small */
}

.di-custom-scroll::-webkit-scrollbar-track {
    background: transparent; /* No track background */
}

.di-custom-scroll::-webkit-scrollbar-thumb {
    background-color: #000; /* Black thumb */
    border-radius: 3px;
    border: none; /* No border, just clean */
}

.di-custom-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #333; /* Slightly lighter on hover */
}

/* General cell styles */
.di-cal-calendar-cell {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 10px;
    min-height: 100px;
    position: relative;
    font-size: 14px;
    min-width: 14%;
}
@media screen and (max-width: 650px) {
    .di-cal-calendar-cell {
        padding: 10px 5px;
    }
}

/* Empty cells (before month start) */
.di-cal-calendar-cell.empty {
    background: transparent;
    border: none;
}

/* Day number */
.di-cal-date {
    font-weight: 700;
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

.di-cal-calendar-cell.other-month {
    background: #f7f7f7;
    color: #aaa;
    opacity: 0.4;
}
.di-cal-calendar-cell .di-cal-date {
    opacity: 0.35;
}

/* Today's cell highlight */
.di-cal-calendar-cell.today {
    background: #e6f7ff;
    border-color: #91d5ff;
}

/* Event titles inside a day */
.di-cal-event {
    margin-top: 5px;
    padding: 3px 5px;
    background: #0073aa;
    color: #fff;
    border-radius: 3px;
    font-size: 12px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Event hover */
.di-cal-event:hover {
    background: #005177;
}

/* Calendar weekday labels */
.di-cal-calendar-header-cell {
    background: #f0f0f0;
    text-align: center;
    font-weight: 700;
    padding: 10px 5px;
    font-size: 13px;
    color: #666;
    min-height: 35px;
}

/* Event Info (Archive View) */
.di-cal-event-wrapper {
    position: relative;
}

/* .di-cal-event {
    display: block;
    position: relative;
    background: #0073aa;
    color: #fff;
    padding: 4px 6px;
    margin-top: 5px;
    font-size: 12px;
    border-radius: 4px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
} */
.di-cal-event {
    display: block;
    padding: 4px 8px;
    margin-bottom: 4px;
    font-size: 14px;
    border-radius: 4px;
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* If event is continuing from previous day */
.di-cal-event-middle,
.di-cal-event-start {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    /* padding-left: 4px; tighten left */
    margin-right: -10px;
}

/* If event is continuing into next day */
.di-cal-event-middle,
.di-cal-event-end {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    padding-right: 4px; /* tighten right */
    margin-left: -10px;
}

@media screen and (max-width: 650px) {
    .di-cal-event-middle,
    .di-cal-event-start {
        margin-right: -5px;
    }

    /* If event is continuing into next day */
    .di-cal-event-middle,
    .di-cal-event-end {
        margin-left: -5px;
    }
}


.di-cal-event-middle span,
.di-cal-event-end span {
    visibility: hidden;
}

.di-cal-event:hover {
    background: #005177;
}

.di-cal-event-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 0;
    z-index: 10;
    width: 220px;
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
    padding: 10px;
    font-size: 13px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    border-radius: 4px;
}
.di-cal-event-tooptip a.di-cal-event {
    background: rgb(226, 226, 226);
    color: black;
}

.di-cal-event-wrapper:hover .di-cal-event-tooltip {
    display: block;
}

.di-cal-event-tooltip strong {
    font-size: 14px;
    display: block;
    margin-bottom: 5px;
}
.di-cal-event-tooltip .di-cal-event-time p, .di-cal-event-tooltip .di-cal-event-time strong {
    font-size: 12px !important;
    line-height: 1.3;
}
.di-cal-event-tooltip .di-cal-event-time strong {
    margin-bottom: 0;
    margin-top: 5px;
}
.di-cal-event-time {
    display: block;
    margin-bottom: 15px;
    margin-top: 10px;
}

.di-cal-event-tooltip .desc p {
    font-size: 14px;
    line-height: 1.1;
    margin-bottom: 10px;
}

.di-cal-event-view-link {
    display: inline-block;
    margin-top: 8px;
    padding: 5px 8px;
    background: #0073aa;
    color: #fff;
    font-size: 12px;
    border-radius: 3px;
    text-decoration: none;
}

.di-cal-event-view-link:hover {
    background: #005177;
}


/* Calendar Navigation */
.di-cal-navigation {
    text-align: center;
    /* margin-bottom: 20px; */
    display: flex;
    justify-content: space-evenly;
    margin-bottom: 20px;
}

.di-cal-navigation a {
    display: inline-block;
    margin: 0 10px;
    padding: 8px 14px;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    height: fit-content;
}

.di-cal-navigation a:hover {
    background: #005177;
}

.di-cal-month-dropdown, .di-cal-year-dropdown {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px 0;
    z-index: 20;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border-radius: 4px;
    margin-top: 5px;
}

.di-cal-month-option, .di-cal-year-option {
    padding: 6px 10px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.di-cal-month-option:hover, .di-cal-year-option:hover {
    background: #0073aa;
    color: #fff;
}

.di-cal-month-select, .di-cal-year-select {
    position: relative;
    cursor: pointer;
}
/* Dropdown container */
.di-cal-month-dropdown,
.di-cal-year-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    width: 180px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
    overflow: hidden;
    z-index: 100;
}

/* Individual options inside dropdown */
.di-cal-month-option,
.di-cal-year-option {
    padding: 10px 15px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

/* Hover effect for options */
.di-cal-month-option:hover,
.di-cal-year-option:hover {
    background: #0073aa;
    color: #ffffff;
}

/* Add subtle separator between options */
.di-cal-month-option + .di-cal-month-option,
.di-cal-year-option + .di-cal-year-option {
    border-top: 1px solid #eee;
}

.di-cal-month-option.active,
.di-cal-year-option.active {
    background: #f0f8ff;
    font-weight: 600;
    color: #0073aa;
}

.di-cal-month-dropdown,
.di-cal-year-dropdown {
    animation: di-cal-fade-slide-in 0.25s ease forwards;
    opacity: 0; /* Initial invisible until animation runs */
    transform: translate(-50%, -10px); /* Start slightly higher */
}

/* Define the animation */
@keyframes di-cal-fade-slide-in {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}



/* Single Events */
.di-cal-single-event {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    margin-top: 250px !important;
}

.di-cal-single-title {
    font-size: 32px;
    margin-bottom: 20px;
    text-align: center;
    color: #222;
}

.di-cal-single-meta {
    margin-bottom: 30px;
    text-align: center;
    font-size: 16px;
    color: #666;
}

.di-cal-single-meta strong {
    color: #000;
}

.di-cal-single-dates,
.di-cal-single-categories {
    margin-bottom: 10px;
}

.di-cal-single-content {
    font-size: 16px;
    line-height: 1.6;
    color: #444;
}

/* Calendar Category Filter - Frontend Styling */
.di-cal-category-filter {
    margin: 20px 0;
    display: inline-block;
    position: relative;
}

.di-cal-category-filter select {
    padding: 8px 26px 8px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    appearance: none; /* Remove default dropdown styling */
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    max-width: 250px;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.di-cal-category-filter select:focus {
    border-color: #2271b1; /* WordPress blue */
    outline: none;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.di-cal-category-filter::after {
    content: "▼";
    font-size: 9px;
    color: #666;
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

/* Loading animation */
.di-cal-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: 0.2s ease-in;
}
.di-cal-loading.shown {
    opacity: 1;
    pointer-events: auto;
}
.di-cal-spinner {
    width: 32px;
    height: 32px;
    border: 4px solid #ccc;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: diCalSpin 1s linear infinite;
}

@keyframes diCalSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}