/**
 * BrightFrame Calendar - Frontend Styles
 */

/* CSS Custom Properties (defaults) */
:root {
    --bf-calendar-primary: #3b82f6;
    --bf-calendar-secondary: #64748b;
    --bf-calendar-accent: #8b5cf6;
    --bf-calendar-today: #fbbf24;
    --bf-calendar-border-radius: 8px;
    --bf-calendar-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --bf-calendar-text: #1e293b;
    --bf-calendar-text-muted: #64748b;
    --bf-calendar-bg: #ffffff;
    --bf-calendar-border: #e2e8f0;
}

/* =====================
   NO EVENTS MESSAGE
   ===================== */
.bf-calendar-no-events {
    text-align: center;
    padding: 40px 20px;
    color: var(--bf-calendar-text-muted);
}

/* =====================
   EVENTS GRID (Cards)
   ===================== */
.bf-events-grid {
    display: grid;
    gap: 24px;
}

.bf-events-columns-1 { grid-template-columns: 1fr; }
.bf-events-columns-2 { grid-template-columns: repeat(2, 1fr); }
.bf-events-columns-3 { grid-template-columns: repeat(3, 1fr); }
.bf-events-columns-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
    .bf-events-columns-4,
    .bf-events-columns-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .bf-events-grid {
        grid-template-columns: 1fr !important;
    }
}

/* =====================
   EVENTS TILES
   ===================== */
.bf-events-tiles {
    display: grid;
    gap: 20px;
}

.bf-events-tiles.bf-events-columns-1 { grid-template-columns: 1fr; }
.bf-events-tiles.bf-events-columns-2 { grid-template-columns: repeat(2, 1fr); }
.bf-events-tiles.bf-events-columns-3 { grid-template-columns: repeat(3, 1fr); }
.bf-events-tiles.bf-events-columns-4 { grid-template-columns: repeat(4, 1fr); }

.bf-event-tile {
    position: relative;
    display: flex;
    min-height: 200px;
    border-radius: var(--bf-calendar-border-radius);
    overflow: hidden;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bf-event-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
    text-decoration: none;
}

.bf-event-tile-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.45) 100%);
    transition: background 0.2s ease;
}

.bf-event-tile:hover .bf-event-tile-overlay {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.65) 0%, rgba(0, 0, 0, 0.35) 100%);
}

.bf-event-tile-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    width: 100%;
    color: white;
}

.bf-event-tile-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    flex-shrink: 0;
}

.bf-event-tile-day {
    font-size: 2em;
    font-weight: 700;
    line-height: 1;
}

.bf-event-tile-month {
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.9;
}

.bf-event-tile-info {
    flex: 1;
    min-width: 0;
}

.bf-event-tile-title {
    margin: 0 0 6px;
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    color: white;
}

.bf-event-tile-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9em;
    opacity: 0.9;
}

.bf-event-tile-time .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.bf-event-tile-location {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 0.85em;
    opacity: 0.85;
    margin-top: 2px;
}

.bf-event-tile-location .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
    margin-top: 2px;
}

/* Tiles Responsive */
@media (max-width: 1024px) {
    .bf-events-tiles.bf-events-columns-3,
    .bf-events-tiles.bf-events-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .bf-events-tiles.bf-events-columns-2,
    .bf-events-tiles.bf-events-columns-3,
    .bf-events-tiles.bf-events-columns-4 {
        grid-template-columns: 1fr;
    }

    .bf-event-tile {
        min-height: 160px;
    }

    .bf-event-tile-content {
        padding: 16px;
        gap: 12px;
    }

    .bf-event-tile-day {
        font-size: 1.75em;
    }

    .bf-event-tile-title {
        font-size: 1.25em;
    }
}

