/**
 * Account Management Styles
 * Styles for Room Types and Rooms management in My Account > Listings
 *
 * @package Listing_Room_Type_Manager
 */

/* ==========================================================================
   Modal Base Styles (Matching Routiz structure)
   ========================================================================== */

.lrtm-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	display: none;
	opacity: 0;
	transition: opacity 0.3s ease;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
}

/* Ensure WordPress media modal appears above our modal */
.media-modal {
	z-index: 999999 !important;
}

.media-modal-backdrop {
	z-index: 999998 !important;
}

/* Ensure WordPress admin bar stays on top */
#wpadminbar {
	z-index: 9999999 !important;
}

.lrtm-modal-active {
	display: block;
	opacity: 1;
}

.lrtm-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	z-index: 1;
}

.lrtm-modal-container {
	position: relative;
	max-width: 900px;
	width: 90%;
	margin: 50px auto;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
	z-index: 2;
	min-height: 200px;
	margin-bottom: 50px;
}

/* ==========================================================================
   Modal Header
   ========================================================================== */

.lrtm-modal-header {
	padding: 25px 30px;
	border-bottom: 1px solid #e5e5e5;
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: #fff;
	border-radius: 8px 8px 0 0;
}

.lrtm-modal-header h3 {
	margin: 0;
	font-size: 22px;
	font-weight: 600;
	color: #333;
}

.lrtm-modal-close {
	background: transparent;
	border: none;
	font-size: 24px;
	color: #999;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 4px;
	transition: all 0.2s ease;
}

.lrtm-modal-close:hover {
	background: #f5f5f5;
	color: #333;
}

/* ==========================================================================
   Modal Body
   ========================================================================== */

.lrtm-modal-body {
	padding: 20px;
	background: #fff;
}

/* Let Routiz handle padding for rz-modal-container */
#lrtm-room-type-form-modal .rz-modal-container {
	/* Routiz adds its own padding, don't override */
}

/* ==========================================================================
   Modal Footer
   ========================================================================== */

.lrtm-modal-footer {
	padding: 20px 30px;
	border-top: 1px solid #e5e5e5;
	text-align: right;
	background: #fff;
	border-radius: 0 0 8px 8px;
}

/* ==========================================================================
   Table Styles
   ========================================================================== */

.lrtm-table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
}

.lrtm-table thead th {
	background: #f8f8f8;
	padding: 12px 15px;
	text-align: left;
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	color: #666;
	border-bottom: 2px solid #e5e5e5;
}

.lrtm-table tbody tr {
	border-bottom: 1px solid #e5e5e5;
	transition: background 0.2s ease;
}

.lrtm-table tbody tr:hover {
	background: #f9f9f9;
}

.lrtm-table tbody td {
	padding: 15px;
	vertical-align: middle;
}

.lrtm-table-image {
	width: 60px;
}

.lrtm-table-image img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

.lrtm-no-image {
	width: 60px;
	height: 60px;
	background: #f5f5f5;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ccc;
	font-size: 24px;
}

.lrtm-room-count {
	color: #888;
	font-size: 12px;
}

.lrtm-status {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	text-transform: capitalize;
}

.lrtm-status-publish {
	background: #d4edda;
	color: #155724;
}

.lrtm-status-draft {
	background: #fff3cd;
	color: #856404;
}

.lrtm-status-pending {
	background: #d1ecf1;
	color: #0c5460;
}

.lrtm-table-actions {
	text-align: right;
	white-space: nowrap;
}

.lrtm-btn {
	background: transparent;
	border: 1px solid #ddd;
	padding: 8px 12px;
	border-radius: 4px;
	cursor: pointer;
	transition: all 0.2s ease;
	margin-left: 5px;
	font-size: 14px;
}

.lrtm-btn:hover {
	background: #f5f5f5;
}

.lrtm-btn-sm {
	padding: 6px 10px;
	font-size: 13px;
}

.lrtm-btn-edit {
	color: #007bff;
	border-color: #007bff;
}

.lrtm-btn-edit:hover {
	background: #007bff;
	color: #fff;
}

.lrtm-btn-delete {
	color: #dc3545;
	border-color: #dc3545;
}

.lrtm-btn-delete:hover {
	background: #dc3545;
	color: #fff;
}

/* ==========================================================================
   Empty State
   ========================================================================== */

.lrtm-empty-state {
	text-align: center;
	padding: 60px 20px;
	color: #999;
}

.lrtm-empty-state i {
	font-size: 64px;
	margin-bottom: 20px;
	opacity: 0.3;
}

.lrtm-empty-state p {
	margin: 0;
	font-size: 16px;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.lrtm-loading {
	text-align: center;
	padding: 60px 20px;
	font-size: 16px;
	color: #666;
}

.lrtm-loading i {
	margin-right: 10px;
}

.lrtm-error {
	background: #f8d7da;
	color: #721c24;
	padding: 15px;
	border-radius: 4px;
	margin: 20px 0;
}

/* ==========================================================================
   Form Styles
   ========================================================================== */

.lrtm-form {
	max-width: 100%;
	min-height: 200px;
}

.lrtm-form-row {
	margin-bottom: 25px;
}

.lrtm-form-row-half {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 20px;
}

.lrtm-label {
	display: block;
	margin-bottom: 8px;
	font-weight: 600;
	font-size: 14px;
	color: #333;
}

.lrtm-label.lrtm-required:after {
	content: ' *';
	color: #dc3545;
}

.lrtm-input,
.lrtm-textarea {
	width: 100%;
	padding: 10px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	transition: border-color 0.2s ease;
}

.lrtm-input:focus,
.lrtm-textarea:focus {
	outline: none;
	border-color: #007bff;
}

.lrtm-textarea {
	resize: vertical;
	min-height: 100px;
}

.lrtm-field-description {
	margin-top: 8px;
	font-size: 13px;
	color: #888;
}

.lrtm-form-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid #e5e5e5;
}

