/**
 * WPHelp Events - Calendar Styles (Build)
 */

/* ==================== Container ==================== */
.whe-calendar-wrap {
    font-family: var(--whe-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    max-width: 100%;
}

#whe-calendar {
    font-family: inherit;
    font-size: var(--whe-cal-font-size, 14px);
    transition: opacity 0.3s ease;
    background: #fff;
    border-radius: var(--whe-cal-radius, 10px);
    overflow: hidden;
    box-shadow: var(--whe-cal-shadow, 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.05));
    border: 1px solid var(--whe-cal-border, #e5e7eb);
}

/* Loading spinner */
.whe-calendar__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--whe-text-light, #6b7280);
    font-size: 15px;
}

.whe-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--whe-primary, #2563eb);
    border-radius: 50%;
    animation: whe-spin 0.7s linear infinite;
}

@keyframes whe-spin {
    to { transform: rotate(360deg); }
}

/* ==================== Toolbar (Month Title + Nav) ==================== */
#whe-calendar .fc-toolbar.fc-header-toolbar {
    background: var(--whe-cal-header-bg, #1e40af) !important;
    padding: 16px 20px !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
}

#whe-calendar .fc-toolbar-title {
    color: var(--whe-cal-header-text, #ffffff) !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    line-height: 1.3 !important;
}

#whe-calendar .fc-toolbar-chunk {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

/* Nav buttons */
#whe-calendar .fc-button {
    background: rgba(255,255,255,0.2) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.3) !important;
    border-radius: var(--whe-cal-nav-radius, 6px) !important;
    padding: 7px 14px !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    text-transform: capitalize !important;
    transition: all 0.2s ease !important;
    box-shadow: none !important;
    cursor: pointer !important;
    line-height: 1.4 !important;
}

#whe-calendar .fc-button:hover {
    background: rgba(255,255,255,0.35) !important;
}

#whe-calendar .fc-button-active,
#whe-calendar .fc-button:active {
    background: rgba(255,255,255,0.4) !important;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15) !important;
}

#whe-calendar .fc-button-group {
    display: flex !important;
    gap: 2px !important;
}

#whe-calendar .fc-button-group .fc-button {
    margin: 0 !important;
}

/* Prev/Next arrow buttons */
#whe-calendar .fc-prev-button,
#whe-calendar .fc-next-button {
    padding: 7px 10px !important;
    min-width: 36px !important;
}

/* ==================== Day Headers ==================== */
#whe-calendar .fc-col-header {
    background: var(--whe-cal-day-header-bg, #f8fafc) !important;
}

#whe-calendar .fc-col-header-cell {
    background: transparent !important;
    padding: 12px 0 !important;
    border-color: var(--whe-cal-border, #e5e7eb) !important;
}

#whe-calendar .fc-col-header-cell-cushion {
    color: var(--whe-cal-day-header-text, #475569) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    letter-spacing: 0.8px !important;
}

/* ==================== Day Cells ==================== */
#whe-calendar .fc-daygrid-day {
    min-height: var(--whe-cal-cell-height, 110px) !important;
    border-color: var(--whe-cal-border, #e5e7eb) !important;
    transition: background 0.15s !important;
}

#whe-calendar .fc-daygrid-day:hover {
    background: #f8fafc !important;
}

#whe-calendar .fc-daygrid-day-number {
    color: var(--whe-text, #334155) !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    padding: 8px 10px !important;
    text-decoration: none !important;
}

/* Today highlight */
#whe-calendar .fc-day-today {
    background: var(--whe-cal-today-bg, #eff6ff) !important;
}

#whe-calendar .fc-day-today .fc-daygrid-day-number {
    color: var(--whe-primary, #2563eb) !important;
    font-weight: 700 !important;
    background: var(--whe-primary, #2563eb) !important;
    color: #fff !important;
    border-radius: 50% !important;
    width: 28px !important;
    height: 28px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 6px !important;
    font-size: 13px !important;
}

/* ==================== Events in Month View ==================== */
#whe-calendar .fc-event,
#whe-calendar .fc-daygrid-event {
    display: block !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease !important;
    border: none !important;
    margin: 2px 4px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    overflow: hidden !important;
}

#whe-calendar .fc-event:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(0,0,0,0.18) !important;
    z-index: 10 !important;
}

/* Hide FullCalendar's dot indicator for timed events */
#whe-calendar .fc-daygrid-event-dot {
    display: none !important;
}