/* Event Card */
.bf-event-card {
    background: var(--bf-calendar-bg);
    border-radius: var(--bf-calendar-border-radius);
    box-shadow: var(--bf-calendar-shadow);
    border: var(--bf-calendar-card-border, none);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.bf-event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

.bf-event-card.bf-event-cancelled {
    opacity: 0.7;
}

.bf-event-card.bf-event-featured {
    border: 2px solid var(--event-color, var(--bf-calendar-accent));
}

.bf-event-card.bf-event-today {
    border: 2px solid var(--bf-calendar-today, #fbbf24);
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2), var(--bf-calendar-shadow);
}

.bf-event-card.bf-event-today .bf-event-date-badge {
    background: var(--bf-calendar-today, #fbbf24);
}

/* Card Image */
.bf-event-card-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.bf-event-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.bf-event-card:hover .bf-event-card-image img {
    transform: scale(1.05);
}

/* Card Color Header (fallback when no featured image) */
.bf-event-card-header {
    aspect-ratio: 16 / 9;
    background: var(--event-color, var(--bf-calendar-primary));
    position: relative;
}

.bf-event-card-header a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Card Content */
.bf-event-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
}

/* Date Badge */
.bf-event-date-badge {
    position: absolute;
    top: -30px;
    left: 20px;
    background: var(--event-color, var(--bf-calendar-primary));
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 48px;
}

.bf-event-card-image + .bf-event-card-content .bf-event-date-badge,
.bf-event-card-header + .bf-event-card-content .bf-event-date-badge {
    top: -30px;
}

/* When card has color header (no image), use contrasting white badge */
.bf-event-card-header + .bf-event-card-content .bf-event-date-badge {
    background: #ffffff;
    color: var(--event-color, var(--bf-calendar-primary));
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.bf-event-card-content:first-child .bf-event-date-badge {
    position: relative;
    top: auto;
    left: auto;
    margin-bottom: 12px;
    width: fit-content;
}

.bf-date-month {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.bf-date-day {
    font-size: 22px;
    font-weight: 700;
    margin-top: 2px;
    display: block;
}

/* Event Title */
.bf-event-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

/* Add top spacing for title when card has header (date badge overlaps) */
.bf-event-card-image + .bf-event-card-content .bf-event-title,
.bf-event-card-header + .bf-event-card-content .bf-event-title {
    margin-top: 16px;
}

.bf-event-title a {
    color: var(--bf-calendar-text);
    text-decoration: none;
}

.bf-event-title a:hover {
    color: var(--event-color, var(--bf-calendar-primary));
}

.bf-event-subtitle {
    margin: -2px 0 8px;
    font-size: 14px;
    font-weight: 400;
    color: var(--bf-calendar-text-muted);
    line-height: 1.4;
}

/* Event Status Badge */
.bf-event-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
}

.bf-event-status.status-cancelled {
    background: #fee2e2;
    color: #dc2626;
}

.bf-event-status.status-postponed {
    background: #fef3c7;
    color: #d97706;
}

/* Event Meta */
.bf-event-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--bf-calendar-text-muted);
}

.bf-event-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bf-event-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--event-color, var(--bf-calendar-primary));
}

/* Two-line location display */
.bf-location-details {
    display: flex;
    flex-direction: column;
}

.bf-location-name {
    font-weight: 500;
}

.bf-location-address {
    font-size: 0.9em;
    opacity: 0.8;
}

.bf-event-meta-item.bf-event-meta-location-block {
    align-items: flex-start;
}

.bf-event-meta-item.bf-event-meta-location-block .dashicons {
    margin-top: 4px;
}

/* Event Excerpt */
.bf-event-excerpt {
    color: var(--bf-calendar-text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px;
    flex: 1;
}

/* Event Actions */
.bf-event-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.bf-event-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    border: none;
}

.bf-event-btn-primary {
    background: var(--bf-calendar-accent);
    color: white;
}

.bf-event-btn-primary:hover {
    filter: brightness(1.1);
    color: white;
}

.bf-event-btn-secondary {
    background: transparent;
    color: var(--event-color, var(--bf-calendar-primary));
    border: 1px solid var(--event-color, var(--bf-calendar-primary));
}

