/* Advanced Event Manager Styles */

.aem-container {
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.aem-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    align-items: center;
}

.aem-filter {
    padding: 10px 20px;
    background: #fff;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
    font-weight: 500;
}

.aem-filter:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.aem-filter.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.aem-year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.aem-year-display {
    padding: 0px 0px;
    background: transparent;
    font-weight: 600;
    min-width: 50px;
    text-align: center;
    font-size: 20px;
}

.aem-year-arrow {
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aem-year-arrow svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.aem-year-arrow:hover {
    background: #000;
    color: #fff;
    border-radius: 5px;
    border-color: #000;
}

.aem-events {
    display: grid;
    gap: 25px;
    margin-top: 20px;
}

.aem-events[data-columns="1"] {
    grid-template-columns: 1fr;
}

.aem-events[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.aem-events[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

/* .aem-event-box {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
} */

.aem-event-box {
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);

    display: flex;
    flex-direction: column;
    height: 100%;
}


.aem-event-box.expanded {
    background: #e3f2fd;
    border-color: #2196f3;
    box-shadow: 0 4px 16px rgba(33,150,243,0.3);
}

.aem-event-content {
    display: grid;
    grid-template-columns: 120px 150px 1fr;
    gap: 20px;
    padding: 20px;
    align-items: center;
	flex: 1;

}

.aem-event-logo img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.aem-date-badge {
    background: #007bff;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 80px;
}

.aem-date-month {
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.aem-date-day {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.aem-event-info h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    color: #333;
    font-weight: 700;
}

.aem-location {
    margin: 0;
    color: #666;
    font-size: 15px;
}

.aem-toggle-details {
    width: 100%;
    padding: 12px;
    background: #28a745;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s ease;
	margin-top: auto;

}

.aem-toggle-details:hover {
    background: #218838;
}

.aem-event-box.expanded .aem-toggle-details {
    background: #dc3545;
}

.aem-event-box.expanded .aem-toggle-details:hover {
    background: #c82333;
}

.aem-event-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.aem-event-box.expanded .aem-event-details {
    max-height: 500px;
}

.aem-details-content {
    padding: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.aem-details-content strong {
    color: #007bff;
    font-size: 16px;
}
.aem-event-info h3 {
    font-size: 20px;
    color: #333;
    font-weight: 700;
    margin: 0 0 10px 0;
    word-wrap: break-word;       /* ensures long words break to new line */
    overflow-wrap: break-word;   /* for older browsers */
    hyphens: auto;               /* adds hyphen if needed */
}


/* Responsive Design */
@media (max-width: 992px) {
    .aem-events[data-columns="3"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .aem-event-content {
        grid-template-columns: 100px 120px 1fr;
        gap: 15px;
    }
}

@media (min-width: 1200px) and (max-width: 1600px) {
    .aem-event-content {
        /* Adjust column widths for better fit */
        grid-template-columns: 130px 110px 1fr; /* logo smaller, date smaller, title gets max space */
        gap: 20px;
        padding: 20px;
        align-items: center;
    }

    .aem-event-logo img {
        height: 90px; /* slightly smaller logo height */
        border-radius: 8px;
        border: 2px solid #ddd;
        object-fit: contain; /* keep logo aspect ratio */
    }

    .aem-date-badge {
        min-width: 70px; /* smaller date badge */
        padding: 10px;
        font-size: 14px;
        border-radius: 8px;
    }

    .aem-date-month {
        font-size: 14px;
    }

    .aem-date-day {
        font-size: 20px;
        font-weight: 700;
        line-height: 1;
    }

    .aem-event-info h3 {
        font-size: 20px;
        font-weight: 700;
        color: #333;
        margin: 0 0 10px 0;
        white-space: normal !important; /* allow wrapping */
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
        line-height: 1.3;
        max-width: 100%;
    }

    .aem-location {
        font-size: 14px;
        color: #666;
    }
}



@media (max-width: 768px) {
    .aem-event-info h3 {
        font-size: 18px;
        line-height: 1.2;   /* ensures text height adjusts */
    }
}

@media (max-width: 480px) {
    .aem-event-info h3 {
        font-size: 16px;
        line-height: 1.3;
    }
}

@media (max-width: 768px) {
    .aem-events[data-columns="2"],
    .aem-events[data-columns="3"] {
        grid-template-columns: 1fr;
    }
    
    .aem-filters {
        gap: 10px;
        padding: 15px;
    }
    
    .aem-filter {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .aem-event-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .aem-event-logo img {
        margin: 0 auto;
        max-width: 150px;
    }
    
    .aem-details-content {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .aem-container {
        padding: 10px;
    }
    
    .aem-event-info h3 {
        font-size: 18px;
    }
    
    .aem-date-badge {
        padding: 8px;
        min-width: 60px;
    }
}