/* Force dot-style timed events to render as blocks */
#whe-calendar .fc-daygrid-dot-event {
    display: flex !important;
    align-items: center !important;
    background: var(--whe-cal-event-bg, #2563eb) !important;
    color: var(--whe-cal-event-text, #ffffff) !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    margin: 2px 4px !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
}

#whe-calendar .fc-daygrid-dot-event .fc-event-title {
    color: #fff !important;
    font-weight: 600 !important;
}

#whe-calendar .fc-daygrid-dot-event:hover {
    background: var(--whe-cal-hover-bg, #1d4ed8) !important;
}

/* Event time */
#whe-calendar .fc-event-time {
    font-size: 11px !important;
    font-weight: 700 !important;
    opacity: 0.9 !important;
    margin-right: 4px !important;
    flex-shrink: 0 !important;
}

#whe-calendar .fc-event-title {
    font-weight: 600 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    font-size: 12px !important;
}

#whe-calendar .fc-event-main {
    padding: 1px 0 !important;
    color: inherit !important;
}

/* +more link */
#whe-calendar .fc-daygrid-more-link {
    color: var(--whe-primary, #2563eb) !important;
    font-weight: 600 !important;
    font-size: 12px !important;
    padding: 2px 4px !important;
}

/* ==================== Time Grid View ==================== */
#whe-calendar .fc-timegrid-slot {
    border-color: var(--whe-cal-border, #e5e7eb) !important;
    height: 48px !important;
}

#whe-calendar .fc-timegrid-axis-cushion {
    color: var(--whe-text-light, #64748b) !important;
    font-size: 12px !important;
}

#whe-calendar .fc-timegrid-event {
    border-radius: 6px !important;
    border: none !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
}

/* ==================== List View ==================== */
#whe-calendar .fc-list {
    border-color: var(--whe-cal-border, #e5e7eb) !important;
}

#whe-calendar .fc-list-day-cushion {
    background: var(--whe-cal-day-header-bg, #f8fafc) !important;
    padding: 10px 14px !important;
}

#whe-calendar .fc-list-day-text,
#whe-calendar .fc-list-day-side-text {
    color: var(--whe-text, #334155) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

#whe-calendar .fc-list-event:hover td {
    background: #f1f5f9 !important;
    cursor: pointer !important;
}

#whe-calendar .fc-list-event-title a {
    color: var(--whe-text, #1e293b) !important;
    text-decoration: none !important;
    font-weight: 500 !important;
}

#whe-calendar .fc-list-event-dot {
    border-color: var(--whe-cal-event-bg, #2563eb) !important;
}

/* ==================== "More" Popover ==================== */
#whe-calendar .fc-popover {
    border-radius: var(--whe-radius, 10px) !important;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15) !important;
    border: 1px solid var(--whe-cal-border, #e5e7eb) !important;
    overflow: hidden !important;
}

#whe-calendar .fc-popover-header {
    background: var(--whe-cal-day-header-bg, #f8fafc) !important;
    padding: 10px 14px !important;
    font-weight: 600 !important;
}

/* ==================== Filter Bar ==================== */
.whe-calendar-filters {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.whe-calendar-filters select,
.whe-calendar-filters input[type="search"] {
    padding: 9px 14px;
    border: 1px solid #d1d5db;
    border-radius: var(--whe-btn-radius, 8px);
    font-size: 14px;
    background: #fff;
    color: var(--whe-text, #1e293b);
    min-width: 160px;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
    -webkit-appearance: none;
}

.whe-calendar-filters select:focus,
.whe-calendar-filters input[type="search"]:focus {
    outline: none;
    border-color: var(--whe-primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* ==================== Event Modal ==================== */
.whe-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: whe-fadeIn 0.2s ease;
}

.whe-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.whe-modal__dialog {
    position: relative;
    background: #fff;
    border-radius: 16px;
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: whe-slideUp 0.3s ease;
}

.whe-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: #374151;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.whe-modal__close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.whe-modal__body img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

@keyframes whe-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes whe-slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==================== Responsive ==================== */
@media (max-width: 768px) {
    #whe-calendar .fc-toolbar.fc-header-toolbar {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 14px !important;
        text-align: center !important;
    }

    #whe-calendar .fc-toolbar-chunk {
        justify-content: center !important;
    }

    #whe-calendar .fc-toolbar-title {
        font-size: 18px !important;
    }

    #whe-calendar .fc-button {
        padding: 6px 10px !important;
        font-size: 12px !important;
    }

    .whe-calendar-filters {
        flex-direction: column;
    }

    .whe-calendar-filters select,
    .whe-calendar-filters input[type="search"] {
        width: 100%;
    }

    .whe-modal__dialog {
        width: 95%;
        max-height: 90vh;
        border-radius: 12px;
    }
}
