/**
 * Public Styles for CxQ Event Calendar
 */

/* Event List Layout */
.cxq-event-list {
    margin: 20px 0;
}

.cxq-event-list-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    margin-bottom: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: box-shadow 0.3s ease;
}

.cxq-event-list-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cxq-event-trigger {
    cursor: pointer;
}

.cxq-event-list-wrap {
    position: relative;
}

.cxq-event-date-box {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    text-align: center;
}

.cxq-event-month {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.cxq-event-day {
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
}

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

.cxq-event-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.cxq-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.cxq-event-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.cxq-event-meta .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.cxq-event-description {
    color: #555;
    line-height: 1.6;
}

.cxq-event-source {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Grid Layout */
.cxq-event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cxq-event-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cxq-event-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
}

.cxq-event-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
}

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

.cxq-event-content {
    padding: 20px;
}

.cxq-event-card .cxq-event-title {
    font-size: 20px;
    margin: 0 0 10px 0;
}

.cxq-event-card .cxq-event-meta {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.cxq-event-excerpt {
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Featured Events */
.cxq-featured-events {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cxq-featured-events .cxq-event-card {
    border: 2px solid #667eea;
}

/* Calendar View */
.cxq-event-calendar {
    margin: 20px 0;
}

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

.cxq-calendar-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.cxq-calendar-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #333;
    text-decoration: none;
    font-size: 22px;
    line-height: 1;
    transition: background 0.2s;
}

.cxq-calendar-nav:hover {
    background: #667eea;
    color: #fff;
    text-decoration: none;
}

.cxq-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.cxq-calendar-weekday {
    background: #667eea;
    color: #fff;
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cxq-calendar-day {
    background: #fff;
    padding: 8px;
    min-height: 90px;
    font-size: 13px;
    vertical-align: top;
}

.cxq-calendar-day.other-month {
    background: #f9f9f9;
    color: #999;
}

.cxq-calendar-day.today {
    background: #fffbf0;
}

.cxq-calendar-day.today .cxq-cal-day-num {
    background: #667eea;
    color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.cxq-cal-day-num {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
    font-size: 13px;
}

.cxq-calendar-event {
    display: block;
    padding: 2px 5px;
    margin-top: 2px;
    background: #667eea;
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: opacity 0.15s;
    border: none;
    width: 100%;
    text-align: left;
}

.cxq-calendar-event:hover,
.cxq-calendar-event:focus {
    opacity: 0.85;
    outline: 2px solid #333;
    outline-offset: 1px;
}

.cxq-cal-source-google {
    background: #4285f4;
}

.cxq-cal-source-facebook {
    background: #1877f2;
}

/* Calendar popup */
.cxq-cal-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.25);
    padding: 24px 28px 20px;
    min-width: 280px;
    max-width: 420px;
    width: 90%;
}

.cxq-cal-popup[hidden] {
    display: none;
}

.cxq-cal-popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 99998;
}

.cxq-cal-popup-backdrop[hidden] {
    display: none;
}

.cxq-cal-popup-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #888;
    line-height: 1;
    padding: 0;
}

.cxq-cal-popup-close:hover {
    color: #333;
}

.cxq-cal-popup-title {
    margin: 0 0 10px;
    font-size: 17px;
    font-weight: 600;
    color: #222;
    padding-right: 20px;
}

.cxq-cal-popup-time,
.cxq-cal-popup-location,
.cxq-cal-popup-description {
    margin: 4px 0;
    font-size: 14px;
    color: #555;
}

.cxq-cal-popup-time:empty,
.cxq-cal-popup-location:empty,
.cxq-cal-popup-description:empty {
    display: none;
}

/* No Events Message */
.cxq-no-events {
    padding: 40px;
    text-align: center;
    color: #999;
    font-size: 16px;
    background: #f9f9f9;
    border-radius: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cxq-event-list-item {
        flex-direction: column;
        gap: 15px;
    }

    .cxq-event-date-box {
        width: 100%;
        height: 60px;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
    }

    .cxq-event-day {
        font-size: 24px;
    }

    .cxq-event-grid {
        grid-template-columns: 1fr;
    }

    .cxq-event-meta {
        flex-direction: column;
        gap: 8px;
    }

    .cxq-calendar-grid {
        font-size: 12px;
    }

    .cxq-calendar-day {
        min-height: 80px;
        padding: 5px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .cxq-event-list-item,
    .cxq-event-card,
    .cxq-calendar-day {
        background: #1e1e1e;
        border-color: #333;
        color: #e0e0e0;
    }

    .cxq-event-title {
        color: #fff;
    }

    .cxq-event-description,
    .cxq-event-meta {
        color: #b0b0b0;
    }

    .cxq-no-events {
        background: #2a2a2a;
        color: #999;
    }
}
