/**
 * Public CSS
 *
 * @package Event_Booking_Manager
 * @since 1.0.0
 */

/* ===================================
   SINGLE EVENT
   =================================== */

.ebm-single-event {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.ebm-event-header-row {
    display: grid;
    grid-template-columns: 25% 75%;
    gap: 30px;
    margin-bottom: 30px;
}

.ebm-event-image {
    margin: 0;
}

.ebm-event-image img {
    max-width: 100%;
    height: 100% !important;
    border-radius: 8px;
    object-fit: cover;
}

.ebm-event-meta {
    background: #f5f5f5;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.ebm-event-meta .entry-header {
    margin-bottom: 15px;
}

.ebm-event-meta .entry-title {
    margin: 0 0 15px 0;
    font-size: 28px;
    color: #333;
}

.ebm-event-meta p {
    margin: 12px 0;
}

.ebm-next-date {
    padding: 12px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
}

.ebm-next-date.available {
    background: #d1f0d1;
    color: #155724;
    border: 1px solid #46b450;
}

.ebm-next-date.unavailable {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #dc3232;
}

.ebm-professional {
    color: #555;
}

.ebm-pdf-download {
    margin-top: 15px;
}

.ebm-pdf-download .ebm-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
}

/* ===================================
   INSTANCES LIST
   =================================== */

.ebm-event-instances-section {
    margin: 40px 0;
}

.ebm-event-instances-section h2 {
    margin-bottom: 20px;
    font-size: 24px;
    color: #333;
}

.ebm-instances-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ebm-instance-row {
    display: grid;
    grid-template-columns: 100px 1fr auto auto;
    gap: 20px;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border-left: 4px solid #0073aa;
}

.ebm-instance-row:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateX(5px);
}

.ebm-instance-row.past {
    opacity: 0.6;
    border-left-color: #999;
    background: #f8f8f8;
}

.ebm-instance-row.full {
    border-left-color: #dc3232;
}

.ebm-instance-row.available {
    border-left-color: #46b450;
}

.ebm-instance-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 10px;
    min-width: 80px;
    text-align: center;
}

.ebm-instance-date .ebm-day {
    font-size: 32px;
    font-weight: bold;
    color: #333;
    line-height: 1;
}

.ebm-instance-date .ebm-month {
    font-size: 14px;
    font-weight: 600;
    color: #0073aa;
    text-transform: uppercase;
    margin-top: 2px;
}

.ebm-instance-date .ebm-year {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}

.ebm-instance-details {
    flex: 1;
}

.ebm-instance-time {
    font-size: 18px;
    color: #333;
    margin-bottom: 5px;
}

.ebm-instance-time strong {
    color: #0073aa;
}

.ebm-instance-duration {
    font-size: 14px;
    color: #666;
}

.ebm-instance-availability {
    text-align: center;
    min-width: 150px;
}

.ebm-spots-info {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ebm-spots-count {
    font-size: 14px;
    color: #46b450;
    font-weight: 600;
    padding: 8px 12px;
    background: #f0f9f0;
    border-radius: 4px;
}

.ebm-status-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.ebm-status-badge.full {
    background: #ffe5e5;
    color: #dc3232;
}

.ebm-status-badge.past {
    background: #f0f0f0;
    color: #999;
}

.ebm-instance-action {
    min-width: 120px;
}

.ebm-book-button {
    padding: 12px 24px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ebm-book-button:hover {
    background: #005177;
    transform: scale(1.05);
}

.ebm-no-dates {
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #ffc107;
    text-align: center;
}

/* ===================================
   CALENDAR
   =================================== */

.ebm-calendar-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

#ebm-calendar {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.fc-event-slots {
    font-size: 11px;
    color: #666;
    margin-top: 2px;
}

.fc-event-full {
    background-color: #dc3232 !important;
    border-color: #dc3232 !important;
    opacity: 0.6;
}

/* ===================================
   MODAL
   =================================== */

.ebm-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.ebm-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.ebm-close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.ebm-close:hover {
    color: #000;
}

.ebm-booking-details {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.ebm-booking-details p {
    margin: 8px 0;
}

/* ===================================
   BOOKING FORM
   =================================== */

.ebm-booking-form {
    margin-top: 20px;
}

.ebm-form-group {
    margin-bottom: 20px;
}

.ebm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.ebm-form-group input[type="text"],
.ebm-form-group input[type="email"],
.ebm-form-group input[type="tel"],
.ebm-form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.ebm-form-group input:focus,
.ebm-form-group textarea:focus {
    outline: none;
    border-color: #0073aa;
}

.ebm-form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.ebm-privacy-checkbox {
    display: flex;
    align-items: flex-start;
}

.ebm-privacy-checkbox label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: normal;
}

.ebm-privacy-checkbox input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    cursor: pointer;
}

