/**
 * 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-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-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    background: #e0e0e0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.cxq-calendar-day {
    background: #fff;
    padding: 10px;
    min-height: 100px;
    font-size: 14px;
}

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

.cxq-calendar-event {
    padding: 3px 6px;
    margin-top: 3px;
    background: #667eea;
    color: #fff;
    font-size: 11px;
    border-radius: 3px;
    cursor: pointer;
}

/* Single Event / Next Event Display */
.cxq-single-event,
.cxq-next-event {
    margin: 20px 0;
}

.cxq-event-detail {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cxq-event-detail .cxq-event-image {
    width: 100%;
    height: auto;
    max-height: 400px;
}

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

.cxq-event-detail .cxq-event-content {
    padding: 30px;
}

.cxq-event-detail .cxq-event-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #222;
}

.cxq-event-detail .cxq-event-meta {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 16px;
}

.cxq-event-detail .cxq-event-meta > div {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cxq-event-detail .cxq-event-meta .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
    color: #667eea;
    flex-shrink: 0;
}

.cxq-event-detail .cxq-event-meta strong {
    min-width: 80px;
    color: #333;
}

.cxq-event-detail .cxq-event-description {
    font-size: 16px;
    line-height: 1.8;
    color: #444;
}

.cxq-event-detail .cxq-event-description p {
    margin-bottom: 15px;
}

.cxq-next-event .cxq-event-detail {
    border-left: 4px solid #667eea;
}

/* Event Error Messages */
.cxq-event-error {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    color: #856404;
    font-size: 14px;
}

/* 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;
    }
}

/* Clickable Links */
.cxq-event-title-link {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.cxq-event-title-link:hover {
    color: #667eea;
    text-decoration: none;
}

.cxq-event-location-link {
    color: #666;
    text-decoration: none;
    border-bottom: 1px dotted #999;
    transition: all 0.2s ease;
}

.cxq-event-location-link:hover {
    color: #667eea;
    border-bottom-color: #667eea;
    text-decoration: none;
}

/* Event Modal */
.cxq-event-dialog .ui-dialog-titlebar {
    display: none;
}

.cxq-event-modal-content {
    padding: 0;
    position: relative;
}

/* Custom close button */
.cxq-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: 300;
}

.cxq-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.cxq-modal-close:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.cxq-event-modal-image {
    width: 100%;
    max-height: 300px;
    overflow: hidden;
    background: #f5f5f5;
    margin-bottom: 20px;
}

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

.cxq-event-modal-content h2 {
    margin: 0 0 20px 0;
    padding: 0 20px;
    font-size: 28px;
    font-weight: 700;
    color: #222;
}

.cxq-event-modal-meta {
    padding: 0 20px 20px;
    border-bottom: 1px solid #e0e0e0;
}

.cxq-event-modal-meta p {
    margin: 10px 0;
    font-size: 15px;
    line-height: 1.6;
}

.cxq-event-modal-meta strong {
    color: #333;
    font-weight: 600;
    min-width: 80px;
    display: inline-block;
}

.cxq-event-modal-meta a {
    color: #667eea;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s ease;
}

.cxq-event-modal-meta a:hover {
    border-bottom-color: #667eea;
}

.cxq-event-modal-description {
    padding: 20px;
}

.cxq-event-modal-description h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.cxq-event-modal-description p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 15px;
}

/* Dialog overrides */
.cxq-event-dialog .ui-dialog-content {
    padding: 0 !important;
    overflow-y: auto;
    max-height: 70vh;
}

.cxq-event-dialog .ui-widget-header {
    background: #fff;
    border: none;
    border-bottom: 1px solid #e0e0e0;
}

.cxq-event-dialog .ui-dialog-buttonpane {
    display: none;
}

/* 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-title-link {
        color: #fff;
    }

    .cxq-event-title-link:hover {
        color: #8b9cff;
    }

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

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

    .cxq-event-modal-content {
        background: #1e1e1e;
        color: #e0e0e0;
    }

    .cxq-event-modal-content h2,
    .cxq-event-modal-description h3 {
        color: #fff;
    }

    .cxq-event-modal-meta {
        border-bottom-color: #333;
    }

    .cxq-event-modal-description p {
        color: #b0b0b0;
    }
}
