/* ===== EventSpace Booking – Frontend CSS ===== */

:root {
    --esb-primary: #2563eb;
    --esb-primary-hover: #1d4ed8;
    --esb-success: #16a34a;
    --esb-danger: #dc2626;
    --esb-warning: #d97706;
    --esb-text: #1e293b;
    --esb-text-light: #64748b;
    --esb-border: #e2e8f0;
    --esb-bg: #f8fafc;
    --esb-bg-white: #ffffff;
    --esb-radius: 8px;
    --esb-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.esb-booking-wrapper,
.esb-calendar-wrapper,
.esb-status-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--esb-text);
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
}

/* Steps */
.esb-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    padding: 0;
    counter-reset: step;
    position: relative;
}

.esb-step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--esb-text-light);
    flex: 1;
    text-align: center;
    justify-content: center;
    padding: 12px 8px;
    border-bottom: 3px solid var(--esb-border);
    transition: all 0.3s;
}

.esb-step-active {
    color: var(--esb-primary);
    border-bottom-color: var(--esb-primary);
    font-weight: 600;
}

.esb-step-done {
    color: var(--esb-success);
    border-bottom-color: var(--esb-success);
}

.esb-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--esb-border);
    font-size: 13px;
    font-weight: 700;
    color: var(--esb-text-light);
}

.esb-step-active .esb-step-num { background: var(--esb-primary); color: #fff; }
.esb-step-done .esb-step-num { background: var(--esb-success); color: #fff; }

/* Calendar */
.esb-cal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.esb-cal-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.esb-cal-nav-btn {
    background: var(--esb-bg-white);
    border: 1px solid var(--esb-border);
    border-radius: var(--esb-radius);
    width: 40px;
    height: 40px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.esb-cal-nav-btn:hover {
    background: var(--esb-bg);
    border-color: var(--esb-primary);
}

.esb-cal-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--esb-text-light);
}

.esb-cal-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}

.esb-cal-dot-free { background: var(--esb-success); }
.esb-cal-dot-taken { background: var(--esb-danger); }

.esb-cal-grid {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.esb-cal-grid th {
    padding: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--esb-text-light);
    background: var(--esb-bg);
}

.esb-cal-grid td {
    padding: 12px 8px;
    text-align: center;
    border: 1px solid var(--esb-border);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.esb-cal-grid td:hover:not(.esb-day-empty):not(.esb-day-past):not(.esb-day-booked):not(.esb-day-blocked) {
    background: #dbeafe;
    border-color: var(--esb-primary);
}

.esb-day-available { background: #dcfce7; color: #166534; font-weight: 700; cursor: pointer; }
.esb-day-booked { background: #fee2e2; color: #991b1b; cursor: not-allowed; }
.esb-day-blocked { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; }
.esb-day-past { background: #f9fafb; color: #d1d5db; cursor: default; }
.esb-day-too_soon { background: #fef3c7; color: #92400e; cursor: not-allowed; }
.esb-day-empty { background: transparent; cursor: default; border-color: transparent; }
.esb-day-selected { background: var(--esb-primary) !important; color: #fff !important; border-color: var(--esb-primary-hover) !important; border-radius: 4px; }

.esb-cal-info {
    margin-top: 16px;
    padding: 12px 16px;
    background: var(--esb-bg);
    border-radius: var(--esb-radius);
    font-size: 14px;
    color: var(--esb-text-light);
}

.esb-cal-info p { margin: 4px 0; }

.esb-selected-date {
    margin-top: 16px;
    padding: 12px 16px;
    background: #dbeafe;
    border-radius: var(--esb-radius);
    border: 1px solid var(--esb-primary);
}

/* Extras */
.esb-extras-section {
    margin-bottom: 24px;
}

.esb-extras-section h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.esb-hint {
    font-size: 13px;
    color: var(--esb-text-light);
    margin-bottom: 12px;
    font-style: italic;
}

.esb-extras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.esb-extra-card {
    background: var(--esb-bg-white);
    border: 2px solid var(--esb-border);
    border-radius: var(--esb-radius);
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.esb-extra-card:hover { border-color: var(--esb-primary); }
.esb-extra-card.esb-extra-selected {
    border-color: var(--esb-primary);
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}

.esb-extra-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.esb-extra-name {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
}

.esb-extra-desc {
    font-size: 13px;
    color: var(--esb-text-light);
    margin-bottom: 8px;
}

.esb-extra-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--esb-primary);
}

.esb-extra-request-label {
    font-size: 13px;
    color: var(--esb-warning);
    font-weight: 600;
}

/* Form */
.esb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.esb-form-full { grid-column: 1 / -1; }

.esb-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--esb-text);
}

.esb-form-group input,
.esb-form-group textarea,
.esb-form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--esb-border);
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.esb-form-group input:focus,
.esb-form-group textarea:focus {
    outline: none;
    border-color: var(--esb-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Buttons */
.esb-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.esb-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.esb-btn-primary, .esb-btn-next {
    background: var(--esb-primary);
    color: #fff;
}
.esb-btn-primary:hover:not(:disabled), .esb-btn-next:hover:not(:disabled) {
    background: var(--esb-primary-hover);
}

.esb-btn-secondary {
    background: var(--esb-bg);
    color: var(--esb-text);
    border: 1px solid var(--esb-border);
}
.esb-btn-secondary:hover { background: var(--esb-border); }

.esb-btn-back {
    background: transparent;
    color: var(--esb-text-light);
    border: 1px solid var(--esb-border);
}
.esb-btn-back:hover { background: var(--esb-bg); }

.esb-btn-danger {
    background: var(--esb-danger);
    color: #fff;
}
.esb-btn-danger:hover { background: #b91c1c; }

.esb-btn-large {
    padding: 14px 32px;
    font-size: 17px;
}

.esb-form-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--esb-border);
}

/* Summary */
.esb-summary-section {
    margin-bottom: 24px;
    padding: 16px 20px;
    background: var(--esb-bg);
    border-radius: var(--esb-radius);
}

.esb-summary-section h3 {
    margin-top: 0;
    font-size: 16px;
}

.esb-price-table {
    width: 100%;
    border-collapse: collapse;
}

.esb-price-table td {
    padding: 8px 0;
    font-size: 15px;
}

.esb-price-table td:last-child { text-align: right; font-weight: 500; }
.esb-price-total td {
    padding-top: 12px;
    border-top: 2px solid var(--esb-text);
    font-size: 18px;
    font-weight: 700;
}

/* Coupon */
.esb-coupon-section {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--esb-bg);
    border-radius: var(--esb-radius);
}

.esb-coupon-input {
    display: flex;
    gap: 8px;
}

.esb-coupon-input input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--esb-border);
    border-radius: 6px;
    font-size: 15px;
}

