/* Enhanced Events Calendar Styles */

.sec-calendar {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sec-calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.sec-calendar-header h2 {
    margin: 0;
    font-size: 28px;
}

.sec-calendar-nav {
    display: flex;
    gap: 10px;
}

.sec-btn {
    padding: 8px 16px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 14px;
    transition: background 0.2s;
}

.sec-btn:hover {
    background: #005177;
    color: #fff;
}

.sec-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    background: #ddd;
    border: 1px solid #ddd;
    position: relative;
    isolation: isolate;
}

.sec-day-header {
    background: #f5f5f5;
    padding: 10px 5px;
    text-align: center;
    font-weight: bold;
    font-size: 13px;
    text-transform: capitalize;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.sec-day-header:last-of-type {
    border-right: none;
}

.sec-day-cell {
    background: #fff;
    position: relative;
    height: 120px;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
    padding: 5px;
    box-sizing: border-box;
    min-width: 0;
}

.sec-day-cell:nth-child(7n) {
    border-right: none;
}

.sec-day-cell.other-month {
    background: #f9f9f9;
    color: #999;
}

.sec-day-number {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
    position: relative;
    z-index: 2;
}

.sec-day-events {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
    overflow: hidden;
}

.sec-event {
    background: #0073aa;
    color: #fff;
    padding: 3px 6px;
    margin: 0;
    font-size: 12px;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: background 0.2s;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
}

.sec-event:hover {
    background: #005177;
    color: #fff;
    z-index: 100;
}

/* Multi-day events - spans across cells */
.sec-event.multi-day {
    position: absolute;
    top: 30px;
    left: -5px;
    height: 24px;
    padding: 3px 6px;
    line-height: 18px;
    z-index: 10;
    white-space: nowrap;
}

.sec-event.multi-day.event-start {
    border-radius: 3px 0 0 3px;
    padding-left: 6px;
}

.sec-event.multi-day.event-middle {
    border-radius: 0;
    color: transparent;
}

.sec-event.multi-day.event-end {
    border-radius: 0 3px 3px 0;
    color: transparent;
}

.sec-event.multi-day.event-start.event-end {
    border-radius: 3px;
}

/* Events List Styles - Matching Arquidiocese Website Design */

/* Reset and wrapper */
.sec-events-list {
    max-width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
}

.sec-events-list * {
    box-sizing: border-box;
}

/* Main list item - horizontal layout */
.sec-event-list-item {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 15px;
    padding: 0 !important;
    border-bottom: none !important;
    align-items: flex-start;
    list-style: none !important;
    margin: 0 0 1em 0 !important;
    clear: both;
    line-height: 1 !important;
}

.sec-event-list-item::before,
.sec-event-list-item::after {
    content: none !important;
}

.sec-event-list-item:last-child {
    border-bottom: none;
}

/* Date badge - fixed width, stay on left */
.sec-event-date-badge {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    width: auto !important;
    height: auto !important;
    min-width: unset !important;
    max-width: 30px !important;
    max-height: 30px !important;
    background: none !important;
    color: #5a7184 !important;
    text-align: center;
    border-radius: 0;
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-start;
    align-items: center;
    font-weight: bold;
    padding: 0 !important;
    margin: 0 !important;
}

.sec-badge-month {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 !important;
    padding: 0;
    display: block;
    line-height: 1;
    color: #5a7184 !important;
}

.sec-badge-day {
    font-size: 24px;
    line-height: 1;
    font-weight: 700;
    display: block;
    margin: 0 !important;
    padding: 0;
    color: #5a7184 !important;
}

/* Event content - flexible, takes remaining space */
.sec-event-content {
    flex: 1 1 auto !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
}

.sec-event-time-label {
    font-size: 13px;
    color: #666;
    margin: 0 !important;
    padding: 0;
    display: block;
    line-height: 1;
}

.sec-event-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 !important;
    padding: 0;
    line-height: 1.4;
}

.sec-event-title a {
    color: #333 !important;
    text-decoration: none;
    transition: color 0.2s;
    display: inline;
}

.sec-event-title a:hover {
    color: #5a7184 !important;
}

/* Calendar link at bottom */
.sec-view-calendar-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
    clear: both;
}

.sec-calendar-link {
    display: inline-block;
    padding: 10px 24px;
    background: #5a7184 !important;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s;
    border: none;
}

.sec-calendar-link:hover {
    background: #4a5f70 !important;
    color: white !important;
}

