/**
 * Events Grid & Filter Base Styles
 * Premium, modern look with granular customization support.
 */

:root {
    --em-grid-gap: 30px;
    --em-card-bg: #ffffff;
    --em-card-padding: 24px;
    --em-card-radius: 16px;
    --em-card-shadow: 0 10px 25px rgba(0,0,0,0.05);
    --em-card-shadow-hover: 0 20px 40px rgba(0,0,0,0.1);
    
    --em-title-color: #1a202c;
    --em-title-size: 20px;
    --em-accent-color: #7835d6;
    
    --em-meta-color: #718096;
    --em-meta-size: 14px;
}

/* --- Container --- */
.em-events-grid-wrapper {
    position: relative;
    width: 100%;
}

.em-events-grid {
    display: grid;
    gap: var(--em-grid-gap);
    transition: opacity 0.3s ease;
}

.em-events-grid.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* --- Card --- */
.em-event-card {
    background: var(--em-card-bg);
    border-radius: var(--em-card-radius);
    box-shadow: var(--em-card-shadow);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid rgba(0,0,0,0.05);
}

.em-event-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--em-card-shadow-hover);
}

/* --- Image Section --- */
.em-card-image-wrap {
    position: relative;
    width: 100%;
    padding-top: 60%; /* default 16:9 */
    overflow: hidden;
}

.em-card-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s ease;
}

/* .em-event-card:hover .em-card-image { transform: scale(1.1); } -- Moved to Elementor Control */

.em-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(0deg, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.em-event-card:hover .em-card-overlay {
    opacity: 1;
}

/* --- Badges --- */
.em-card-badges {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.em-card-badge {
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.badge-category {
    background: var(--em-accent-color);
}

.badge-location {
    background: #333;
}

/* --- Content --- */
.em-card-content {
    padding: var(--em-card-padding);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.em-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    font-size: var(--em-meta-size);
    color: var(--em-meta-color);
}

.em-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.em-meta-item svg {
    color: var(--em-accent-color);
}

.em-card-title {
    margin: 0 0 15px 0;
    font-size: var(--em-title-size);
    font-weight: 700;
    color: var(--em-title-color);
    line-height: 1.3;
    transition: color 0.3s ease;
}

.em-event-card:hover .em-card-title {
    color: var(--em-accent-color);
}

.em-card-excerpt {
    font-size: 14px;
    color: #718096;
    margin-bottom: 20px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Footer --- */
.em-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    margin-top: auto;
}

.em-card-price {
    font-weight: 800;
    font-size: 18px;
    color: var(--em-title-color);
}

.em-card-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 10px;
    background: var(--em-accent-color);
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.em-card-btn:hover {
    background: #5a24aa;
    transform: translateX(3px);
}

/* --- Filters --- */
.em-grid-filter-wrap {
    margin-bottom: 40px;
    background: #fff;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border: 1px solid #edf2f7;
}

.em-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-end;
}

.em-filter-group {
    flex: 1;
    min-width: 200px;
}

.em-filter-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    color: #4a5568;
    letter-spacing: 0.5px;
}

.em-filter-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 2px solid #edf2f7;
    background: #f8fafc;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
}

.em-filter-input:focus {
    border-color: var(--em-accent-color);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(120, 53, 214, 0.1);
}

.em-filter-submit {
    padding: 12px 30px;
    background: var(--em-accent-color);
    color: #fff;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.em-filter-submit:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}

/* Loading Spinner */
.em-grid-loader {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.em-events-grid.loading .em-grid-loader {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(120, 53, 214, 0.1);
    border-left-color: var(--em-accent-color);
    border-radius: 50%;
    animation: em-spin 1s linear infinite;
}

@keyframes em-spin {
    to { transform: rotate(360deg); }
}

/* --- List Layout (Horizontal) --- */
.em-layout-list .em-event-card {
    flex-direction: row;
    align-items: stretch;
    height: auto;
}

.em-layout-list .em-card-image-wrap {
    width: 35%;
    padding-top: 0 !important;
    height: auto;
    min-height: 250px;
}

.em-layout-list .em-card-content {
    width: 65%;
    padding: 30px;
}

@media (max-width: 768px) {
    .em-layout-list .em-event-card {
        flex-direction: column;
    }
    .em-layout-list .em-card-image-wrap {
        width: 100%;
        padding-top: 60% !important;
    }
    .em-layout-list .em-card-content {
        width: 100%;
    }
}

/* Pagination Refinement */
.em-pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
}

.em-pagination a, .em-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #4a5568;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
}

.em-pagination a:hover {
    border-color: var(--em-accent-color);
    color: var(--em-accent-color);
    transform: translateY(-2px);
}

.em-pagination span.current {
    background: var(--em-accent-color);
    color: #fff;
    border-color: var(--em-accent-color);
    box-shadow: 0 4px 12px rgba(120, 53, 214, 0.2);
}