.bf-event-btn-secondary:hover {
    background: var(--event-color, var(--bf-calendar-primary));
    color: white;
}

.bf-event-btn-small {
    padding: 6px 14px;
    font-size: 13px;
}

/* Individual button color overrides */
.bf-event-btn-details {
    background: var(--bf-calendar-details-btn);
    color: white;
    border: none;
}
.bf-event-btn-details:hover {
    filter: brightness(1.1);
    color: white;
}

.bf-event-btn-register {
    background: var(--bf-calendar-register-btn);
    color: white;
    border: none;
}
.bf-event-btn-register:hover {
    filter: brightness(1.1);
    color: white;
}

.bf-event-btn-view-full-page {
    background: var(--bf-calendar-view-full-page-btn);
    color: white;
    border: none;
}
.bf-event-btn-view-full-page:hover {
    filter: brightness(1.1);
    color: white;
}

.bf-event-btn-more-info {
    background: var(--bf-calendar-more-info-btn);
    color: white;
    border: none;
}
.bf-event-btn-more-info:hover {
    filter: brightness(1.1);
    color: white;
}

/* =====================
   TAXONOMIES (Categories & Tags)
   ===================== */
.bf-event-taxonomies {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 8px 0;
}

.bf-event-category {
    display: inline-block;
    padding: 2px 10px;
    background: #64748b;
    border-radius: 12px;
    font-size: 11px;
    color: white;
}

.bf-event-tag {
    display: inline-block;
    padding: 2px 10px;
    background: #f1f5f9;
    border-radius: 12px;
    font-size: 11px;
    color: var(--bf-calendar-text-muted);
    text-decoration: none;
}

/* =====================
   EVENTS LIST
   ===================== */
.bf-events-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bf-event-list-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 20px;
    background: var(--bf-calendar-bg);
    border-radius: var(--bf-calendar-border-radius);
    box-shadow: var(--bf-calendar-shadow);
    border-left: 4px solid var(--bf-calendar-secondary);
    transition: transform 0.2s ease;
}

.bf-event-list-item:hover {
    transform: translateX(4px);
}

.bf-event-list-item.bf-event-today {
    border-left-color: var(--bf-calendar-today, #fbbf24);
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.1) 0%, var(--bf-calendar-bg) 30%);
}

.bf-event-list-item.bf-event-today .bf-date-month {
    color: var(--bf-calendar-today, #fbbf24);
}

.bf-event-list-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 50px;
    text-align: center;
}

.bf-event-list-date .bf-date-month {
    font-size: 12px;
    color: var(--bf-calendar-secondary);
    font-weight: 600;
    text-transform: uppercase;
}

.bf-event-list-date .bf-date-day {
    font-size: 28px;
    font-weight: 700;
    color: var(--bf-calendar-text);
    line-height: 1;
}

.bf-event-list-content {
    flex: 1;
}

.bf-event-list-content .bf-event-title {
    margin: 0 0 4px;
    font-size: 16px;
}

.bf-event-list-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--bf-calendar-text-muted);
}

.bf-event-list-meta span::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--bf-calendar-text-muted);
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: middle;
}

.bf-event-list-meta span:first-child::before {
    display: none;
}

/* Two-line location in list view */
.bf-meta-location-block {
    display: flex;
    flex-direction: column;
}

.bf-event-list-meta .bf-meta-location-block::before {
    display: none;
}

.bf-meta-location-block span::before {
    display: none;
}

.bf-meta-location-block .bf-location-address {
    margin-left: 12px;
}

.bf-event-list-action {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .bf-event-list-item {
        flex-wrap: wrap;
    }

    .bf-event-list-content {
        width: calc(100% - 70px);
    }

    .bf-event-list-action {
        width: 100%;
        margin-top: 10px;
    }
}

/* =====================
   CALENDAR GRID
   ===================== */