.sec-no-events {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.sec-loading {
    text-align: center;
    padding: 40px;
}

/* Tooltip */
.sec-event-tooltip {
    position: fixed;
    background: #333;
    color: #fff;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    min-width: 200px;
    max-width: 320px;
    z-index: 9999;
    pointer-events: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
}

.sec-event-tooltip.visible {
    opacity: 1;
    visibility: visible;
}

.sec-event-tooltip-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #fff;
}

.sec-event-tooltip-time,
.sec-event-tooltip-location {
    font-size: 12px;
    margin: 4px 0;
    color: rgba(255,255,255,0.9);
}

/* Responsive Design */

@media (max-width: 768px) {
    .sec-calendar {
        padding: 10px;
    }
    
    .sec-calendar-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .sec-calendar-header h2 {
        font-size: 22px;
    }
    
    .sec-calendar-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .sec-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .sec-day-header {
        font-size: 11px;
        padding: 8px 2px;
    }
    
    .sec-day-cell {
        height: 50px;
        padding: 3px;
        position: relative;
    }
    
    .sec-day-number {
        font-size: 12px;
    }
    
    /* Hide events on mobile - show dots instead */
    .sec-day-events,
    .sec-event {
        display: none !important;
    }
    
    /* Keep multi-day events visible as bars on mobile - position just below day number */
    .sec-event-multiday {
        display: block !important;
        font-size: 8px !important;
        height: 12px !important;
        line-height: 12px !important;
        padding: 0 3px !important;
        top: 18px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        pointer-events: none !important;
        cursor: default !important;
    }
    
    /* Mobile dot indicator */
    .sec-mobile-dot {
        position: absolute;
        bottom: 4px;
        left: 50%;
        transform: translateX(-50%);
        width: 5px;
        height: 5px;
        background: #5a7184;
        border-radius: 50%;
    }
    
    /* Selected day highlight */
    .sec-day-cell.sec-selected-day {
        background: #e8f0f7 !important;
        border: 2px solid #5a7184 !important;
    }
    
    /* Mobile events list */
    .sec-mobile-events {
        margin-top: 20px;
        background: white;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        overflow: hidden;
    }
    
    .sec-mobile-events-header {
        background: #5a7184;
        color: white;
        padding: 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .sec-mobile-events-header h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
    }
    
    .sec-mobile-close {
        background: none;
        border: none;
        color: white;
        font-size: 28px;
        line-height: 1;
        cursor: pointer;
        padding: 0;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .sec-mobile-events-list {
        padding: 10px;
    }
    
    .sec-mobile-event-item {
        padding: 12px;
        border-bottom: 1px solid #eee;
        background: white;
    }
    
    .sec-mobile-event-item:last-child {
        border-bottom: none;
    }
    
    .sec-mobile-event-link {
        text-decoration: none;
        color: inherit;
        display: block;
    }
    
    .sec-mobile-event-title {
        font-size: 16px;
        font-weight: 600;
        color: #333;
        margin-bottom: 5px;
    }
    
    .sec-mobile-event-meta {
        font-size: 14px;
        color: #666;
        margin-top: 3px;
    }
    
    /* List responsive */
    .sec-event-list-item {
        gap: 15px;
        padding: 12px 0;
    }
    
    .sec-event-date-badge {
        max-width: 25px;
        max-height: 25px;
    }
    
    .sec-badge-month {
        font-size: 8px;
    }
    
    .sec-badge-day {
        font-size: 16px;
    }
    
    .sec-event-title {
        font-size: 16px;
    }
    
    .sec-event-time-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .sec-day-header {
        font-size: 9px;
        padding: 6px 1px;
    }
    
    .sec-day-cell {
        height: 70px;
        padding: 2px;
    }
    
    .sec-day-number {
        font-size: 10px;
    }
    
    .sec-event {
        font-size: 9px;
        padding: 2px 3px;
    }
    
    /* List responsive */
    .sec-event-list-item {
        gap: 12px;
        padding: 10px 0;
    }
    
    .sec-event-date-badge {
        width: 45px;
        height: 45px;
    }
    
    .sec-badge-month {
        font-size: 9px;
    }
    
    .sec-badge-day {
        font-size: 18px;
    }
    
    .sec-event-title {
        font-size: 15px;
    }
    
    .sec-event-time-label {
        font-size: 11px;
    }
    
    .sec-calendar-link {
        padding: 8px 20px;
        font-size: 13px;
    }
}