/*
 * Front-end styles for RTEC Extra Field Types
 * v4.0.2
 */

/* Date Selector capacity states */
.rtec-date-selector-options-wrap .rtec-date-selector-option-wrap.rtec-eft-date-full {
	opacity: 0.6;
}

.rtec-date-selector-options-wrap .rtec-date-selector-option-wrap.rtec-eft-date-full label,
.rtec-date-selector-options-wrap .rtec-date-selector-option-wrap.rtec-eft-date-full .rtec-date-option-label {
	color: #777;
}

.rtec-date-selector-options-wrap .rtec-date-selector-option-wrap.rtec-eft-date-full input[type="checkbox"] {
	cursor: not-allowed;
}

.rtec-date-selector-options-wrap .rtec-date-selector-option-wrap.rtec-eft-date-overbooked label,
.rtec-date-selector-options-wrap .rtec-date-selector-option-wrap.rtec-eft-date-overbooked .rtec-date-option-label {
	color: red;
	font-weight: 600;
}

/* ── Date + Meal table ─────────────────────────────────── */
.rtec-eft-date-meal-table {
	width: 100%;
	border-collapse: collapse;
	margin: 4px 0;
}

.rtec-eft-date-meal-table th {
	text-align: center;
	padding: 6px 10px;
	font-weight: 600;
	font-size: 0.92em;
	border-bottom: 2px solid #ddd;
}

.rtec-eft-date-meal-table th.rtec-eft-dmt-attend {
	text-align: left;
}

.rtec-eft-date-meal-table td {
	padding: 5px 10px;
	text-align: center;
	border-bottom: 1px solid #eee;
}

.rtec-eft-date-meal-table td.rtec-eft-dmt-attend-cell {
	text-align: left;
}

.rtec-eft-date-meal-table td.rtec-eft-dmt-meal-cell input[type="checkbox"] {
	margin: 0;
	transform: scale(1.15);
}

.rtec-eft-date-meal-table tr.rtec-eft-date-full {
	opacity: 0.5;
}

.rtec-eft-date-meal-table tr.rtec-eft-date-overbooked td.rtec-eft-dmt-attend-cell label {
	color: red;
	font-weight: 600;
}

.rtec-eft-date-meal-table .rtec-eft-meal-disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* ── City Autocomplete ──────────────────────────────── */
.rtec-eft-city-autocomplete-input {
	width: 100%;
	padding: 6px 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
	font-size: 1em;
	box-sizing: border-box;
}

.rtec-eft-city-autocomplete-input.rtec-eft-city-valid {
	border-color: #4caf50;
}

.rtec-eft-city-autocomplete-input.rtec-eft-city-invalid {
	border-color: #e53935;
}

.rtec-eft-city-suggestions {
	position: absolute;
	z-index: 1000;
	background: #fff;
	border: 1px solid #ccc;
	border-top: none;
	border-radius: 0 0 4px 4px;
	max-height: 220px;
	overflow-y: auto;
	width: calc(100% - 2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.rtec-eft-city-suggestion {
	padding: 8px 12px;
	cursor: pointer;
	font-size: 0.95em;
}

.rtec-eft-city-suggestion:hover,
.rtec-eft-city-suggestion.active {
	background: #e3f2fd;
}

.rtec-form-field .rtec-input-wrapper {
	position: relative;
}

/* Horizontal flow (options displayed inline + wrap) */
.rtec-eft-horizontal-flow,
.rtec-eft-radio-options-wrap.rtec-eft-radio-horizontal {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

/* Reduce extra spacing when flex layout is active */
.rtec-eft-horizontal-flow .rtec-checkbox-option-wrap,
.rtec-eft-radio-options-wrap.rtec-eft-radio-horizontal .rtec-checkbox-option-wrap {
	margin: 0;
}

/* Field layout: half/full width control (override theme/RTEC defaults) */
#rtec .rtec-form-fields-wrapper.rtec-eft-width-layout {
	display: flex !important;
	flex-wrap: wrap !important;
	column-gap: 2% !important;
	row-gap: 0 !important;
	align-items: flex-start;
}

#rtec .rtec-form-fields-wrapper.rtec-eft-width-layout .rtec-form-field {
	box-sizing: border-box;
	flex: 0 0 100% !important;
	max-width: 100% !important;
	width: 100% !important;
	float: none !important;
	clear: none !important;
}

#rtec .rtec-form-fields-wrapper.rtec-eft-width-layout .rtec-form-field.rtec-eft-width-half {
	flex: 0 0 49% !important;
	max-width: 49% !important;
	width: 49% !important;
}

#rtec .rtec-form-fields-wrapper.rtec-eft-width-layout .rtec-form-field.rtec-eft-width-full {
	flex: 0 0 100% !important;
	max-width: 100% !important;
	width: 100% !important;
}

@media (max-width: 640px) {
	#rtec .rtec-form-fields-wrapper.rtec-eft-width-layout .rtec-form-field.rtec-eft-width-half {
		flex: 0 0 100% !important;
		max-width: 100% !important;
		width: 100% !important;
	}
}

/* Inline with label: place options on the same line as the field label */
#rtec .rtec-form-field.rtec-eft-inline-with-label {
	flex-wrap: wrap;
	align-items: center;
	gap: 0 16px;
}

