/* Advanced Events Calendar - Frontend Styles */

/* Recurrence Display Styles */
.aec-event-schedule {
    margin: 1rem 0;
    padding: 1rem;
    background: var(--aec-list-event-bg, #f8f9fa);
    border-left: 3px solid var(--aec-month-event-bg, #112030 );
    border-radius: 4px;
}

.aec-event-schedule strong {
    --aec-list-title-color: var(--base, #112030);
    display: block;
    margin-bottom: 0.5rem;
    color: var(--aec-list-title-color);
}

.aec-schedule-pattern {
    --aec-list-text-color: var(--dark-trans-60, #112030);
    display: block;
    color: var(--aec-list-text-color);
    font-size: var(--aec-list-text-size, 14px);
}

.aec-upcoming-instances {
    margin: 1.5rem 0;
}

.aec-upcoming-heading {
    --aec-list-title-color: var(--base, #112030);
    margin: 0 0 1rem 0;
    font-size: var(--aec-list-title-size, 20px);
    font-weight: var(--aec-list-title-weight, 600);
    color: var(--aec-list-title-color);
}

.aec-instances-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aec-instance-item {
    --aec-list-border: var(--neutral,  #eeeeee);
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--aec-list-border);
    display: flex;
    gap: 1rem;
    align-items: center;
}

.aec-instance-item:last-child {
    border-bottom: none;
}

.aec-instance-date {
    --aec-list-title-color: var(--base, #112030);
    font-weight: 600;
    color: var(--aec-list-title-color, #333333);
    min-width: 120px;
}

.aec-instance-time {
    color: var(--aec-list-text-color, #666666);
    font-size: var(--aec-list-text-size, 14px);
}

/* Calendar Container */
.aec-calendar-container,
.aec-list-container,
.aec-day-container {
    max-width: var(--aec-container-max-width);
    margin: var(--aec-container-margin);
    padding: var(--aec-container-padding);
    opacity: 1;
    transition: opacity 0.3s ease;
}

.aec-calendar-container.aec-loading,
.aec-list-container.aec-loading,
.aec-day-container.aec-loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Calendar Header */
.aec-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--aec-header-gap);
    margin-bottom: var(--aec-header-margin-bottom);
    padding-bottom: var(--aec-header-padding-bottom);
    border-bottom: 1px solid var(--aec-month-border-color);
}

.aec-calendar-header > div:first-child {
    display: flex;
    align-items: center;
    gap: var(--aec-header-gap, 15px);
    flex: 1;
    min-width: 0;
}

.aec-month-title,
.aec-day-title {
    margin: 0;
    font-size: var(--aec-month-title-size, 28px);
    font-weight: var(--aec-month-title-weight, 600);
    line-height: 1.2;
    flex: 0 0 auto;
    color: var(--aec-month-header-text);
}

/* Allow Bricks typography controls to override */
.aec-bricks-calendar .aec-month-title,
.aec-bricks-calendar .aec-day-title {
    font-size: var(--aec-month-title-size, 28px);
    font-weight: var(--aec-month-title-weight, 600);
    color: var(--aec-month-header-text);
}

.aec-nav-btn {
    background: var(--aec-month-nav-button-bg);
    color: var(--aec-month-nav-button-text);
    border: none;
    padding: var(--aec-month-nav-button-padding);
    cursor: pointer;
    border-radius: var(--aec-month-nav-button-border-radius);
    text-decoration: none;
    display: inline-block;
    transition: background 0.3s;
}

.aec-nav-btn:hover {
    background: var(--aec-month-event-hover-bg);
    color: var(--aec-month-nav-button-text);
}

/* Calendar Controls */
.aec-calendar-controls {
    display: flex;
    gap: var(--aec-switcher-gap);
    margin-bottom: var(--aec-header-margin-bottom, 20px);
    justify-content: center;
}

.aec-view-link {
    padding: var(--aec-switcher-button-padding);
    background: var(--aec-month-day-hover-bg);
    color: var(--aec-month-header-text);
    text-decoration: none;
    border-radius: var(--aec-month-nav-button-border-radius);
    transition: all 0.3s;
}

.aec-view-link:hover {
    background: var(--aec-month-event-hover-bg);
}

.aec-view-link.active {
    background: var(--aec-switcher-button-active-bg);
    color: var(--aec-switcher-button-active-text);
}

/* CSS Variables - Default values (can be overridden by Bricks controls) */
.aec-bricks-calendar {
    /* Month View Colors */
    --aec-month-day-bg: #ffffff;
    --aec-month-today-bg: #e3f2fd;
    --aec-month-header-bg: transparent;
    --aec-month-header-text: #333333;
    --aec-month-day-header-bg: #ffffff;
    --aec-month-day-header-text: #333333;
    --aec-month-event-bg: #0073aa;
    --aec-month-event-text: #ffffff;
    --aec-month-event-hover-bg: #005a87;
    --aec-month-event-hover-text: #ffffff;
    --aec-month-border-color: #e0e0e0;
    --aec-month-nav-button-bg: transparent;
    --aec-month-nav-button-text: #0073aa;
    --aec-month-day-hover-bg: #f8f9fa;
    --aec-month-popover-bg: #ffffff;
    --aec-month-popover-border: #ddd;
    
    /* List View Colors */
    --aec-list-bg: #ffffff;
    --aec-list-border: #dddddd;
    --aec-list-event-bg: #ffffff;
    --aec-list-event-hover-bg: #f8f9fa;
    --aec-list-event-border: #dddddd;
    --aec-list-month-header-bg: transparent;
    --aec-list-month-header-text: #0073aa;
    --aec-list-title-color: #333333;
    --aec-list-text-color: #666666;
    --aec-list-link-color: #0073aa;
    
    /* Day View Colors */
    --aec-day-bg: #ffffff;
    --aec-day-border: #dddddd;
    --aec-day-header-bg: transparent;
    --aec-day-header-text: #333333;
    --aec-day-event-bg: #ffffff;
    --aec-day-event-hover-bg: #f8f9fa;
    --aec-day-title-color: #333333;
    --aec-day-text-color: #666666;
    --aec-day-nav-button-bg: transparent;
    --aec-day-nav-button-text: #0073aa;
    
    /* View Switcher */
    --aec-switcher-bg: transparent;
    --aec-switcher-button-bg: transparent;
    --aec-switcher-button-active-bg: #0073aa;
    --aec-switcher-button-text: #333333;
    --aec-switcher-button-active-text: #ffffff;
    
    /* Typography defaults */
    --aec-month-title-size: 24px;
    --aec-month-title-weight: 600;
    --aec-month-day-header-size: 14px;
    --aec-month-day-number-size: 18px;
    --aec-month-event-size: 12px;
    --aec-month-event-time-size: 12px;
    --aec-month-event-time-weight: 600;
    --aec-list-title-size: 20px;
    --aec-list-title-weight: 600;
    --aec-list-text-size: 14px;
    --aec-list-text-weight: 400;
    --aec-list-excerpt-color: #555555;
    --aec-list-date-day-size: 36px;
    --aec-list-date-day-weight: 700;
    --aec-list-date-month-size: 14px;
    --aec-list-date-month-weight: 600;
    --aec-list-date-weekday-size: 12px;
    --aec-list-register-btn-size: 16px;
    --aec-list-register-btn-weight: 600;
    --aec-list-register-btn-bg: #0073aa;
    --aec-list-register-btn-hover-bg: #005a87;
    --aec-day-title-size: 24px;
    --aec-day-text-size: 16px;
    --aec-day-time-label-size: 16px;
    --aec-day-time-label-weight: 600;
    --aec-day-event-title-size: 24px;
    --aec-day-event-title-weight: 600;
    --aec-day-venue-color: #333333;
    --aec-day-description-color: #555555;
    --aec-day-event-title-link-color: #0073aa;
    --aec-day-event-title-link-hover-color: #0073aa;
    
    /* Container & Layout */
    --aec-container-max-width: 1200px;
    --aec-container-padding: 20px;
    --aec-container-margin: 0 auto;
    --aec-header-margin-bottom: 20px;
    --aec-header-padding-bottom: 15px;
    --aec-header-gap: 15px;
    
    /* Month View Spacing */
    --aec-month-grid-border-radius: 8px;
    --aec-month-cell-padding: 10px;
    --aec-month-cell-min-height: 100px;
    --aec-month-day-header-padding: 15px 10px;
    --aec-month-event-gap: 4px;
    --aec-month-event-padding: 4px 6px;
    --aec-month-event-border-radius: 3px;
    --aec-month-nav-button-padding: 10px 20px;
    --aec-month-nav-button-border-radius: 4px;
    
    /* List View Spacing */
    --aec-list-view-gap: 40px;
    --aec-list-event-gap: 20px;
    --aec-list-event-padding: 20px;
    --aec-list-event-border-radius: 8px;
    --aec-list-event-margin-bottom: 20px;
    --aec-list-event-content-gap: 20px;
    --aec-list-date-padding: 10px;
    --aec-list-date-border-radius: 8px;
    --aec-list-meta-gap: 15px;
    
    /* Day View Spacing */
    --aec-day-view-gap: 30px;
    --aec-day-event-padding: 30px;
    --aec-day-event-gap: 20px;
    --aec-day-event-border-radius: 8px;
    --aec-day-event-info-gap: 20px;
    --aec-day-time-block-padding: 15px;
    --aec-day-time-block-border-radius: 8px;
    
    /* View Switcher */
    --aec-switcher-gap: 10px;
    --aec-switcher-button-padding: 10px 20px;
    --aec-switcher-button-border-radius: 6px;
    --aec-switcher-button-gap: 0;
    
    /* Category Colors */
    --aec-category-community: #4caf50;
    --aec-category-worship: #9c27b0;
    --aec-category-classes: #ff9800;
    
    /* Popover Styles */
    --aec-popover-font-size: 0.875rem;
    --aec-popover-line-height: 1.3;
    --aec-popover-offset: 2px;
    --aec-popover-width: 320px;
    --aec-popover-header-bg: #f8f9fa;
    --aec-popover-header-border: #e5e5e5;
    --aec-popover-header-size: 13px;
    --aec-popover-header-weight: 600;
    --aec-popover-header-color: #333333;
    --aec-popover-datetime-size: 11px;
    --aec-popover-datetime-weight: 600;
    --aec-popover-datetime-color: #0073aa;
    --aec-popover-title-size: 14px;
    --aec-popover-title-weight: 500;
    --aec-popover-title-color: #333333;
    --aec-popover-title-hover-color: #0073aa;
    --aec-popover-line-border: #eeeeee;
    --aec-popover-line-hover-bg: #f8f9fa;
}

/* Calendar Grid */
.aec-calendar-grid {
    border: 1px solid var(--aec-month-border-color);
    border-radius: var(--aec-month-grid-border-radius);
    overflow: visible;
}

.aec-calendar-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: 1px solid var(--aec-month-border-color);
}

.aec-calendar-row:last-child {
    border-bottom: none;
}

.aec-calendar-cell {
    padding: var(--aec-month-cell-padding);
    min-height: var(--aec-month-cell-min-height);
    border-right: 1px solid var(--aec-month-border-color);
    overflow: visible !important;
    max-height: none !important;
    /* Hide scrollbars */
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
}
.aec-calendar-cell::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari */
    width: 0 !important;
    height: 0 !important;
}

.aec-calendar-cell:last-child {
    border-right: none;
}

.aec-day-header {
    background: var(--aec-month-day-header-bg);
    color: var(--aec-month-day-header-text, #333333);
    font-weight: var(--aec-month-title-weight, 600);
    font-size: var(--aec-month-day-header-size, 14px);
    text-align: center;
    padding: var(--aec-month-day-header-padding);
    min-height: auto;
}

/* Allow Bricks typography controls to override */
.aec-bricks-calendar .aec-day-header {
    font-size: var(--aec-month-day-header-size, 14px);
    font-weight: var(--aec-month-title-weight, 600);
    color: var(--aec-month-day-header-text, #333333);
}

.aec-empty-cell {
    background: var(--aec-month-day-bg, #fafafa);
}

.aec-day-cell {
    background: var(--aec-month-day-bg);
    position: relative;
    transition: background 0.2s;
    overflow: visible !important;
    min-height: 100px;
    max-height: none !important;
    display: flex;
    flex-direction: column;
    /* Hide scrollbars */
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
}
.aec-day-cell::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari */
    width: 0 !important;
    height: 0 !important;
}

/* Event mode - hover on event items */
.aec-bricks-calendar[data-popover-mode="event"] .aec-day-cell:hover {
    background: var(--aec-month-day-bg);
}

/* Day mode - hover on day cell shows all events */
.aec-bricks-calendar[data-popover-mode="day"] .aec-day-cell {
    transition: all 0.2s;
}

.aec-bricks-calendar[data-popover-mode="day"] .aec-day-cell:hover {
    background: var(--aec-month-day-hover-bg);
    cursor: pointer;
}

.aec-bricks-calendar[data-popover-mode="day"] .aec-day-cell.aec-day-hovering {
    background: var(--aec-month-day-hover-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aec-day-number {
    font-size: var(--aec-month-day-number-size);
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--aec-month-header-text);
    flex-shrink: 0;
}

/* Allow Bricks typography controls to override */
.aec-bricks-calendar .aec-day-number {
    font-size: var(--aec-month-day-number-size);
    font-weight: 600;
    color: var(--aec-month-header-text);
}

.aec-today {
    background: var(--aec-month-today-bg);
}

.aec-today .aec-day-number {
    color: var(--aec-month-header-text);
}

.aec-has-events {
    background: var(--aec-month-event-bg);
}

/* Day Events */
.aec-day-events {
    display: flex;
    flex-direction: column;
    gap: var(--aec-month-event-gap);
    flex: 1;
    overflow: visible !important;
    min-height: 0;
    max-height: none !important;
    /* Hide scrollbars */
    scrollbar-width: none !important; /* Firefox */
    -ms-overflow-style: none !important; /* IE/Edge */
}
.aec-day-events::-webkit-scrollbar {
    display: none !important; /* Chrome/Safari */
    width: 0 !important;
    height: 0 !important;
}

.aec-event-item {
    display: block;
    padding: var(--aec-month-event-padding);
    background: var(--aec-month-event-bg);
    color: var(--aec-month-event-text);
    text-decoration: none;
    border-radius: var(--aec-month-event-border-radius);
    /* Default font-size - will be overridden by Bricks typography control */
    font-size: var(--aec-month-event-size, 12px);
    line-height: 1.4;
    transition: background 0.2s;
    word-wrap: break-word;
    overflow: visible;
    white-space: normal;
    flex-shrink: 0;
    min-height: auto;
}

.aec-event-item:hover {
    background: var(--aec-month-event-hover-bg);
    color: var(--aec-month-event-hover-text);
}

.aec-event-time {
    font-weight: var(--aec-month-event-time-weight, 600);
    font-size: var(--aec-month-event-time-size, 12px);
    display: inline-block;
    margin-right: 4px;
    white-space: nowrap;
}

.aec-event-title {
    display: block;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    max-width: 100%;
    line-height: 1.3;
    word-break: break-word;
}

.aec-more-events {
    display: block;
    padding: 4px 6px;
    color: var(--aec-month-nav-button-text, #0073aa);
    text-decoration: none;
    font-size: var(--aec-month-event-size, 12px);
    font-weight: var(--aec-month-event-time-weight, 600);
    flex-shrink: 0;
    margin-top: 4px;
}

.aec-more-events:hover {
    text-decoration: underline;
}

/* Category Colors */
.aec-event-item.aec-cat-community {
    background: var(--aec-category-community);
}

.aec-event-item.aec-cat-worship {
    background: var(--aec-category-worship);
}

.aec-event-item.aec-cat-classes {
    background: var(--aec-category-classes);
}

/* List View */
.aec-list-view {
    display: flex;
    flex-direction: column;
    gap: var(--aec-list-view-gap);
}

.aec-month-group {
    border-top: 2px solid var(--aec-list-month-header-text, var(--aec-list-link-color, #0073aa));
    padding-top: var(--aec-list-view-gap, 20px);
}

.aec-month-header {
    font-size: var(--aec-list-title-size, 24px);
    font-weight: var(--aec-list-title-weight, 600);
    margin-bottom: var(--aec-list-event-margin-bottom, 20px);
    color: var(--aec-list-month-header-text, var(--aec-list-title-color, #0073aa));
}

/* Allow Bricks typography controls to override */
.aec-bricks-calendar .aec-month-header {
    font-size: var(--aec-list-title-size, 24px);
    font-weight: var(--aec-list-title-weight, 600);
    color: var(--aec-list-month-header-text, var(--aec-list-title-color, #0073aa));
}

.aec-list-event {
    display: flex;
    gap: var(--aec-list-event-gap);
    padding: var(--aec-list-event-padding);
    background: var(--aec-list-event-bg, #ffffff);
    border: 1px solid var(--aec-list-border, #dddddd);
    border-radius: var(--aec-list-event-border-radius);
    margin-bottom: var(--aec-list-event-margin-bottom);
    transition: box-shadow 0.3s;
}

.aec-list-event:hover {
    background: var(--aec-list-event-hover-bg, #f8f9fa);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aec-event-date {
    flex-shrink: 0;
    text-align: center;
    padding: var(--aec-list-date-padding);
    background: var(--aec-list-link-color, #0073aa);
    color: #ffffff;
    border-radius: var(--aec-list-date-border-radius);
    min-width: 80px;
}

.aec-date-day {
    font-size: var(--aec-list-date-day-size, 36px);
    font-weight: var(--aec-list-date-day-weight, 700);
    line-height: 1;
}

.aec-date-month {
    font-size: var(--aec-list-date-month-size, 14px);
    font-weight: var(--aec-list-date-month-weight, 600);
    text-transform: uppercase;
    margin-top: 5px;
}

.aec-date-weekday {
    font-size: var(--aec-list-date-weekday-size, 12px);
    margin-top: 5px;
    opacity: 0.9;
}

.aec-event-content {
    flex: 1;
    display: flex;
    gap: var(--aec-list-event-content-gap);
}

.aec-event-thumbnail {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    overflow: hidden;
    border-radius: 8px;
}

.aec-event-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aec-event-details {
    flex: 1;
}

.aec-event-title {
    margin: 0 0 10px 0;
    font-size: var(--aec-list-title-size, 22px);
    font-weight: var(--aec-list-title-weight, 600);
}

/* Allow Bricks typography control to override - higher specificity */
.aec-bricks-calendar .aec-list-view .aec-event-title,
.aec-bricks-calendar .aec-list-event .aec-event-title {
    font-size: var(--aec-list-title-size, 22px);
    font-weight: var(--aec-list-title-weight, 600);
}

.aec-event-title a {
    color: var(--aec-list-title-color, #333333);
    text-decoration: none;
}

.aec-event-title a:hover {
    color: var(--aec-list-link-color, #0073aa);
}

.aec-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--aec-list-meta-gap);
    margin-bottom: var(--aec-list-meta-gap, 15px);
    font-size: var(--aec-list-text-size, 14px);
    color: var(--aec-list-text-color, #666666);
}

.aec-event-meta > span::before {
    margin-right: 5px;
}

.aec-event-excerpt {
    margin-bottom: var(--aec-list-meta-gap, 15px);
    color: var(--aec-list-excerpt-color, #555555);
    line-height: 1.6;
    font-size: var(--aec-list-text-size, 14px);
}

.aec-register-btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--aec-list-register-btn-bg, #0073aa);
    color: #ffffff;
    text-decoration: none;
    border-radius: var(--aec-list-event-border-radius, 4px);
    font-weight: var(--aec-list-register-btn-weight, 600);
    font-size: var(--aec-list-register-btn-size, 16px);
    transition: background 0.3s;
}

.aec-register-btn:hover {
    background: var(--aec-list-register-btn-hover-bg, #005a87);
    color: #ffffff;
}

/* Day View */
.aec-day-view {
    display: flex;
    flex-direction: column;
    gap: var(--aec-day-view-gap);
}

.aec-day-event {
    display: flex;
    gap: var(--aec-day-event-gap);
    padding: var(--aec-day-event-padding);
    background: var(--aec-day-event-bg, #ffffff);
    border: 1px solid var(--aec-day-border, #dddddd);
    border-radius: var(--aec-day-event-border-radius);
    transition: box-shadow 0.3s;
}

.aec-day-event:hover {
    background: var(--aec-day-event-hover-bg, #f8f9fa);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aec-event-time-block {
    flex-shrink: 0;
    text-align: center;
    padding: var(--aec-day-time-block-padding);
    background: var(--aec-month-event-bg, #0073aa);
    color: #ffffff;
    border-radius: var(--aec-day-time-block-border-radius);
    min-width: 100px;
}

.aec-time-label {
    font-size: var(--aec-day-time-label-size, 16px);
    font-weight: var(--aec-day-time-label-weight, 600);
    line-height: 1.4;
}

.aec-event-info {
    flex: 1;
    display: flex;
    gap: var(--aec-day-event-info-gap);
}

.aec-event-image {
    flex-shrink: 0;
    width: 300px;
    height: 200px;
    overflow: hidden;
    border-radius: var(--aec-day-event-border-radius, 8px);
}

.aec-event-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aec-event-body {
    flex: 1;
}

.aec-event-body h3 {
    margin: 0 0 var(--aec-day-event-info-gap, 15px) 0;
    font-size: var(--aec-day-event-title-size, 24px);
    font-weight: var(--aec-day-event-title-weight, 600);
}

/* Allow Bricks typography controls to override */
.aec-bricks-calendar .aec-day-view .aec-event-title,
.aec-bricks-calendar .aec-day-event h3 {
    font-size: var(--aec-day-event-title-size, 24px);
    font-weight: var(--aec-day-event-title-weight, 600);
}

.aec-bricks-calendar .aec-event-body {
    font-size: var(--aec-day-text-size, 16px);
    color: var(--aec-day-text-color, #666666);
}

.aec-event-body h3 a {
    color: var(--aec-day-event-title-link-color, #333333);
    text-decoration: none;
}

.aec-event-body h3 a:hover {
    color: var(--aec-day-event-title-link-hover-color, #0073aa);
}

.aec-venue,
.aec-organizer {
    margin: calc(var(--aec-day-event-info-gap, 20px) / 2) 0;
    color: var(--aec-day-venue-color, #333333);
    font-size: var(--aec-day-text-size, 16px);
}

.aec-description {
    margin: var(--aec-day-event-info-gap, 20px) 0;
    line-height: 1.7;
    color: var(--aec-day-description-color, #555555);
    font-size: var(--aec-day-text-size, 16px);
}

/* Upcoming Events Widget */
.aec-upcoming-events {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aec-upcoming-event {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    transition: box-shadow 0.3s;
}

.aec-upcoming-event:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.aec-upcoming-thumbnail {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 8px;
}

.aec-upcoming-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aec-upcoming-content {
    flex: 1;
}

.aec-upcoming-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
}

.aec-upcoming-title a {
    color: #333;
    text-decoration: none;
}

.aec-upcoming-title a:hover {
    color: #0073aa;
}

.aec-upcoming-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #666;
}

.aec-upcoming-excerpt {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
}

/* No Events Message */
.aec-no-events {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* View Switcher - Integrated Header Style */
.aec-view-switcher {
    margin-bottom: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0;
}

.aec-calendar-header .aec-view-switcher {
    margin-bottom: 0;
    flex: 0 0 auto;
}

.aec-view-switcher {
    display: flex;
    align-items: center;
}

.aec-view-switcher-buttons {
    display: flex;
    gap: var(--aec-switcher-button-gap, 0);
    border-radius: var(--aec-switcher-button-border-radius, 8px);
    overflow: hidden;
    background: var(--aec-switcher-bg, #f5f5f5);
    padding: 4px;
    border: 1px solid var(--aec-month-border-color, #e5e5e5);
}

.aec-view-switcher-button {
    padding: var(--aec-switcher-button-padding);
    background: var(--aec-switcher-button-bg, transparent);
    color: var(--aec-switcher-button-text, #666666);
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: var(--aec-popover-title-size, 14px);
    line-height: 1.4;
    transition: all 0.3s;
    border-radius: var(--aec-switcher-button-border-radius);
    font-family: inherit;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.aec-view-switcher-button:hover {
    background: var(--aec-month-day-hover-bg, rgba(0, 0, 0, 0.05));
    color: var(--aec-switcher-button-text, #333333);
}

.aec-view-switcher-button:focus {
    outline: 2px solid var(--aec-switcher-button-active-bg, #0073aa);
    outline-offset: 2px;
}

.aec-view-switcher-button.active {
    background: var(--aec-switcher-button-active-bg, #0073aa);
    color: var(--aec-switcher-button-active-text, #ffffff);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.aec-view-switcher-dropdown {
    padding: var(--aec-switcher-button-padding, 10px 15px);
    border: 2px solid var(--aec-month-border-color, #dddddd);
    border-radius: var(--aec-switcher-button-border-radius, 6px);
    font-size: var(--aec-popover-title-size, 16px);
    background: var(--aec-list-event-bg, #ffffff);
    cursor: pointer;
    min-width: 200px;
}

.aec-view-switcher-dropdown:focus {
    outline: none;
    border-color: var(--aec-switcher-button-active-bg, #0073aa);
}

/* Mobile Vertical Calendar Stack - Events Calendar Pro Style */
.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical {
    display: flex;
    flex-direction: column;
    border: none;
    background: transparent;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-calendar-row {
    display: flex;
    flex-direction: column;
    border: none;
    background: transparent;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-calendar-header-row {
    display: none; /* Hide day headers on mobile stack */
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-empty-cell {
    display: none; /* Hide empty cells on mobile */
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-calendar-cell {
    border: none;
    border-bottom: 1px solid var(--aec-month-border-color, #e5e5e5);
    padding: 0;
    min-height: auto;
    background: transparent;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    background: white;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell:last-child {
    border-bottom: none;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell .aec-day-number {
    font-size: var(--aec-month-day-number-size, 32px);
    font-weight: var(--aec-month-title-weight, 600);
    line-height: 1;
    min-width: 50px;
    color: var(--aec-list-text-color, #666666);
    margin-bottom: 0;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell.aec-today .aec-day-number {
    color: var(--aec-month-nav-button-text, #0073aa);
    font-weight: 700;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell .aec-day-events {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell .aec-event-item {
    background: var(--aec-list-event-hover-bg, #f8f9fa);
    border-left: 3px solid var(--aec-month-event-bg, #0073aa);
    padding: var(--aec-month-event-padding, 12px 14px);
    border-radius: var(--aec-month-event-border-radius, 4px);
    font-size: var(--aec-list-text-size, 14px);
    line-height: 1.5;
    display: block;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell .aec-event-item .aec-event-time {
    font-weight: var(--aec-month-event-time-weight, 600);
    color: var(--aec-month-event-bg, #0073aa);
    display: block;
    margin-bottom: 4px;
    font-size: var(--aec-month-event-time-size, 13px);
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell .aec-event-item .aec-event-title {
    color: var(--aec-list-title-color, #333333);
    font-weight: 500;
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell .aec-event-item:hover {
    background: var(--aec-day-event-hover-bg, #e9ecef);
    border-left-color: var(--aec-month-event-hover-bg, #005a87);
}

.aec-mobile-stack .aec-calendar-grid.aec-mobile-vertical .aec-day-cell .aec-more-events {
    color: var(--aec-month-nav-button-text, #0073aa);
    font-size: var(--aec-list-text-size, 14px);
    font-weight: var(--aec-month-event-time-weight, 600);
    padding: 8px 14px;
    display: inline-block;
    text-align: center;
    margin-top: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aec-calendar-container {
        padding: 15px;
    }
    
    .aec-calendar-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding-bottom: 12px;
    }
    
    .aec-calendar-header > div:first-child {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .aec-month-title {
        font-size: var(--aec-month-title-size, 24px);
        flex: 1;
        text-align: left;
        margin: 0;
    }
    
    .aec-nav-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
    
    .aec-view-switcher {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    .aec-view-switcher-buttons {
        width: 100%;
        justify-content: stretch;
    }
    
    .aec-view-switcher-button {
        flex: 1;
        padding: 10px 12px;
        font-size: 14px;
        text-align: center;
    }
    
    .aec-calendar-grid:not(.aec-mobile-vertical) {
        font-size: 12px;
    }
    
    .aec-calendar-cell {
        min-height: 80px;
        padding: 5px;
    }
    
    .aec-day-number {
        font-size: 14px;
    }
    
    .aec-event-item {
        font-size: 10px;
    }
    
    .aec-list-event,
    .aec-day-event {
        flex-direction: column;
    }
    
    .aec-event-content,
    .aec-event-info {
        flex-direction: column;
    }
    
    .aec-event-thumbnail,
    .aec-event-image {
        width: 100%;
        height: 200px;
    }
    
    .aec-upcoming-event {
        flex-direction: column;
    }
    
    .aec-upcoming-thumbnail {
        width: 100%;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .aec-calendar-row {
        font-size: 10px;
    }
    
    .aec-calendar-cell {
        min-height: 60px;
        padding: 3px;
    }
    
    .aec-day-events {
        display: none;
    }
    
    .aec-day-cell.aec-has-events::after {
        content: '•';
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        color: #0073aa;
        font-size: 20px;
    }
}

/* month cell must let popovers overflow */
.aec-calendar-grid { position: relative; overflow: visible; }
.aec-calendar-cell.aec-day-cell { position: relative; overflow: visible; }

/* inline item */
.aec-event-mini {
  display:block;
  font-size: var(--aec-popover-font-size, 0.875rem);
  line-height: var(--aec-popover-line-height, 1.3);
  text-decoration: underline;
  cursor:pointer;
  position:relative;
}

/* popover panel (hidden by default) */
.aec-popover {
  position:absolute;
  top: 100%;
  left: 0;
  transform: translateY(var(--aec-popover-offset, 2px));
  width: var(--aec-popover-width, 320px);
  max-width: calc(100vw - 2rem);
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}

/* Create hoverable bridge between trigger and popover */
.aec-event-mini::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: var(--aec-popover-offset, 2px);
  z-index: 51;
  pointer-events: auto;
}

/* Day hover popover - shows all events for the day */
.aec-day-popover {
  margin-top: 0;
  min-width: 300px;
  max-width: 400px;
}

/* Create hoverable bridge for day popover */
.aec-day-cell.aec-day-hovering::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--aec-popover-offset, 2px);
  z-index: 61;
  pointer-events: auto;
}

.aec-day-popover .aec-popover-body {
  max-height: 400px;
  overflow-y: auto;
}

.aec-day-popover .aec-popover-line {
  padding: 10px 0;
  border-bottom: 1px solid var(--aec-popover-line-border, #eeeeee);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background 0.2s;
}

.aec-day-popover .aec-popover-line:hover {
  background: var(--aec-popover-line-hover-bg, #f8f9fa);
  margin: 0 -14px;
  padding-left: 14px;
  padding-right: 14px;
}

.aec-day-popover .aec-popover-line:last-child {
  border-bottom: none;
}

.aec-day-popover .aec-popover-datetime {
  font-size: var(--aec-popover-datetime-size, 11px);
  font-weight: var(--aec-popover-datetime-weight, 600);
  color: var(--aec-popover-datetime-color, #0073aa);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}

.aec-day-popover .aec-popover-title {
  font-size: var(--aec-popover-title-size, 14px);
  font-weight: var(--aec-popover-title-weight, 500);
  color: var(--aec-popover-title-color, #333333);
  text-decoration: none;
  line-height: 1.5;
  display: block;
  transition: color 0.2s;
}

.aec-day-popover .aec-popover-title:hover {
  color: var(--aec-popover-title-hover-color, #0073aa);
  text-decoration: underline;
}

/* Show hint when hovering over day cell in day mode */
.aec-bricks-calendar[data-popover-mode="day"] .aec-day-cell:hover:not(.aec-day-hovering) {
  background: var(--aec-month-day-hover-bg, #f8f9fa);
  cursor: pointer;
}

.aec-bricks-calendar[data-popover-mode="day"] .aec-day-cell.aec-day-hovering {
  background: var(--aec-month-day-hover-bg, #f8f9fa);
}

/* Day cell hover state */
.aec-day-cell.aec-day-hovering {
  z-index: 60;
  position: relative;
}

.aec-day-cell[data-popover-mode="day"] {
  cursor: pointer;
}

/* card styles */
.aec-popover-card {
  background: var(--aec-month-popover-bg, #ffffff);
  border:1px solid var(--aec-month-popover-border, rgba(0,0,0,.1));
  border-radius:8px;
  box-shadow:0 10px 25px rgba(0,0,0,.15);
  overflow:hidden;
}

.aec-popover-header {
  padding: 12px 14px;
  background: var(--aec-popover-header-bg, #f8f9fa);
  border-bottom: 1px solid var(--aec-popover-header-border, #e5e5e5);
  font-size: var(--aec-popover-header-size, 13px);
  font-weight: var(--aec-popover-header-weight, 600);
  color: var(--aec-popover-header-color, #333333);
}
.aec-popover-media img { display:block; width:100%; height:auto; }
.aec-popover-body { padding:12px 14px; }
.aec-popover-title { 
  display:block; 
  font-weight:var(--aec-popover-title-weight, 700); 
  margin:.25rem 0; 
  font-size: var(--aec-popover-title-size, 14px);
  color: var(--aec-popover-title-color, #333333);
}
.aec-popover-datetime, .aec-popover-venue { 
  color: var(--aec-popover-datetime-color, #666666); 
  font-size: var(--aec-popover-datetime-size, 0.85rem); 
}
.aec-popover-actions { margin-top:.5rem; display:flex; gap:.5rem; align-items:center; }
.aec-btn { display:inline-block; padding:.35rem .6rem; border-radius:6px; border:1px solid #111; }

/* show on hover/focus for keyboard & mouse (event mode) */
.aec-bricks-calendar[data-popover-mode="event"] .aec-event-mini:focus + .aec-popover,
.aec-bricks-calendar[data-popover-mode="event"] .aec-event-mini:hover + .aec-popover,
.aec-bricks-calendar[data-popover-mode="event"] .aec-popover:hover,
.aec-bricks-calendar[data-popover-mode="event"] .aec-popover:focus-within {
  opacity:1;
  visibility:visible;
  pointer-events:auto;
  transform: translateY(0);
  transition-delay:0s;
}

/* Day mode - completely disable event item hover effects */
.aec-bricks-calendar[data-popover-mode="day"] .aec-event-item {
  pointer-events: auto; /* Allow clicks but prevent hover tooltips */
}
.aec-bricks-calendar[data-popover-mode="day"] .aec-event-item:hover {
  background: var(--aec-month-event-bg, #0073aa) !important;
  cursor: default !important;
  transform: none !important;
  box-shadow: none !important;
}
/* Hide any tooltips/popovers on event items in day mode */
.aec-bricks-calendar[data-popover-mode="day"] .aec-event-item:hover + .aec-popover,
.aec-bricks-calendar[data-popover-mode="day"] .aec-event-item .aec-popover {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

/* keep popover above other cells when hovering (event mode) */
.aec-bricks-calendar[data-popover-mode="event"] .aec-day-cell:hover,
.aec-bricks-calendar[data-popover-mode="event"] .aec-event-item:hover {
  z-index: 60;
  position: relative;
}

/* simple left/right flipping to keep in viewport */
.aec-popover.aec-flip-left { left:auto; right:0; }