/* ==========================================================================
   Gallery Upload
   ========================================================================== */

.lrtm-gallery-upload {
	border: 2px dashed #ddd;
	border-radius: 4px;
	padding: 20px;
	text-align: center;
}

.lrtm-gallery-preview {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
	gap: 15px;
	margin-bottom: 20px;
}

.lrtm-gallery-item {
	position: relative;
	aspect-ratio: 1;
	border-radius: 4px;
	overflow: hidden;
	border: 2px solid #e5e5e5;
}

.lrtm-gallery-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.lrtm-remove-image {
	position: absolute;
	top: 5px;
	right: 5px;
	background: rgba(220, 53, 69, 0.9);
	color: #fff;
	border: none;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.2s ease;
	font-size: 12px;
}

.lrtm-gallery-item:hover .lrtm-remove-image {
	opacity: 1;
}

.lrtm-upload-gallery {
	margin-top: 15px;
}

/* ==========================================================================
   Listing Type Picker
   ========================================================================== */

.lrtm-picker-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lrtm-picker-dialog {
	background: #fff;
	border-radius: 8px;
	padding: 30px;
	max-width: 420px;
	width: 90%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.lrtm-picker-dialog h3 {
	margin: 0 0 10px;
	font-size: 20px;
	font-weight: 600;
	color: #333;
}

.lrtm-picker-dialog p {
	margin: 0 0 20px;
	font-size: 14px;
	color: #666;
}

.lrtm-picker-select {
	width: 100%;
	padding: 10px 15px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	font-family: inherit;
	margin-bottom: 20px;
}

.lrtm-picker-select:focus {
	outline: none;
	border-color: #007bff;
}

.lrtm-picker-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
}

.lrtm-picker-cancel {
	background: transparent;
	border: 1px solid #ddd;
	padding: 8px 20px;
	border-radius: 4px;
	cursor: pointer;
	font-size: 14px;
	color: #666;
}

.lrtm-picker-cancel:hover {
	background: #f5f5f5;
}

/* ==========================================================================
   Listing Type Badge (in tables)
   ========================================================================== */

.lrtm-listing-type-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 600;
	background: #e8f4fd;
	color: #0c5460;
	text-transform: capitalize;
}

/* ==========================================================================
   Manage Buttons (in listings page)
   ========================================================================== */

.lrtm-manage-room-types,
.lrtm-manage-rooms {
	margin-top: 10px;
	width: 100%;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.lrtm-modal-container {
		margin: 20px 10px;
		width: calc(100% - 20px);
	}

	.lrtm-modal-header,
	.lrtm-modal-body,
	.lrtm-modal-footer {
		padding: 20px;
	}

	.lrtm-modal-header h3 {
		font-size: 18px;
		padding-right: 30px;
	}

	.lrtm-modal {
		padding: 10px 0;
	}

	.lrtm-form-row-half {
		grid-template-columns: 1fr;
	}

	.lrtm-table {
		font-size: 13px;
	}

	.lrtm-table tbody td {
		padding: 10px;
	}

	.lrtm-table-actions .lrtm-btn {
		padding: 5px 8px;
		font-size: 12px;
	}

	.lrtm-gallery-preview {
		grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
		gap: 10px;
	}
}

@media (max-width: 480px) {
	.lrtm-modal-header h3 {
		font-size: 18px;
	}

	.lrtm-table thead {
		display: none;
	}

	.lrtm-table tbody tr {
		display: block;
		margin-bottom: 15px;
		border: 1px solid #e5e5e5;
		border-radius: 4px;
	}

	.lrtm-table tbody td {
		display: block;
		text-align: right;
		padding: 10px 15px;
		border-bottom: 1px solid #f5f5f5;
	}

	.lrtm-table tbody td:before {
		content: attr(data-label);
		float: left;
		font-weight: 600;
		color: #666;
	}

	.lrtm-table-image {
		width: 100%;
		text-align: center;
	}

	.lrtm-table-image img,
	.lrtm-no-image {
		margin: 0 auto;
	}
}

/* ==========================================================================
   Room Type Display Settings Dialog
   ========================================================================== */

.lrtm-settings-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.6);
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
}

.lrtm-settings-dialog {
	background: #fff;
	border-radius: 8px;
	padding: 30px;
	max-width: 480px;
	width: 90%;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.lrtm-settings-dialog h3 {
	margin: 0 0 20px;
	font-size: 20px;
	font-weight: 600;
	color: #333;
}

.lrtm-settings-field {
	margin-bottom: 15px;
}

.lrtm-settings-field label {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: #333;
	cursor: pointer;
}

.lrtm-settings-field input[type="checkbox"],
.lrtm-settings-field input[type="radio"] {
	width: 16px;
	height: 16px;
	flex-shrink: 0;
}

.lrtm-settings-actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 25px;
	padding-top: 20px;
	border-top: 1px solid #e5e5e5;
}

.lrtm-btn-settings {
	color: #666;
	border-color: #ccc;
}

.lrtm-btn-settings:hover {
	background: #666;
	color: #fff;
	border-color: #666;
}
