/**
 * FB Events Sync - Frontend Styles
 *
 * Styles for the [fb_events] shortcode output.
 * Designed to work well with most WordPress themes.
 *
 * @package FB_Events_Sync
 */

/* =========================================================================
   Reset & Container
   ========================================================================= */

.fbes-events-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: inherit;
    box-sizing: border-box;
}

.fbes-events-wrap *,
.fbes-events-wrap *::before,
.fbes-events-wrap *::after {
    box-sizing: border-box;
}

/* =========================================================================
   Error / Notice Messages
   ========================================================================= */

.fbes-error {
    background: #fef2f2;
    border-left: 4px solid #dc2626;
    padding: 12px 16px;
    margin: 20px 0;
    border-radius: 4px;
    color: #991b1b;
}

.fbes-notice {
    background: #fefce8;
    border-left: 4px solid #ca8a04;
    padding: 12px 16px;
    margin: 20px 0;
    border-radius: 4px;
    color: #854d0e;
}

/* =========================================================================
   Grid Layout
   ========================================================================= */

.fbes-layout-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.fbes-event-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.fbes-event-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.fbes-event-card.fbes-event-past {
    opacity: 0.65;
}

.fbes-event-card.fbes-event-live {
    border-color: #16a34a;
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15);
}

/* Card Image */
.fbes-event-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

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

/* Card Content */
.fbes-event-content {
    padding: 20px;
    position: relative;
}

/* =========================================================================
   Date Badge
   ========================================================================= */

.fbes-event-date-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 56px;
    background: #1e40af;
    color: #ffffff;
    border-radius: 8px;
    position: absolute;
    top: -28px;
    right: 16px;
    text-align: center;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(30, 64, 175, 0.3);
}

.fbes-date-month {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fbes-date-day {
    font-size: 22px;
    font-weight: 800;
}

/* =========================================================================
   Event Title
   ========================================================================= */

.fbes-event-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px 0;
    padding-right: 60px;
}

.fbes-event-title a {
    color: #111827;
    text-decoration: none;
    transition: color 0.15s ease;
}

.fbes-event-title a:hover {
    color: #1e40af;
}

/* =========================================================================
   Event Meta (time, location, etc.)
   ========================================================================= */

.fbes-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.fbes-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #6b7280;
}

.fbes-meta-item svg {
    flex-shrink: 0;
    color: #9ca3af;
}

/* =========================================================================
   Description
   ========================================================================= */

.fbes-event-description {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

/* =========================================================================
   Badges
   ========================================================================= */

.fbes-badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
}

.fbes-badge-live {
    background: #dcfce7;
    color: #166534;
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

/* =========================================================================
   Button
   ========================================================================= */

.fbes-event-actions {
    margin-top: 4px;
}

.fbes-btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
    cursor: pointer;
    border: none;
}

.fbes-btn-primary {
    background: #1e40af;
    color: #ffffff;
}

.fbes-btn-primary:hover {
    background: #1e3a8a;
    color: #ffffff;
    text-decoration: none;
}

/* =========================================================================
   List Layout
   ========================================================================= */

.fbes-layout-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fbes-list-item {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.fbes-list-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.fbes-list-item.fbes-event-past {
    opacity: 0.65;
}

.fbes-list-item.fbes-event-live {
    border-color: #16a34a;
}

/* List - Date Column */
.fbes-list-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 16px 12px;
    background: #1e40af;
    color: #ffffff;
    text-align: center;
    line-height: 1.2;
}

.fbes-list-month {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fbes-list-day {
    font-size: 28px;
    font-weight: 800;
}

.fbes-list-weekday {
    font-size: 11px;
    text-transform: uppercase;
    opacity: 0.8;
    letter-spacing: 0.3px;
}

/* List - Thumbnail */
.fbes-list-thumb {
    width: 140px;
    min-height: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.fbes-list-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* List - Details */
.fbes-list-details {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.fbes-list-details .fbes-event-title {
    padding-right: 0;
    margin-bottom: 6px;
}

.fbes-list-details .fbes-event-description {
    margin-bottom: 0;
}

.fbes-list-details .fbes-badge-live {
    position: static;
    margin-bottom: 6px;
}

/* List - Action Column */
.fbes-list-action {
    display: flex;
    align-items: center;
    padding: 16px;
    flex-shrink: 0;
}

/* =========================================================================
   Responsive
   ========================================================================= */

@media (max-width: 768px) {
    .fbes-layout-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .fbes-list-item {
        flex-wrap: wrap;
    }

    .fbes-list-date {
        min-width: 70px;
        padding: 12px 8px;
    }

    .fbes-list-day {
        font-size: 24px;
    }

    .fbes-list-thumb {
        display: none;
    }

    .fbes-list-details {
        padding: 12px 14px;
    }

    .fbes-list-action {
        width: 100%;
        padding: 0 14px 14px;
        justify-content: flex-start;
    }

    .fbes-list-action .fbes-btn {
        width: 100%;
        text-align: center;
    }

    .fbes-event-title {
        font-size: 16px;
        padding-right: 50px;
    }

    .fbes-event-date-badge {
        width: 44px;
        height: 48px;
        top: -24px;
        right: 12px;
    }

    .fbes-date-day {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .fbes-event-meta {
        flex-direction: column;
        gap: 6px;
    }
}