.esb-coupon-msg {
    margin-top: 8px;
    font-size: 14px;
}

.esb-coupon-msg.esb-msg-success { color: var(--esb-success); }
.esb-coupon-msg.esb-msg-error { color: var(--esb-danger); }

/* Payment */
.esb-payment-section {
    margin-bottom: 20px;
    padding: 16px 20px;
    background: var(--esb-bg);
    border-radius: var(--esb-radius);
}

.esb-payment-methods {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.esb-payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--esb-bg-white);
    border: 2px solid var(--esb-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.esb-payment-option:hover { border-color: var(--esb-primary); }
.esb-payment-option.esb-payment-selected {
    border-color: var(--esb-primary);
    background: #eff6ff;
}

.esb-payment-option input[type="radio"] { margin: 0; }
.esb-payment-option label { cursor: pointer; font-weight: 500; }

/* Legal */
.esb-legal-section {
    margin-bottom: 20px;
}

.esb-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    cursor: pointer;
}

.esb-checkbox-label input { margin-top: 2px; }
.esb-checkbox-label a { color: var(--esb-primary); }

.esb-deposit-info {
    margin-bottom: 16px;
    padding: 12px 16px;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: var(--esb-radius);
    font-size: 14px;
}

/* Confirmation */
.esb-confirmation {
    text-align: center;
    padding: 40px 20px;
}

.esb-confirmation-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--esb-success);
    color: #fff;
    font-size: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

#esb-confirmation-details {
    text-align: left;
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    background: var(--esb-bg);
    border-radius: var(--esb-radius);
}

/* Loading */
.esb-loading {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255,255,255,0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.esb-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--esb-border);
    border-top-color: var(--esb-primary);
    border-radius: 50%;
    animation: esb-spin 0.8s linear infinite;
}

@keyframes esb-spin { to { transform: rotate(360deg); } }

/* Messages */
.esb-message {
    padding: 12px 16px;
    border-radius: var(--esb-radius);
    margin: 16px 0;
    font-size: 14px;
}

.esb-message.esb-msg-error { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.esb-message.esb-msg-success { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* Status page */
.esb-status-form {
    max-width: 400px;
}

.esb-status-card {
    padding: 20px;
    background: var(--esb-bg);
    border-radius: var(--esb-radius);
    margin: 20px 0;
}

.esb-cancel-section {
    margin-top: 24px;
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: var(--esb-radius);
}

/* Responsive */
@media (max-width: 600px) {
    .esb-form-grid { grid-template-columns: 1fr; }
    .esb-extras-grid { grid-template-columns: 1fr; }
    .esb-steps { flex-wrap: wrap; }
    .esb-step { font-size: 12px; padding: 8px 4px; }
    .esb-form-nav { flex-direction: column; gap: 8px; }
    .esb-form-nav .esb-btn { width: 100%; text-align: center; }
}
