/**
 * CountrySelect - Country selection popup styles
 */

/* Overlay */
.cs-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	backdrop-filter: blur(4px);
}

.cs-overlay.cs-visible {
	opacity: 1;
	visibility: visible;
}

/* Modal */
.cs-modal {
	background: #ffffff;
	width: 700px;
	max-width: 90vw;
	max-height: 85vh;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
	display: flex;
	flex-direction: column;
	transform: translateY(-20px) scale(0.95);
	transition: transform 0.3s ease;
	overflow: hidden;
}

.cs-overlay.cs-visible .cs-modal {
	transform: translateY(0) scale(1);
}

/* Header */
.cs-header {
	padding: 1.5rem;
	border-bottom: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.cs-header-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	margin-bottom: 1rem;
}

.cs-header-info {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.cs-title {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: #1e293b;
}

.cs-counter {
	font-size: 0.875rem;
	color: #64748b;
}

.cs-counter .cs-count {
	font-weight: 600;
	color: #3b82f6;
}

.cs-close {
	background: none;
	border: none;
	font-size: 1.5rem;
	color: #64748b;
	cursor: pointer;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 6px;
	transition: all 0.15s ease;
	line-height: 1;
}

.cs-close:hover {
	background: #f1f5f9;
	color: #1e293b;
}

/* Search */
.cs-search-container {
	position: relative;
}

.cs-search-input {
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	font-size: 0.9375rem;
	outline: none;
	transition: border-color 0.2s, box-shadow 0.2s;
	box-sizing: border-box;
}

.cs-search-input:focus {
	border-color: #3b82f6;
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.cs-search-input::placeholder {
	color: #94a3b8;
}

/* Body */
.cs-body {
	flex: 1;
	overflow-y: auto;
	padding: 1rem 1.5rem;
}

/* Sections */
.cs-section {
	margin-bottom: 1.25rem;
}

.cs-section:last-child {
	margin-bottom: 0;
}

.cs-section-title {
	font-size: 0.75rem;
	font-weight: 600;
	color: #64748b;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-bottom: 0.75rem;
}

/* Regions */
.cs-regions-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.cs-region-btn {
	padding: 0.5rem 1rem;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	color: #475569;
	cursor: pointer;
	transition: all 0.15s ease;
}

.cs-region-btn:hover {
	border-color: #3b82f6;
	color: #3b82f6;
	background: #eff6ff;
}

.cs-region-btn.cs-active {
	background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
	border-color: transparent;
	color: #ffffff;
}

/* Countries list */
.cs-countries-list {
	max-height: 350px;
	overflow-y: auto;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
}

/* Country item */
.cs-country-item {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border-bottom: 1px solid #f1f5f9;
	cursor: pointer;
	transition: background 0.15s ease;
}

.cs-country-item:last-child {
	border-bottom: none;
}

.cs-country-item:hover {
	background: #f8fafc;
}

.cs-country-item.cs-selected {
	background: #eff6ff;
}

.cs-country-item.cs-selected:hover {
	background: #dbeafe;
}

/* All countries option */
.cs-country-item.cs-all-countries {
	font-weight: 600;
	border-bottom: 2px solid #e2e8f0;
	background: #f8fafc;
}

.cs-country-item.cs-all-countries.cs-selected {
	background: #dbeafe;
}

/* Checkbox */
.cs-checkbox {
	width: 18px;
	height: 18px;
	margin: 0;
	cursor: pointer;
	accent-color: #3b82f6;
	flex-shrink: 0;
}

/* Country name */
.cs-country-name {
	flex: 1;
	font-size: 0.9375rem;
	color: #334155;
}

/* Country flag */
.cs-country-flag {
	font-size: 1.25rem;
	flex-shrink: 0;
}

/* Footer */
.cs-footer {
	padding: 1rem 1.5rem;
	border-top: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.75rem;
	flex-shrink: 0;
}

/* Buttons */
.cs-btn {
	padding: 0.625rem 1.25rem;
	border-radius: 8px;
	font-size: 0.9375rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.15s ease;
	border: none;
	outline: none;
}

.cs-btn-reset {
	background: #f1f5f9;
	color: #64748b;
}

.cs-btn-reset:hover {
	background: #e2e8f0;
	color: #475569;
}

.cs-btn-apply {
	background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
	color: #ffffff;
}

.cs-btn-apply:hover {
	box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Responsive */
@media (max-width: 640px) {
	.cs-modal {
		width: 95vw;
		max-height: 90vh;
		border-radius: 12px;
	}

	.cs-header {
		padding: 1rem;
	}

	.cs-body {
		padding: 1rem;
	}

	.cs-footer {
		padding: 1rem;
	}

	.cs-countries-list {
		max-height: 280px;
	}
}

/* Print */
@media print {
	.cs-overlay {
		display: none !important;
	}
}