/* Use a class to set flex display so jQuery .hide()/.show() can override it. */
#rtec .rtec-form-field.rtec-eft-inline-with-label.rtec-eft-inline-active {
	display: flex !important;
}

#rtec .rtec-form-field.rtec-eft-inline-with-label > label,
#rtec .rtec-form-field.rtec-eft-inline-with-label > .rtec-field-label {
	margin-right: 12px;
	margin-bottom: 0;
	flex-shrink: 0;
	white-space: nowrap;
}

#rtec .rtec-form-field.rtec-eft-inline-with-label .rtec-eft-inline-with-label-options {
	flex: 1 1 auto;
}

@media (max-width: 480px) {
	#rtec .rtec-form-field.rtec-eft-inline-with-label {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* ═══════════════════════════════════════════════════════════════════════
   MULTI-USER BATCH REGISTRATION
   ═══════════════════════════════════════════════════════════════════════ */

/* Person cards container */
.rtec-eft-persons-list {
    margin-bottom: 16px;
}

/* Individual person card */
.rtec-eft-person-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fafafa;
}

.rtec-eft-person-card:hover {
    background: #f4f4f4;
}

/* Card header: checkbox or registered badge */
.rtec-eft-card-header {
    flex: 0 0 auto;
    min-width: 140px;
}

.rtec-eft-card-checkbox-wrap {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.rtec-eft-card-checkbox-wrap input[type="checkbox"] {
    margin: 0;
}

.rtec-eft-card-registered {
    display: inline-block;
    color: #2e7d32;
    font-weight: 600;
    font-size: 0.9em;
}

/* Card summary */
.rtec-eft-card-summary {
    flex: 1 1 200px;
    font-size: 0.95em;
    line-height: 1.4;
}

.rtec-eft-card-summary strong {
    font-size: 1em;
}

.rtec-eft-card-detail {
    color: #555;
    font-size: 0.9em;
}

/* Card action buttons */
.rtec-eft-card-actions {
    flex: 0 0 auto;
    display: flex;
    gap: 6px;
    align-items: center;
}

.rtec-eft-card-actions button {
    background: none;
    border: 1px solid #ccc;
    border-radius: 3px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.85em;
    line-height: 1.3;
    color: #555;
    white-space: nowrap;
}

.rtec-eft-card-actions button:hover {
    background: #eee;
    color: #333;
}

.rtec-eft-btn-cancel {
    color: #c62828 !important;
    border-color: #e57373 !important;
}

.rtec-eft-btn-cancel:hover {
    background: #ffebee !important;
}

.rtec-eft-btn-remove {
    color: #b71c1c !important;
}

.rtec-eft-btn-remove:hover {
    background: #ffcdd2 !important;
}

/* Edit mode within card */
.rtec-eft-card-inline-fields {
    width: 100%;
    padding: 8px 0 4px;
    border-top: 1px dashed #ccc;
    margin-top: 4px;
}

.rtec-eft-card-inline-fields .rtec-form-field {
    margin-bottom: 8px;
}

.rtec-eft-btn-apply-all {
    display: block;
    margin: 10px 0 4px;
    padding: 5px 14px;
    font-size: 0.82em;
    color: #555;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.rtec-eft-btn-apply-all:hover {
    background: #e3e3e3;
    color: #333;
}

.rtec-eft-card-edit {
    width: 100%;
    padding-top: 8px;
    border-top: 1px solid #ddd;
    margin-top: 4px;
}

.rtec-eft-card-edit .rtec-form-field {
    margin-bottom: 8px;
}

.rtec-eft-card-edit-buttons {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.rtec-eft-btn-update-person {
    background: #1976d2 !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 0.9em !important;
}

.rtec-eft-btn-update-person:hover {
    background: #1565c0 !important;
}

.rtec-eft-btn-cancel-edit {
    background: #eee !important;
    border: 1px solid #ccc !important;
    padding: 6px 12px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 0.9em !important;
}

/* Add/cancel person buttons */
.rtec-eft-add-person-btns {
    margin: 12px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.rtec-eft-btn-add-person,
.rtec-eft-btn-cancel-add {
    background: #f5f5f5;
    border: 1px solid #bbb;
    border-radius: 3px;
    padding: 6px 14px;
    cursor: pointer;
    font-size: 0.9em;
}

.rtec-eft-btn-add-person:hover {
    background: #e8e8e8;
}

.rtec-eft-btn-cancel-add {
    color: #777;
}

.rtec-eft-btn-cancel-add:hover {
    background: #e8e8e8;
}

/* Validation message */
.rtec-eft-validation-msg {
    margin: 8px 0;
}

.rtec-eft-validation-msg .rtec-error-message {
    color: #c62828;
    font-size: 0.9em;
}

/* Responsive: stack card contents on small screens */
@media (max-width: 480px) {
    .rtec-eft-person-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .rtec-eft-card-header {
        min-width: auto;
    }

    .rtec-eft-card-actions {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Inline field validation error messages */
.rtec-eft-field-error-msg {
	color: #c62828;
	font-size: 0.88em;
	margin-top: 4px;
	margin-bottom: 0;
}
