/* Custom Calendar Plugin Stylesheet */

.custom-calendar-wrapper {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    max-width: 1200px;
    margin: 0 auto 30px auto;
    padding: 20px;
    box-sizing: border-box;
    color: #111111;
    position: relative;
}

/* Loading Overlay & Spinner */
.cc-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    backdrop-filter: blur(1px);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.custom-calendar-wrapper.is-loading .cc-loading-overlay,
.upcoming-events-wrapper.is-loading .cc-loading-overlay {
    opacity: 1;
    visibility: visible;
}

.cc-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e2d2f2;
    border-top: 4px solid #8B2FC9;
    border-radius: 50%;
    animation: cc-spin 0.8s linear infinite;
}

@keyframes cc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Header & Controls */
.custom-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.custom-calendar-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.custom-calendar-nav .cc-btn {
    background-color: #8B2FC9;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.custom-calendar-nav .cc-btn:hover {
    background-color: #7423aa;
}

.custom-calendar-nav .cc-btn:active {
    transform: scale(0.98);
}

.custom-calendar-month-title {
    font-size: 40px;
    font-weight: 900;
    color: #8B2FC9;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Calendar Grid Layout (Supports 7-column or 8-column via show_weekly_focus attribute) */
.custom-calendar-grid {
    display: grid;
    gap: 12px;
    width: 100%;
}

.custom-calendar-grid.cc-has-weekly-focus {
    grid-template-columns: repeat(8, 1fr);
}

.custom-calendar-grid.cc-no-weekly-focus {
    grid-template-columns: repeat(7, 1fr);
}

/* Column Header Cells */
.cc-header-cell {
    text-align: center;
    padding: 10px 4px;
    font-size: 18px;
    font-weight: 500;
    color: #222222;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cc-header-cell.cc-weekly-focus-header {
    font-size: 14px;
    line-height: 1.3;
    font-weight: 600;
    color: #222222;
    text-align: center;
}

/* Weekly Focus Box */
.cc-weekly-focus-box {
    border: 2.5px solid #8B2FC9;
    background-color: #ffffff;
    min-height: 120px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    line-height: 1.45;
    font-weight: 500;
    color: #111111;
    box-sizing: border-box;
}

/* Day Box */
.cc-day-box {
    border: 1.5px solid #111111;
    background-color: #ffffff;
    min-height: 120px;
    padding: 8px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    position: relative;
}

.cc-day-box.cc-other-month {
    opacity: 0.35;
    background-color: #f9f9f9;
}

.cc-day-number {
    text-align: right;
    font-size: 15px;
    font-weight: 500;
    color: #111111;
    margin-bottom: 6px;
}

.cc-day-events {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
    text-align: center;
    gap: 4px;
}

.cc-event-item {
    font-size: 13.5px;
    line-height: 1.3;
    color: #111111;
    text-decoration: none;
    word-break: break-word;
}

.cc-event-item.cc-highlight-purple {
    color: #8B2FC9;
    font-weight: 700;
}

/* ==========================================================================
   Upcoming Events Shortcode Layout & Swiper Offset Carousel Styles
   ========================================================================== */
.upcoming-events-wrapper {
    position: relative;
    margin: 30px auto;
    max-width: 1200px;
    padding: 20px;
    box-sizing: border-box;
}

.upcoming-events-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.upcoming-events-header .left-side {
    display: flex;
    gap: 10px;
    align-items: center;
}

.upcoming-events-header .ue-btn {
    background-color: #8B2FC9;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.upcoming-events-header .ue-btn:hover {
    background-color: #7423aa;
}

.upcoming-events-header .ue-btn:active {
    transform: scale(0.98);
}

.upcoming-events-header .right-side .ue-month-title {
    font-size: 32px;
    font-weight: 900;
    color: #8B2FC9;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Swiper Carousel Container & Arrow Styling */
.event_wrap.is-carousel.swiper {
    position: relative;
    margin: 20px 0;
    box-sizing: border-box;
    padding: 0 44px;
    overflow: hidden;
}

.event_wrap.is-carousel .swiper-wrapper {
    display: flex;
    box-sizing: content-box;
}

.event_wrap.is-carousel .swiper-slide {
    height: auto;
    flex-shrink: 0;
    box-sizing: border-box;
}

.cc-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: #8B2FC9;
    color: #ffffff;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, opacity 0.2s ease, transform 0.1s ease;
    user-select: none;
}

.cc-carousel-arrow:hover {
    background-color: #7423aa;
}

.cc-carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.cc-carousel-arrow.swiper-button-disabled {
    opacity: 0.35;
    cursor: default;
    pointer-events: none;
}

.cc-carousel-prev {
    left: 0;
}

.cc-carousel-next {
    right: 0;
}

/* ==========================================================================
   Single Event Dates Table Shortcode Styles ([event_dates])
   ========================================================================== */
.event-dates-table-wrapper {
    max-width: 600px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
}

.event-dates-header {
    display: flex;
    background-color: #8B2FC9;
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    padding: 12px 16px;
    box-sizing: border-box;
}

.event-dates-body {
    display: flex;
    flex-direction: column;
}

.event-dates-row {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #eeeeee;
    font-size: 14.5px;
    color: #222222;
    box-sizing: border-box;
    transition: background-color 0.15s ease;
}

.event-dates-row:last-child {
    border-bottom: none;
}

.event-dates-row:nth-child(even) {
    background-color: #fcfcfc;
}

.event-dates-row:hover {
    background-color: #f5edfa;
}

.event-dates-col {
    box-sizing: border-box;
}

.event-dates-col.col-date {
    flex: 1 1 60%;
    font-weight: 600;
}

.event-dates-col.col-time {
    flex: 1 1 40%;
    color: #555555;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .custom-calendar-grid {
        gap: 8px;
    }
    .cc-day-box, .cc-weekly-focus-box {
        min-height: 100px;
        padding: 6px;
        font-size: 13px;
    }
    .cc-header-cell {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .custom-calendar-wrapper {
        overflow-x: auto;
    }
    .custom-calendar-grid.cc-has-weekly-focus {
        min-width: 800px;
    }
    .custom-calendar-grid.cc-no-weekly-focus {
        min-width: 700px;
    }
    .event_wrap.is-carousel.swiper {
        padding: 0 36px;
    }
    .cc-carousel-arrow {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
    .event-dates-table-wrapper {
        width: 100%;
    }
}