.bf-calendar-wrapper {
    background: var(--bf-calendar-bg);
    border-radius: var(--bf-calendar-border-radius);
    box-shadow: var(--bf-calendar-shadow);
    overflow: hidden;
}

.bf-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: var(--bf-calendar-primary);
    color: var(--bf-header-text-color, white);
    border-radius: var(--bf-calendar-border-radius) var(--bf-calendar-border-radius) 0 0;
}

.bf-calendar-title {
    margin: 0;
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--bf-header-text-color, white);
}

.bf-calendar-nav {
    background: var(--bf-header-btn-bg, rgba(255, 255, 255, 0.15));
    border: none;
    color: var(--bf-header-text-color, white);
    width: 42px;
    height: 42px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.bf-calendar-nav:hover {
    background: var(--bf-header-btn-hover-bg, rgba(255, 255, 255, 0.25));
    transform: scale(1.05);
}

.bf-calendar-nav svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Calendar Grid */
.bf-calendar-grid {
    padding: 10px;
}

.bf-calendar-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.bf-calendar-row.bf-calendar-week {
    min-height: 130px;
}

.bf-calendar-days-header {
    border-bottom: 1px solid var(--bf-calendar-border);
    margin-bottom: 5px;
}

.bf-calendar-day-label {
    padding: 10px 5px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--bf-calendar-text-muted);
    text-transform: uppercase;
}

/* Calendar Days */
.bf-calendar-day {
    min-height: 120px;
    padding: 5px;
    border: 1px solid transparent;
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.bf-calendar-day:hover {
    background: #f8fafc;
}

.bf-calendar-day-other {
    opacity: 0.4;
}

.bf-calendar-day-today {
    background: rgba(251, 191, 36, 0.15);
    border: 2px solid var(--bf-calendar-today, #fbbf24);
}

.bf-calendar-day-number {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--bf-calendar-text);
    margin-bottom: 4px;
}

.bf-calendar-day-today .bf-calendar-day-number {
    color: var(--bf-calendar-today, #fbbf24);
    font-weight: 700;
}

/* Events in Calendar */
.bf-calendar-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bf-calendar-event-dot {
    display: block;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.3;
    text-decoration: none;
    color: white;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bf-calendar-event-dot:hover {
    filter: brightness(1.1);
}

.bf-calendar-event-title {
    display: block;
}

/* Past events - grayed out */
.bf-calendar-event-dot.bf-calendar-event-past {
    background-color: #d1d5db !important;
    opacity: 0.7;
}

/* More events indicator */
.bf-calendar-more {
    display: block;
    padding: 2px 6px;
    font-size: 11px;
    color: var(--bf-calendar-text-muted);
    cursor: pointer;
}

.bf-calendar-more:hover {
    color: var(--bf-calendar-primary);
}

/* Responsive Calendar */
@media (max-width: 768px) {
    .bf-calendar-day {
        min-height: 60px;
        padding: 3px;
    }

    .bf-calendar-day-number {
        font-size: 12px;
    }

    .bf-calendar-event-dot {
        font-size: 0;
        width: 8px;
        height: 8px;
        padding: 0;
        border-radius: 50%;
    }

    .bf-calendar-event-title {
        display: none;
    }

    .bf-calendar-day-events {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 3px;
    }
}

/* =====================
   LOADING STATES
   ===================== */
.bf-calendar-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.bf-calendar-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid var(--bf-calendar-border);
    border-top-color: var(--bf-calendar-primary);
    border-radius: 50%;
    animation: bf-spin 0.8s linear infinite;
}

@keyframes bf-spin {
    to { transform: rotate(360deg); }
}

/* =====================
   EVENT MODAL
   Using ID selector for maximum specificity over theme styles
   ===================== */
#bf-event-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#bf-event-modal.bf-modal-open {
    opacity: 1;
    visibility: visible;
}

#bf-event-modal .bf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

#bf-event-modal .bf-modal-container {
    position: relative;
    background: #fff !important;
    border-radius: 8px;
    max-width: 500px;
    width: calc(100% - 32px);
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

#bf-event-modal.bf-modal-open .bf-modal-container {
    transform: translateY(0);
}

