/* iHowz Events Frontend Styles */

/* Event List Styles */
.ihowz-events-list {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.ihowz-event-card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ihowz-event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.event-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.event-title {
    margin: 0;
    color: #333;
    font-size: 1.3em;
    flex: 1;
}

.event-type {
    background: #f1f1f1;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.member-only-badge {
    background: #6f42c1;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-left: 5px;
}

.event-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.event-date {
    font-weight: bold;
    color: #0073aa;
}

.event-location {
    color: #666;
}

.event-price {
    font-weight: bold;
    color: #28a745;
}

.event-price.free {
    color: #17a2b8;
}

.regular-price {
    text-decoration: line-through;
    color: #999;
    font-weight: normal;
    margin-left: 5px;
}

.event-description {
    margin-bottom: 15px;
    color: #555;
    line-height: 1.6;
}

.event-actions {
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.booking-status {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    font-weight: bold;
}

.booking-status.booked {
    background: #d4edda;
    color: #155724;
}

.booking-status.members-only {
    background: #f8d7da;
    color: #721c24;
}

.booking-status.full {
    background: #fff3cd;
    color: #856404;
}

.booking-status.no-booking {
    background: #e2e3e5;
    color: #383d41;
}

/* Button Styles */
.ihowz-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background 0.3s ease;
    text-align: center;
}

.ihowz-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.ihowz-btn-primary {
    background: #0073aa;
}

.ihowz-btn-primary:hover {
    background: #005a87;
}

.ihowz-btn-danger {
    background: #dc3545;
}

.ihowz-btn-danger:hover {
    background: #c82333;
}

.ihowz-btn-warning {
    background: #ffc107;
    color: #212529;
}

.ihowz-btn-warning:hover {
    background: #e0a800;
    color: #212529;
}

.ihowz-btn-small {
    padding: 5px 10px;
    font-size: 12px;
}

/* Booking Form Styles */
.ihowz-event-booking-container {
    max-width: 800px;
    margin: 0 auto;
}

.event-details {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.event-details h3 {
    margin-top: 0;
    color: #333;
}

.event-meta p {
    margin: 8px 0;
}

.booking-form {
    background: white;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

.booking-form h4 {
    margin-top: 0;
    color: #0073aa;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

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

.form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.form-row textarea {
    resize: vertical;
    min-height: 80px;
}

.booking-total {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
    text-align: center;
}

.booking-total p {
    margin: 0;
    font-size: 1.2em;
}

.booking-status-message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

.booking-status-message.already-booked {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.booking-status-message.members-only {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.booking-status-message.event-full {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.no-booking-required {
    background: #e2e3e5;
    color: #383d41;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

/* Upcoming Events Widget */
.ihowz-upcoming-events {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.ihowz-upcoming-events h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.upcoming-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.upcoming-event-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.upcoming-event-item:last-child {
    border-bottom: none;
}

.event-date {
    flex-shrink: 0;
    width: 80px;
    text-align: center;
    font-weight: bold;
    color: #0073aa;
    font-size: 0.9em;
}

.event-details {
    flex: 1;
}

.event-details h4 {
    margin: 0 0 5px 0;
    color: #333;
}

.event-type {
    color: #666;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.event-description {
    color: #555;
    margin: 5px 0;
    font-size: 0.9em;
}

/* My Bookings Table */
.ihowz-my-bookings {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
}

.ihowz-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.ihowz-table th,
.ihowz-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.ihowz-table th {
    background: #f8f9fa;
    font-weight: bold;
    color: #333;
}

.ihowz-table tr:hover {
    background: #f8f9fa;
}

/* Calendar Styles */
.ihowz-events-calendar {
    margin: 20px 0;
}

#ihowz-calendar {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
}

/* Reduce height of frontend calendar day cells */
#ihowz-calendar .fc-daygrid-day {
    height: 60px !important; /* Reduced from default ~120px */
    min-height: 60px !important;
}

#ihowz-calendar .fc-daygrid-day-frame {
    min-height: 60px !important;
}

#ihowz-calendar .fc-daygrid-day-events {
    margin-top: 2px;
    min-height: 20px;
}

/* Adjust event display in smaller cells */
#ihowz-calendar .fc-daygrid-event {
    font-size: 11px;
    padding: 1px 3px;
    margin-bottom: 1px;
}

/* Adjust day number positioning */
#ihowz-calendar .fc-daygrid-day-number {
    padding: 4px;
    font-size: 12px;
}

/* Ensure "more" link is visible in compact view */
#ihowz-calendar .fc-daygrid-more-link {
    font-size: 10px;
    padding: 1px 3px;
}

/* Event Details Popup */
.ihowz-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ihowz-popup {
    background: white;
    border-radius: 8px;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.ihowz-event-details-popup {
    padding: 20px;
}

.ihowz-event-details-popup h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.member-only-notice {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

.event-full {
    background: #fff3cd;
    color: #856404;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

.no-booking-required {
    background: #e2e3e5;
    color: #383d41;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    text-align: center;
}

/* No Events Message */
.no-events {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #ddd;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .ihowz-event-card {
        padding: 15px;
    }
    
    .event-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .event-meta {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .upcoming-event-item {
        flex-direction: column;
        gap: 10px;
    }
    
    .event-date {
        width: auto;
        text-align: left;
    }
    
    .ihowz-table {
        font-size: 14px;
    }
    
    .ihowz-table th,
    .ihowz-table td {
        padding: 8px;
    }
    
    .ihowz-popup {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
}

@media (max-width: 480px) {
    .form-row input,
    .form-row select,
    .form-row textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .ihowz-btn {
        width: 100%;
        padding: 12px;
    }
}