/* Main Container */
.onusapp-events-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Archive Layout */
.onusapp-events-archive .events-loop {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* Event Item */
.event-item {
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.event-item:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.event-thumbnail {
    height: 200px;
    overflow: hidden;
}

.event-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.event-item:hover .event-thumbnail img {
    transform: scale(1.05);
}

.event-content {
    padding: 20px;
}

.event-header {
    margin-bottom: 15px;
}

.event-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 5px;
    margin-bottom: 5px;
}

.event-badge.event-type-single { background-color: #e3f2fd; color: #1976d2; }
.event-badge.event-type-recurring { background-color: #e8f5e9; color: #388e3c; }
.event-badge.event-type-trip { background-color: #fff3e0; color: #f57c00; }
.event-badge.event-type-conference { background-color: #f3e5f5; color: #8e24aa; }
.event-badge.event-type-workshop { background-color: #e0f7fa; color: #00acc1; }
.event-badge.event-type-course { background-color: #e8eaf6; color: #3949ab; }
.event-badge.event-type-other { background-color: #efebe9; color: #6d4c41; }

.event-badge.event-status-upcoming { background-color: #bbdefb; color: #0d47a1; }
.event-badge.event-status-ongoing { background-color: #c8e6c9; color: #2e7d32; }
.event-badge.event-status-completed { background-color: #ffccbc; color: #e64a19; }
.event-badge.event-status-cancelled { background-color: #ffcdd2; color: #c62828; }

.event-title {
    margin: 10px 0;
    font-size: 1.5em;
}

.event-title a {
    color: inherit;
    text-decoration: none;
}

.event-title a:hover {
    color: #2196f3;
}

.event-meta {
    color: #757575;
    font-size: 0.9em;
    margin-bottom: 10px;
}

.event-meta span {
    display: inline-block;
    margin-right: 10px;
}

.event-excerpt {
    margin-bottom: 15px;
    color: #616161;
}

.event-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.event-price {
    font-weight: bold;
    color: #388e3c;
}

.event-availability {
    font-size: 0.9em;
    padding: 3px 8px;
    border-radius: 3px;
}

.event-availability.status-available { background-color: #e8f5e9; color: #2e7d32; }
.event-availability.status-full { background-color: #ffebee; color: #c62828; }
.event-availability.status-disabled { background-color: #e0e0e0; color: #616161; }
.event-availability.status-deadline_passed { background-color: #fff3e0; color: #ef6c00; }

/* Single Event */
.onusapp-single-event {
    background: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.onusapp-event-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.onusapp-event-header .event-date {
    font-size: 1.2em;
    color: #616161;
}

.onusapp-event-content {
    margin-bottom: 30px;
}

.onusapp-event-details {
    margin: 30px 0;
}

.event-details-section {
    margin-bottom: 30px;
}

.event-details-section h3 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.event-organizer-details li {
    margin-bottom: 8px;
}

.event-organizer-details strong {
    display: inline-block;
    min-width: 100px;
}

.event-venue address {
    font-style: normal;
    line-height: 1.6;
}

.event-services {
    list-style: none;
    padding: 0;
    margin: 0;
}

.event-service {
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #eee;
    border-radius: 3px;
}

.event-service.yes { border-left: 3px solid #388e3c; }
.event-service.no { border-left: 3px solid #f44336; }
.event-service.optional { border-left: 3px solid #ff9800; }

.service-name {
    font-weight: bold;
    display: block;
}

.service-description {
    font-size: 0.9em;
    color: #757575;
    display: block;
    margin-top: 5px;
}

.service-included {
    color: #388e3c;
    font-size: 0.9em;
    display: block;
    margin-top: 5px;
}

.service-price {
    color: #ff9800;
    font-weight: bold;
    display: block;
    margin-top: 5px;
}

.onusapp-event-footer {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.9em;
}

.event-categories, .event-tags {
    margin-bottom: 10px;
}

.meta-label {
    font-weight: bold;
    margin-right: 5px;
}

.event-category, .event-tag {
    display: inline-block;
    margin-right: 5px;
    padding: 2px 8px;
    background: #f5f5f5;
    border-radius: 3px;
    text-decoration: none;
    color: #424242;
}

.event-category:hover, .event-tag:hover {
    background: #e0e0e0;
}

/* Booking Form */
.onusapp-booking-form {
    background: #f9f9f9;
    padding: 30px;
    border-radius: 5px;
    margin-top: 30px;
}

.onusapp-booking-form h3 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.form-group textarea {
    min-height: 100px;
}

.service-option {
    display: block;
    margin-bottom: 5px;
}

#booking-message {
    margin: 15px 0;
}

#booking-message.success {
    color: #388e3c;
}

#booking-message.error {
    color: #c62828;
}

#booking-summary {
    margin-top: 20px;
    background: #fff;
    padding: 15px;
    border-radius: 3px;
    border: 1px solid #eee;
}

#booking-summary table {
    width: 100%;
    border-collapse: collapse;
}

#booking-summary th, #booking-summary td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#booking-summary th {
    font-weight: bold;
}

#booking-summary .total th, #booking-summary .total td {
    border-top: 1px solid #ddd;
    font-weight: bold;
}

/* Calendar Widget */
.onusapp-events-calendar {
    font-size: 0.9em;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.calendar-header h4 {
    margin: 0;
}

.calendar-header a {
    text-decoration: none;
    color: #2196f3;
}

.onusapp-events-calendar table {
    width: 100%;
    border-collapse: collapse;
}

.onusapp-events-calendar th, 
.onusapp-events-calendar td {
    text-align: center;
    padding: 5px;
    border: 1px solid #eee;
}

.onusapp-events-calendar th {
    background: #f5f5f5;
    font-weight: bold;
}

.onusapp-events-calendar td.empty {
    background: #fafafa;
}

.onusapp-events-calendar td.has-events {
    background: #e3f2fd;
    position: relative;
}

.onusapp-events-calendar td.has-events:hover .event-tooltip {
    display: block;
}

.event-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    z-index: 10;
    min-width: 150px;
}

.event-tooltip a {
    display: block;
    margin-bottom: 5px;
    color: #2196f3;
    text-decoration: none;
    font-size: 0.8em;
}

.event-tooltip a:hover {
    text-decoration: underline;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .onusapp-events-archive .events-loop {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .onusapp-single-event {
        padding: 20px;
    }
    
    .onusapp-booking-form {
        padding: 20px;
    }
    
    .event-footer {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .event-footer .button {
        margin-top: 10px;
    }
}

@media (max-width: 480px) {
    .onusapp-events-archive .events-loop {
        grid-template-columns: 1fr;
    }
    
    .event-thumbnail {
        height: 150px;
    }
}

/* Pricing Options */
.pricing-options {
    border: 1px solid #eee;
    border-radius: 5px;
    overflow: hidden;
}

.pricing-option {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.3s ease;
}

.pricing-option:last-child {
    border-bottom: none;
}

.pricing-option:hover {
    background: #f9f9f9;
}

.pricing-option label {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    cursor: pointer;
    width: 100%;
}

.pricing-option input[type="radio"] {
    margin-right: 10px;
}

.pricing-label {
    font-weight: bold;
    flex: 1;
    min-width: 150px;
}

.pricing-amount {
    font-weight: bold;
    color: #388e3c;
    margin-left: 15px;
}

.pricing-description {
    width: 100%;
    font-size: 0.9em;
    color: #757575;
    margin-top: 5px;
}

.pricing-availability {
    font-size: 0.8em;
    background: #e3f2fd;
    color: #1976d2;
    padding: 2px 8px;
    border-radius: 3px;
    margin-left: 15px;
}

/* RTL Pricing Options */
.rtl .pricing-option input[type="radio"] {
    margin-right: 0;
    margin-left: 10px;
}

.rtl .pricing-amount {
    margin-left: 0;
    margin-right: 15px;
}

.rtl .pricing-availability {
    margin-left: 0;
    margin-right: 15px;
}

/* RTL Support */
.rtl .event-meta span {
    margin-right: 0;
    margin-left: 10px;
}

.rtl .event-badge {
    margin-right: 0;
    margin-left: 5px;
}

.rtl .event-footer {
    direction: rtl;
}

.rtl .event-organizer-details strong {
    margin-right: 0;
    margin-left: 10px;
}

.rtl .event-service {
    border-left: none;
    border-right: 3px solid #eee;
}

.rtl .event-service.yes { border-right-color: #388e3c; }
.rtl .event-service.no { border-right-color: #f44336; }
.rtl .event-service.optional { border-right-color: #ff9800; }

.rtl .onusapp-events-calendar th, 
.rtl .onusapp-events-calendar td {
    text-align: right;
}

.rtl #booking-summary th, 
.rtl #booking-summary td {
    text-align: right;
}

.rtl .event-tooltip {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}