/* Close button is now in the footer - see .bf-modal-footer styles below */

#bf-event-modal .bf-modal-content {
    overflow-y: auto;
    max-height: 85vh;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Ensure all modal children have proper box-sizing */
#bf-event-modal .bf-modal-container *,
#bf-event-modal .bf-modal-container *::before,
#bf-event-modal .bf-modal-container *::after {
    box-sizing: border-box !important;
}

.bf-modal-body-open {
    overflow: hidden;
}

/* Modal Loading */
#bf-event-modal .bf-modal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 150px;
    padding: 40px;
}

#bf-event-modal .bf-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: bf-spin 0.8s linear infinite;
}

#bf-event-modal .bf-modal-error {
    text-align: center;
    padding: 40px;
    color: #6b7280;
}

/* Modal Event Content */
#bf-event-modal .bf-modal-event {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    width: 100% !important;
}

#bf-event-modal .bf-modal-event-image {
    width: 100% !important;
    max-width: none !important;
    max-height: 250px;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
    box-sizing: border-box;
    float: none !important;
    position: relative;
}

#bf-event-modal .bf-modal-event-image img {
    width: 100% !important;
    max-width: none !important;
    height: 250px;
    object-fit: cover;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box;
    float: none !important;
}

/* Image expand icon overlay */
.bf-image-lightbox-trigger {
    position: relative;
    display: block;
    cursor: zoom-in;
    text-decoration: none;
}

.bf-image-expand-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.bf-image-expand-icon svg {
    display: block;
}

.bf-image-lightbox-trigger:hover .bf-image-expand-icon {
    opacity: 1;
}

/* Fullscreen image lightbox */
.bf-image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bf-image-lightbox.bf-lightbox-active {
    opacity: 1;
}

.bf-image-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 4px 40px rgba(0, 0, 0, 0.5);
}

.bf-image-lightbox-close {
    position: absolute;
    top: 16px;
    right: 20px;
    color: white;
    font-size: 32px;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
    z-index: 1;
}

.bf-image-lightbox-close:hover {
    opacity: 1;
}

#bf-event-modal .bf-modal-event-content {
    padding: 20px 24px 24px;
    background: transparent !important;
}

#bf-event-modal .bf-modal-event-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.3;
}

#bf-event-modal .bf-modal-event-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

#bf-event-modal .bf-modal-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #6b7280;
}

#bf-event-modal .bf-modal-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--event-color, #3b82f6);
    margin-top: 2px;
}

#bf-event-modal .bf-modal-location-link {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease;
}

#bf-event-modal .bf-modal-location-link:hover {
    color: var(--event-color, #3b82f6);
    text-decoration: underline;
}

#bf-event-modal .bf-modal-event-body {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 20px;
}

#bf-event-modal .bf-modal-event-body p {
    margin: 0 0 1em;
}

#bf-event-modal .bf-modal-event-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Modal Footer (close button + optional calendar export - all in one row) */
#bf-event-modal .bf-modal-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Make calendar export buttons flow inline with close button */
#bf-event-modal .bf-modal-footer .bf-calendar-export {
    display: contents;
}

#bf-event-modal .bf-modal-footer .bf-calendar-btn,
#bf-event-modal .bf-modal-footer button.bf-modal-close-footer {
    padding: 8px 28px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    color: #6b7280 !important;
    background: #f3f4f6 !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

#bf-event-modal .bf-modal-footer .bf-calendar-btn:hover,
#bf-event-modal .bf-modal-footer .bf-modal-close-footer:hover {
    background: #e5e7eb !important;
    color: #374151 !important;
}

/* =====================
   UTILITY CLASSES
   ===================== */
.bf-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* =====================
   LOAD MORE PAGINATION
   ===================== */
.bf-events-wrapper {
    position: relative;
}