.ebm-available-slots {
    background: #d1f0d1;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 20px;
    text-align: center;
}

/* Buttons */
.ebm-button {
    display: inline-block;
    padding: 12px 24px;
    background: #0073aa;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.ebm-button:hover {
    background: #005177;
}

.ebm-button-primary {
    background: #0073aa;
}

.ebm-button-primary:hover {
    background: #005177;
}

.ebm-form-group button[type="submit"] {
    width: 100%;
}

.ebm-form-group button[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Messages */
.ebm-message {
    padding: 12px;
    border-radius: 4px;
    margin-top: 15px;
}

.ebm-message-success {
    background: #d1f0d1;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ebm-message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ebm-alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.ebm-alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.required {
    color: #dc3232;
}

/* ===================================
   EVENTS GRID
   =================================== */

.ebm-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.ebm-event-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.ebm-event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ebm-card-image {
    overflow: hidden;
}

.ebm-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s;
}

.ebm-event-card:hover .ebm-card-image img {
    transform: scale(1.05);
}

.ebm-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 20px;
}

.ebm-card-title {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.ebm-card-title a {
    color: #333;
    text-decoration: none;
}

.ebm-card-title a:hover {
    color: #0073aa;
}

.ebm-card-professional {
    color: #666;
    margin: 0 0 10px 0;
}

.ebm-card-excerpt {
    color: #555;
    margin: 10px 0;
    line-height: 1.6;
}

.ebm-card-next-date {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 4px;
    margin: auto 0 0;
    font-size: 14px;
    text-align: left;
}

.ebm-card-footer {
    margin-top: 15px;
    text-align: center;
}

/* ===================================
   RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .ebm-single-event {
        padding: 10px;
    }
    
    /* Event header responsive */
    .ebm-event-header-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .ebm-event-image img {
        width: 100%;
        height: auto;
    }
    
    .ebm-event-meta .entry-title {
        font-size: 24px;
    }
    
    .ebm-modal-content {
        width: 95%;
        padding: 20px;
        margin: 10% auto;
    }
    
    .ebm-events-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* Instance list responsive */
    .ebm-instance-row {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .ebm-instance-date {
        margin-left: -15px;
        margin-right: -15px;
        margin-top: -15px;
        padding: 12px 15px;
        text-align: center;
        border-radius: 8px 8px 0 0;
        flex-direction: row;
        gap: 8px;
    }
    
    .ebm-instance-date .ebm-day {
        font-size: 24px;
        margin: 0;
    }
    
    .ebm-instance-date .ebm-month {
        font-size: 18px;
        margin: 0;
    }
    
    .ebm-instance-date .ebm-year {
        font-size: 18px;
        margin: 0;
    }
    
    .ebm-instance-details {
        grid-column: 1 / -1;
    }
    
    .ebm-instance-time {
        font-size: 16px;
        text-align: center;
    }
    
    .ebm-instance-duration {
        text-align: center;
    }
    
    .ebm-instance-availability {
        grid-column: 1 / -1;
        text-align: left;
        min-width: auto;
    }
    
    .ebm-instance-action {
        grid-column: 1 / -1;
        min-width: auto;
    }
    
    .ebm-book-button {
        width: 100%;
    }
}
