/* ============================================
   SOLISHTIRISH (COMPARE) STILLARI
   ============================================ */

/* Header'dagi solishtirish linki */
.header-compare {
	display: inline-block;
	vertical-align: middle;
	margin-left: 20px;
	position: relative;
}

header .container .header-compare {
	float: right;
	margin-left: 15px;
	margin-top: 5px;
}

.header-compare .compare-link {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	color: #333;
	text-decoration: none;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.1);
	transition: all 0.3s ease;
}

.header-compare .compare-link:hover {
	background: rgba(255, 255, 255, 0.2);
	transform: scale(1.1);
}

.header-compare .compare-link i {
	font-size: 1.3rem;
}

.header-compare .compare-count {
	position: absolute;
	top: -5px;
	right: -5px;
	background: #ef4444;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	min-width: 20px;
	height: 20px;
	border-radius: 10px;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 0 6px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header-compare .compare-count:not(:empty) {
	display: flex;
}

/* Modal */
.compare-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 10000;
	display: none;
}

.compare-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(4px);
}

.compare-modal-content {
	position: relative;
	width: 95%;
	max-width: 1200px;
	max-height: 90vh;
	margin: 5vh auto;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: compareModalSlideIn 0.3s ease;
}

@keyframes compareModalSlideIn {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.compare-modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid #e5e7eb;
	background: #f9fafb;
}

.compare-modal-header h2 {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	color: #111827;
}

.compare-modal-close {
	background: none;
	border: none;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	color: #6b7280;
	font-size: 1.2rem;
	transition: all 0.2s ease;
}

.compare-modal-close:hover {
	background: #e5e7eb;
	color: #111827;
}

.compare-modal-body {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	min-height: 200px;
}

/* Empty state */
.compare-empty {
	text-align: center;
	padding: 60px 20px;
	color: #6b7280;
}

.compare-empty i {
	font-size: 4rem;
	color: #d1d5db;
	margin-bottom: 20px;
}

.compare-empty p {
	margin: 10px 0;
	font-size: 1.1rem;
}

.compare-empty-hint {
	font-size: 0.9rem;
	color: #9ca3af;
}

/* Compare table */
.compare-table-wrapper {
	overflow-x: auto;
}

.compare-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
}

.compare-table thead {
	background: #f9fafb;
	position: sticky;
	top: 0;
	z-index: 10;
}

.compare-table th {
	padding: 12px;
	text-align: left;
	font-weight: 600;
	color: #374151;
	border-bottom: 2px solid #e5e7eb;
	white-space: nowrap;
}

.compare-table td {
	padding: 16px 12px;
	border-bottom: 1px solid #e5e7eb;
	vertical-align: middle;
}

.compare-table tbody tr:hover {
	background: #f9fafb;
}

.compare-table tbody tr:last-child td {
	border-bottom: none;
}

.compare-dacha-img {
	width: 80px;
	height: 60px;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: 8px;
}

.compare-dacha-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.compare-dacha-title {
	font-weight: 500;
	color: #111827;
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.compare-view-btn {
	display: inline-block;
	padding: 6px 12px;
	background: #2563eb;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	font-size: 0.875rem;
	margin-right: 8px;
	transition: background 0.2s ease;
}

.compare-view-btn:hover {
	background: #1d4ed8;
}

.compare-remove-btn {
	background: #ef4444;
	color: #fff;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.875rem;
	transition: background 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.compare-remove-btn:hover {
	background: #dc2626;
}

.compare-modal-footer {
	padding: 16px 24px;
	border-top: 1px solid #e5e7eb;
	background: #f9fafb;
	display: flex;
	justify-content: flex-end;
}

.compare-clear-btn {
	padding: 10px 20px;
	background: #6b7280;
	color: #fff;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.95rem;
	transition: background 0.2s ease;
}

.compare-clear-btn:hover {
	background: #4b5563;
}

.compare-error {
	padding: 40px;
	text-align: center;
	color: #ef4444;
}

/* Vertikal solishtirish jadvali */
.compare-table-wrapper-vertical {
	overflow-x: auto;
	width: 100%;
}

.compare-table-vertical {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	min-width: 800px;
}

.compare-table-vertical thead {
	background: #f9fafb;
	position: sticky;
	top: 0;
	z-index: 10;
}

.compare-table-vertical thead th:first-child {
	z-index: 12;
}

.compare-table-vertical th {
	padding: 16px 12px;
	text-align: left;
	font-weight: 600;
	color: #374151;
	border-bottom: 2px solid #e5e7eb;
	border-right: 1px solid #e5e7eb;
	vertical-align: top;
}

.compare-table-vertical th:first-child {
	background: #f3f4f6;
	min-width: 150px;
	max-width: 200px;
	position: sticky;
	left: 0;
	z-index: 11;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.compare-table-vertical td {
	padding: 12px;
	border-bottom: 1px solid #e5e7eb;
	border-right: 1px solid #e5e7eb;
	vertical-align: middle;
}

.compare-table-vertical td:first-child {
	background: #f9fafb;
	font-weight: 600;
	position: sticky;
	left: 0;
	z-index: 1;
	min-width: 150px;
	max-width: 200px;
	box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
}

.compare-table-vertical tbody tr:hover td:first-child {
	background: #f3f4f6;
}

.compare-table-vertical tbody tr:hover .compare-property-label {
	background: #f3f4f6;
}

.compare-table-vertical tbody tr:hover {
	background: #f9fafb;
}

.compare-property-header {
	background: #f3f4f6 !important;
	font-weight: 700;
	font-size: 1rem;
}

.compare-dacha-header {
	text-align: center;
	min-width: 200px;
}

.compare-dacha-header-img {
	width: 100%;
	height: 120px;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 12px;
}

.compare-dacha-header-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.compare-dacha-header-title {
	font-weight: 600;
	color: #111827;
	margin-bottom: 12px;
	font-size: 1rem;
	line-height: 1.4;
	min-height: 40px;
}

.compare-dacha-header-actions {
	display: flex;
	gap: 8px;
	justify-content: center;
	margin-top: 8px;
}

.compare-view-btn-small {
	display: inline-block;
	padding: 6px 12px;
	background: #2563eb;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	font-size: 0.875rem;
	transition: background 0.2s ease;
}

.compare-view-btn-small:hover {
	background: #1d4ed8;
}

.compare-remove-btn-small {
	background: #ef4444;
	color: #fff;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	cursor: pointer;
	font-size: 0.875rem;
	transition: background 0.2s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.compare-remove-btn-small:hover {
	background: #dc2626;
}

.compare-property-label {
	font-weight: 600;
	color: #374151;
	background: #f9fafb;
}

.compare-property-value {
	text-align: center;
	color: #4b5563;
}

.compare-comfort-header {
	background: #e5e7eb;
	font-weight: 700;
}

.compare-comfort-header td {
	background: #e5e7eb;
	padding: 12px;
	font-size: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
	.compare-modal-content {
		width: 100%;
		max-height: 100vh;
		margin: 0;
		border-radius: 0;
	}

	.compare-table-vertical {
		font-size: 0.85rem;
		min-width: 600px;
	}

	.compare-table-vertical th,
	.compare-table-vertical td {
		padding: 10px 8px;
	}

	.compare-dacha-header-img {
		height: 80px;
	}

	.header-compare {
		margin-left: 10px;
	}
}