.bf-events-load-more-wrapper {
    text-align: center;
    padding: 24px 0;
}

.bf-events-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 500;
    color: var(--bf-calendar-primary, #3b82f6);
    background: transparent;
    border: 2px solid var(--bf-calendar-primary, #3b82f6);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
}

.bf-events-load-more:hover {
    background: var(--bf-calendar-primary, #3b82f6);
    color: #fff;
}

.bf-events-load-more:disabled,
.bf-events-load-more.bf-loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.bf-events-load-more.bf-loading {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #6b7280;
}

/* =====================
   CALENDAR EXPORT BUTTONS
   ===================== */
.bf-calendar-export {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.bf-calendar-export-full {
    flex-wrap: wrap;
}

.bf-calendar-export-compact {
    margin-top: 0;
    margin-right: 8px;
}

.bf-calendar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.2s ease;
    line-height: 1;
}

.bf-calendar-btn:hover {
    background: #e5e7eb;
    color: #374151;
    text-decoration: none;
}

.bf-calendar-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Compact style (icons only) */
.bf-calendar-export-compact .bf-calendar-btn {
    padding: 6px;
}

.bf-calendar-export-compact .bf-calendar-btn span {
    display: none;
}

/* Google Calendar specific */
.bf-calendar-google:hover {
    background: #e8f0fe;
    border-color: #4285f4;
    color: #4285f4;
}

/* Outlook/iCal specific */
.bf-calendar-outlook:hover {
    background: #e1f0ff;
    border-color: #0078d4;
    color: #0078d4;
}

/* Single event page export buttons */
.bf-single-event-calendar-export {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.bf-single-event-calendar-export .bf-calendar-export {
    margin-top: 0;
}

.bf-single-event-calendar-export .bf-calendar-btn {
    padding: 8px 16px;
    font-size: 13px;
}

/* List view adjustments */
.bf-event-list-action {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bf-event-list-action .bf-calendar-export {
    margin: 0;
}

/* ==========================================================================
   Day Events Modal (Click on calendar day)
   ========================================================================== */

.bf-calendar-day-has-events {
    cursor: pointer;
}

.bf-calendar-day-has-events:hover {
    background: rgba(0, 0, 0, 0.02);
}

.bf-day-events-modal {
    padding: 0;
    width: 100%;
}

.bf-day-events-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.bf-day-events-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
}

.bf-day-events-count {
    font-size: 13px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 4px 10px;
    border-radius: 12px;
}

.bf-day-events-list {
    padding: 16px 24px;
    max-height: 400px;
    overflow-y: auto;
}

.bf-day-event-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    background: #f9fafb;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s ease;
}

.bf-day-event-item:last-child {
    margin-bottom: 0;
}

.bf-day-event-item:hover {
    background: #f3f4f6;
    text-decoration: none;
}

.bf-day-event-color {
    width: 4px;
    height: 100%;
    min-height: 36px;
    border-radius: 2px;
    flex-shrink: 0;
}

.bf-day-event-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bf-day-event-title {
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    line-height: 1.4;
}

.bf-day-event-time {
    font-size: 12px;
    color: #6b7280;
}

.bf-day-events-empty {
    padding: 40px 24px;
    text-align: center;
    color: #6b7280;
}

.bf-day-events-modal .bf-modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
}


/* =====================
   SINGLE EVENT PAGE
   ===================== */
.bf-single-event-wrapper {
    padding: 20px 0;
}

.bf-single-event {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

.bf-single-event-hero-wrapper {
    margin: 0 -20px 30px;
    max-width: calc(100% + 40px);
}

.bf-single-event-hero {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    object-position: center;
    display: block;
}

@media (min-width: 940px) {
    .bf-single-event-hero-wrapper {
        margin: 0 0 30px;
        max-width: 100%;
        border-radius: var(--bf-calendar-border-radius);
        overflow: hidden;
    }
}

.bf-single-event-body {
    padding: 0;
}

.bf-single-event-title {
    font-size: 2.25em;
    font-weight: 700;
    margin: 0 0 20px;
    line-height: 1.2;
    color: var(--bf-calendar-text);
}

.bf-single-event .bf-event-status {
    display: inline-block;
    margin-bottom: 15px;
}

/* Taxonomies above meta */
.bf-single-event .bf-event-taxonomies {
    margin-bottom: 20px;
}

/* Meta - clean stacked layout (no box) */
.bf-single-event-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--bf-calendar-border);
}

