/* public/css/frontend.css */
.cem-events-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.cem-events-grid.columns-1 .cem-event {
    width: 100%;
}

.cem-events-grid.columns-2 .cem-event {
    width: 50%;
}

.cem-events-grid.columns-3 .cem-event {
    width: 33.333%;
}

.cem-events-grid.columns-4 .cem-event {
    width: 25%;
}

@media (max-width: 768px) {
    .cem-events-grid.columns-3 .cem-event,
    .cem-events-grid.columns-4 .cem-event {
        width: 50%;
    }
}

@media (max-width: 480px) {
    .cem-events-grid.columns-2 .cem-event,
    .cem-events-grid.columns-3 .cem-event,
    .cem-events-grid.columns-4 .cem-event {
        width: 100%;
    }
}

.cem-event {
    padding: 15px;
    margin-bottom: 30px;
}

.cem-event-image {
    margin-bottom: 15px;
}

.cem-event-image img {
    width: 100%;
    height: auto;
    display: block;
}

.cem-event-title {
    margin-top: 0;
    margin-bottom: 10px;
}

.cem-event-date,
.cem-event-time,
.cem-event-location,
.cem-event-price {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.cem-event-date .dashicons,
.cem-event-time .dashicons,
.cem-event-location .dashicons,
.cem-event-price .dashicons {
    margin-right: 5px;
}

.cem-event-description {
    margin: 15px 0;
}

.cem-event-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.cem-booking-button,
.cem-more-info-button,
.cem-download-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.cem-booking-button:hover,
.cem-more-info-button:hover,
.cem-download-button:hover {
    background-color: #135e96;
    color: #fff;
}

.cem-download-button {
    background-color: #5cb85c;
}

.cem-download-button:hover {
    background-color: #449d44;
}

/* Booking Form */
.cem-booking-form {
    padding: 20px;
}

.cem-booking-event-info {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.cem-form-row {
    margin-bottom: 15px;
}

.cem-form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.cem-form-row input[type="text"],
.cem-form-row input[type="email"],
.cem-form-row input[type="tel"],
.cem-form-row input[type="number"],
.cem-form-row textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.cem-form-row textarea {
    height: 100px;
}

.cem-submit-booking {
    background-color: #2271b1;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.cem-submit-booking:hover {
    background-color: #135e96;
}

.cem-booking-success {
    padding: 15px;
    background-color: #dff0d8;
    border: 1px solid #d6e9c6;
    color: #3c763d;
    border-radius: 3px;
}

.cem-booking-error {
    padding: 15px;
    background-color: #f2dede;
    border: 1px solid #ebccd1;
    color: #a94442;
    border-radius: 3px;
    margin-bottom: 15px;
}

/* Popup */
#cem-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

#cem-popup-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

#cem-popup-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
}

.cem-popup-event {
    display: flex;
    flex-wrap: wrap;
}

.cem-popup-event-image {
    flex: 0 0 40%;
    padding-right: 20px;
}

.cem-popup-event-image img {
    width: 100%;
    height: auto;
    display: block;
}

.cem-popup-event-content {
    flex: 0 0 60%;
}

@media (max-width: 768px) {
    .cem-popup-event-image,
    .cem-popup-event-content {
        flex: 0 0 100%;
    }
    
    .cem-popup-event-image {
        margin-bottom: 20px;
        padding-right: 0;
    }
}

.cem-popup-event-title {
    margin-top: 0;
    margin-bottom: 15px;
}

.cem-popup-event-date,
.cem-popup-event-time,
.cem-popup-event-location,
.cem-popup-event-price {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.cem-popup-event-date .dashicons,
.cem-popup-event-time .dashicons,
.cem-popup-event-location .dashicons,
.cem-popup-event-price .dashicons {
    margin-right: 5px;
}

.cem-popup-event-description {
    margin: 20px 0;
}

.cem-popup-event-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.cem-popup-booking-button,
.cem-popup-more-info-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.cem-popup-booking-button:hover,
.cem-popup-more-info-button:hover {
    background-color: #135e96;
    color: #fff;
}

/* Add this to public/css/frontend.css */
.cem-single-event {
    margin: 40px 0;
    display: flex;
    flex-wrap: wrap;
}

.cem-single-event-image {
    flex: 0 0 40%;
    padding-right: 20px;
    margin-bottom: 20px;
}

.cem-single-event-image img {
    width: 100%;
    height: auto;
    display: block;
}

.cem-single-event-content {
    flex: 0 0 60%;
}

@media (max-width: 768px) {
    .cem-single-event-image,
    .cem-single-event-content {
        flex: 0 0 100%;
    }
    
    .cem-single-event-image {
        padding-right: 0;
    }
}

.cem-single-event-title {
    margin-top: 0;
    margin-bottom: 20px;
}

.cem-single-event-meta {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.cem-single-event-date,
.cem-single-event-time,
.cem-single-event-location,
.cem-single-event-price {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.cem-single-event-date .dashicons,
.cem-single-event-time .dashicons,
.cem-single-event-location .dashicons,
.cem-single-event-price .dashicons,
.cem-booking-notice .dashicons,
.cem-booking-deposit .dashicons {
    margin-right: 10px;
    width: 20px;
    height: 20px;
}

.cem-single-event-description {
    margin-bottom: 30px;
}

.cem-single-event-details {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.cem-booking-notice,
.cem-booking-deposit {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
}

.cem-single-event-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cem-single-event-buttons .button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
    font-size: 16px;
    line-height: 1.4;
    cursor: pointer;
}

.cem-single-event-buttons .button:hover {
    background-color: #135e96;
    color: #fff;
}

.cem-download-button.button {
    background-color: #5cb85c;
}

.cem-download-button.button:hover {
    background-color: #449d44;
}

.cem-booking-button,
.cem-more-info-button,
.cem-download-button,
.cem-third-party-booking-button {
    display: inline-block;
    padding: 8px 15px;
    background-color: #2271b1;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.cem-booking-button:hover,
.cem-more-info-button:hover,
.cem-download-button:hover,
.cem-third-party-booking-button:hover {
    background-color: #135e96;
    color: #fff;
}

.cem-download-button {
    background-color: #5cb85c;
}

.cem-download-button:hover {
    background-color: #449d44;
}

/* Third-party booking button specific styling */
.cem-third-party-booking-button {
    background-color: #007bff;
}

.cem-third-party-booking-button:hover {
    background-color: #0056b3;
}

/* Popup third-party booking buttons */
.cem-popup-third-party-booking-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 3px;
    transition: background-color 0.3s;
}

.cem-popup-third-party-booking-button:hover {
    background-color: #0056b3;
    color: #fff;
}

/* Single event page third-party booking button */
.cem-single-event-buttons .cem-third-party-booking-button.button {
    background-color: #007bff;
    color: #fff;
}

.cem-single-event-buttons .cem-third-party-booking-button.button:hover {
    background-color: #0056b3;
    color: #fff;
}

/* Multiple booking options styling */
.cem-single-event-booking-options {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
}

.cem-booking-option-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.cem-booking-option-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.cem-booking-option-description {
    margin-bottom: 10px;
    color: #333;
}

.cem-booking-option-details {
    margin-bottom: 15px;
}

.cem-booking-option-button {
    margin-top: 10px;
}

/* Fix datepicker and timepicker dropdown backgrounds */
.ui-datepicker {
    background-color: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3) !important;
    z-index: 10000 !important;
}

.ui-datepicker td {
    background-color: transparent !important;
}

.ui-datepicker td a {
    background-color: #fff !important;
    color: #333 !important;
    border: none !important;
}

.ui-datepicker td a:hover {
    background-color: #e6e6e6 !important;
    color: #333 !important;
}

.ui-datepicker .ui-state-highlight {
    background-color: #ffffcc !important;
    color: #333 !important;
}

.ui-datepicker .ui-state-active {
    background-color: #007cba !important;
    color: #fff !important;
}

.ui-datepicker-header {
    background-color: #f1f1f1 !important;
    color: #333 !important;
}

/* Timepicker dropdown fix */
.ui-timepicker-wrapper {
    background-color: #fff !important;
    border: 1px solid #ccc !important;
    max-height: 200px !important;
    z-index: 10001 !important;
}

.ui-timepicker-list {
    background-color: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ui-timepicker-list li {
    background-color: #fff !important;
    color: #333 !important;
    padding: 5px 10px !important;
    border-bottom: 1px solid #f0f0f0 !important;
}

.ui-timepicker-list li:hover {
    background-color: #e6e6e6 !important;
    color: #333 !important;
}

.ui-timepicker-list .ui-timepicker-selected {
    background-color: #007cba !important;
    color: #fff !important;
}

/* Dialog fix for frontend */
.ui-dialog {
    background-color: #fff !important;
    border: 1px solid #ccc !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3) !important;
}

.ui-dialog-titlebar {
    background-color: #f1f1f1 !important;
    border-bottom: 1px solid #ddd !important;
    color: #333 !important;
}

.ui-dialog-content {
    background-color: #fff !important;
}

/* Button tooltips */
[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
    margin-bottom: 5px;
    opacity: 0;
    transition: opacity 0.3s;
}

[title]:hover {
    position: relative;
}

[title]:hover::after {
    opacity: 1;
}