/* ============================================
   Event Calendar Widget - Base Styles
   ============================================ */

.unlockafe-event-calendar-wrapper {
    width: 100%;
    box-sizing: border-box;
}

.unlockafe-event-calendar {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

/* Calendar Header */
.unlockafe-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    background-color: #0073aa;
    color: #ffffff;
    box-sizing: border-box;
}

.unlockafe-calendar-month-year {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.unlockafe-calendar-month {
    font-size: 24px;
    font-weight: 600;
    text-transform: capitalize;
}

.unlockafe-calendar-year {
    font-size: 16px;
    opacity: 0.9;
}

.unlockafe-calendar-nav {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 16px;
}

.unlockafe-calendar-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.unlockafe-calendar-nav:active {
    transform: scale(0.95);
}

/* Weekday Headers */
.unlockafe-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.unlockafe-calendar-weekdays .weekday {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Calendar Days Grid */
.unlockafe-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background-color: #e0e0e0;
    min-height: 400px;
}

/* Show loading state if calendar not initialized */
.unlockafe-calendar-days:empty::before {
    content: 'Loading calendar...';
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #999;
    grid-column: 1 / -1;
}

.unlockafe-calendar-day {
    min-height: 80px;
    padding: 8px;
    background-color: #ffffff;
    color: #333333;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-sizing: border-box;
}

.unlockafe-calendar-day:hover {
    background-color: #f0f0f0;
    z-index: 1;
}

.unlockafe-calendar-day.other-month {
    color: #cccccc;
    background-color: #fafafa;
}

.unlockafe-calendar-day.today {
    background-color: #0073aa;
    color: #ffffff;
    font-weight: 600;
}

.unlockafe-calendar-day.today.has-event {
    background-color: #005a87;
}

.unlockafe-calendar-day.has-event {
    background-color: #e8f4f8;
}

.unlockafe-calendar-day.has-event.today {
    background-color: #005a87;
}

.unlockafe-calendar-day-number {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.unlockafe-calendar-day-events {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    width: 100%;
    margin-top: auto;
}

.unlockafe-calendar-event-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #0073aa;
    flex-shrink: 0;
}

/* Event List */
.unlockafe-event-list {
    margin-top: 30px;
    background: #ffffff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.unlockafe-event-list-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    color: #333333;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.unlockafe-event-list-items {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.unlockafe-event-item {
    padding: 15px;
    border-left: 4px solid #0073aa;
    background-color: #f9f9f9;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.unlockafe-event-item:hover {
    background-color: #f0f0f0;
    transform: translateX(5px);
}

.unlockafe-event-item-date {
    font-size: 12px;
    color: #666666;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.unlockafe-event-item-title {
    font-size: 18px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 8px 0;
}

.unlockafe-event-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #666666;
    margin-top: 8px;
}

.unlockafe-event-item-time,
.unlockafe-event-item-location {
    display: flex;
    align-items: center;
    gap: 5px;
}

.unlockafe-event-item-time i,
.unlockafe-event-item-location i {
    font-size: 12px;
}

.unlockafe-event-item-description {
    font-size: 14px;
    color: #555555;
    line-height: 1.6;
    margin-top: 8px;
}

/* Empty State */
.unlockafe-event-list-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999999;
}

.unlockafe-event-list-empty i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

/* Event Popup Modal */
.unlockafe-event-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
}

.unlockafe-event-popup-overlay.active {
    display: flex;
}

.unlockafe-event-popup {
    background: #ffffff;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: unlockafePopupSlideIn 0.3s ease-out;
    box-sizing: border-box;
}

@keyframes unlockafePopupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.unlockafe-event-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f5f5f5;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333333;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10;
    box-sizing: border-box;
}

.unlockafe-event-popup-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.unlockafe-event-popup-header {
    padding: 25px 25px 20px 25px;
    border-bottom: 2px solid #f0f0f0;
    box-sizing: border-box;
}

.unlockafe-event-popup-date {
    font-size: 22px;
    font-weight: 600;
    color: #333333;
    margin: 0;
    padding-right: 40px;
}

.unlockafe-event-popup-content {
    padding: 20px 25px 25px 25px;
    box-sizing: border-box;
}

.unlockafe-event-popup-item {
    padding: 20px;
    border-left: 4px solid #0073aa;
    background-color: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.unlockafe-event-popup-item:last-child {
    margin-bottom: 0;
}

.unlockafe-event-popup-item:hover {
    background-color: #f0f0f0;
    transform: translateX(5px);
}

.unlockafe-event-popup-item-title {
    font-size: 20px;
    font-weight: 600;
    color: #333333;
    margin: 0 0 12px 0;
}

.unlockafe-event-popup-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 14px;
    color: #666666;
    margin-bottom: 12px;
}

.unlockafe-event-popup-item-meta .unlockafe-event-item-time,
.unlockafe-event-popup-item-meta .unlockafe-event-item-location {
    display: flex;
    align-items: center;
    gap: 5px;
}

.unlockafe-event-popup-item-meta i {
    font-size: 12px;
}

.unlockafe-event-popup-item .unlockafe-event-item-description {
    font-size: 14px;
    color: #555555;
    line-height: 1.6;
    margin-top: 8px;
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 768px) {
    .unlockafe-calendar-header {
        padding: 15px;
    }

    .unlockafe-calendar-month {
        font-size: 20px;
    }

    .unlockafe-calendar-year {
        font-size: 14px;
    }

    .unlockafe-calendar-nav {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }

    .unlockafe-calendar-weekdays .weekday {
        padding: 10px 4px;
        font-size: 12px;
    }

    .unlockafe-calendar-day {
        min-height: 60px;
        padding: 6px;
    }

    .unlockafe-calendar-day-number {
        font-size: 14px;
    }

    .unlockafe-calendar-event-dot {
        width: 5px;
        height: 5px;
    }

    .unlockafe-event-list {
        padding: 15px;
    }

    .unlockafe-event-item-title {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .unlockafe-calendar-day {
        min-height: 50px;
        padding: 4px;
    }

    .unlockafe-calendar-day-number {
        font-size: 12px;
    }

    .unlockafe-calendar-weekdays .weekday {
        padding: 8px 2px;
        font-size: 11px;
    }

    .unlockafe-calendar-event-dot {
        width: 4px;
        height: 4px;
    }
    
    .unlockafe-event-popup {
        max-width: 95%;
        max-height: 90vh;
    }
    
    .unlockafe-event-popup-header {
        padding: 20px 20px 15px 20px;
    }
    
    .unlockafe-event-popup-date {
        font-size: 18px;
        padding-right: 35px;
    }
    
    .unlockafe-event-popup-content {
        padding: 15px 20px 20px 20px;
    }
    
    .unlockafe-event-popup-item {
        padding: 15px;
    }
    
    .unlockafe-event-popup-item-title {
        font-size: 18px;
    }
}