.bf-single-event-meta-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.bf-single-event-meta-icon {
    color: var(--bf-calendar-primary);
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}

.bf-single-event-meta-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.bf-single-event-meta-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--bf-calendar-text-muted);
}

.bf-single-event-meta-value {
    font-size: 15px;
    color: var(--bf-calendar-text);
    line-height: 1.5;
}

.bf-single-event-meta-value strong {
    font-weight: 600;
}

.bf-single-event-link {
    color: var(--bf-calendar-primary);
    text-decoration: none;
    font-weight: 500;
}

.bf-single-event-link:hover {
    text-decoration: underline;
}

/* Content */
.bf-single-event-content {
    font-size: 1.05em;
    line-height: 1.8;
    margin-bottom: 30px;
    color: var(--bf-calendar-text);
}

.bf-single-event-content p {
    margin: 0 0 1.5em;
}

.bf-single-event-content h2,
.bf-single-event-content h3,
.bf-single-event-content h4 {
    margin-top: 1.5em;
    margin-bottom: 0.75em;
}

.bf-single-event-content ul,
.bf-single-event-content ol {
    margin: 0 0 1.5em 1.5em;
}

.bf-single-event-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--bf-calendar-border-radius);
}

/* Taxonomies on single page */
.bf-single-event .bf-event-taxonomies {
    margin-bottom: 25px;
}

/* Actions */
.bf-single-event-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid var(--bf-calendar-border);
    margin-top: 10px;
}

.bf-single-event-actions .bf-event-btn {
    padding: 12px 28px;
    font-size: 15px;
}

.bf-single-event-export {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.bf-single-event-export-label {
    font-size: 14px;
    color: var(--bf-calendar-text-muted);
    font-weight: 500;
}

.bf-single-event-export .bf-calendar-export {
    margin-top: 0;
}

/* Calendar export on existing single pages (theme template) */
.bf-single-event-calendar-export {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--bf-calendar-border);
}

/* Mobile adjustments */
@media (max-width: 640px) {
    .bf-single-event-wrapper {
        padding: 15px 0;
    }

    .bf-single-event {
        padding: 0 15px 40px;
    }

    .bf-single-event-hero {
        max-height: 250px;
    }

    .bf-single-event-title {
        font-size: 1.75em;
    }

    .bf-single-event-meta {
        gap: 10px;
    }

    .bf-single-event-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .bf-single-event-actions .bf-event-btn {
        text-align: center;
        justify-content: center;
    }

    .bf-single-event-export {
        justify-content: center;
    }
}

/* ============================================
   Multi-Day Event Badge — Integrated End Date
   ============================================ */

/* End date row inside badge (shared base) */
.bf-date-end-row {
    display: block;
    font-size: 10px;
    font-weight: 600;
    opacity: 0.85;
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    white-space: nowrap;
}

/* Card badge with color-header uses inverted (white badge, dark text) */
.bf-event-card-header + .bf-event-card-content .bf-date-end-row {
    border-top-color: rgba(0, 0, 0, 0.1);
}

/* Tile view — inherits white text from tile */
.bf-event-tile-date .bf-date-end-row {
    font-size: 0.65em;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 2px;
    padding-top: 2px;
}

/* List view — uses event color text */
.bf-event-list-date .bf-date-end-row {
    font-size: 11px;
    color: var(--event-color, var(--bf-calendar-primary));
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 2px;
    padding-top: 2px;
}
