/**
 * CREHQ Companies Integration Styles
 *
 * @package CREHQ\CompanyLocations
 * @since   2.5.0
 */

/* ==========================================================================
   Meta Box Styles
   ========================================================================== */

.crehq-locations-overview,
.crehq-discovery-actions {
	font-size: 13px;
}

.locations-stat,
.confidence-score,
.last-sync {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 0;
	border-bottom: 1px solid #eee;
}

.locations-stat:last-child,
.last-sync:last-child {
	border-bottom: none;
}

.stat-label {
	font-weight: 600;
	color: #1d2327;
}

.stat-value {
	font-size: 18px;
	font-weight: 700;
	color: #2271b1;
}

.confidence-good {
	color: #00a32a !important;
}

.confidence-low {
	color: #d63638 !important;
}

/* Status Breakdown */
.locations-breakdown {
	margin: 15px 0;
	padding-top: 10px;
	border-top: 1px solid #eee;
}

.locations-breakdown h4 {
	margin: 0 0 10px;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.locations-breakdown ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.locations-breakdown li {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 6px 0;
}

.status-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
}

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

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

.status-closed {
	background: #f8d7da;
	color: #721c24;
}

.status-count {
	font-weight: 600;
	color: #50575e;
}

/* Actions */
.locations-actions,
.discovery-buttons {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #eee;
}

.button-block {
	display: block;
	width: 100%;
	text-align: center;
	margin-bottom: 8px;
}

.button-block:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Frontend Location Display
   ========================================================================== */

.crehq-locations-display {
	padding: 30px 0;
}

.locations-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 30px;
	flex-wrap: wrap;
	gap: 20px;
}

.locations-header h3 {
	margin: 0;
	font-size: 24px;
	font-weight: 700;
	color: #1d2327;
}

.locations-filter {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.locations-filter select,
.locations-filter input {
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
}

.locations-filter input {
	min-width: 200px;
}

/* Locations Map */
#locations-map {
	border: 1px solid #ddd;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Locations List */
.locations-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
	margin-top: 30px;
}

.location-card {
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	padding: 20px;
	transition: all 0.3s ease;
	cursor: pointer;
}

.location-card:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	border-color: #2271b1;
}

.location-card.hidden {
	display: none;
}

.location-card.highlighted {
	border-color: #2271b1;
	box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
	background: #f6f9fc;
}

.location-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	margin-bottom: 15px;
	gap: 10px;
}

.location-header h4 {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
	flex: 1;
}

.location-details p {
	margin: 0 0 10px;
	font-size: 14px;
	color: #50575e;
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.location-details p:last-child {
	margin-bottom: 0;
}

.location-details i {
	color: #2271b1;
	margin-top: 2px;
	flex-shrink: 0;
}

.location-details .address {
	line-height: 1.6;
}

.location-details .confidence {
	padding-top: 10px;
	border-top: 1px solid #eee;
	margin-top: 10px;
	font-size: 12px;
	color: #666;
}

/* ==========================================================================
   Admin List Table
   ========================================================================== */

.wp-list-table .column-location_count {
        width: 80px;
}

.wp-list-table .locations-count {
	display: inline-block;
	padding: 4px 10px;
	background: #2271b1;
	color: #fff;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
}

.row-actions span.discover_locations a,
.row-actions span.view_locations a {
	color: #2271b1;
}

.row-actions span.discover_locations a:hover,
.row-actions span.view_locations a:hover {
	color: #135e96;
}

/* ==========================================================================
   Dashboard Widget
   ========================================================================== */

.crehq-integration-widget {
	padding: 12px;
}

.integration-stat {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 0;
	border-bottom: 1px solid #eee;
}

.integration-stat:last-child {
	border-bottom: none;
}

.integration-stat-label {
	font-weight: 600;
	color: #1d2327;
}

.integration-stat-value {
	font-size: 20px;
	font-weight: 700;
	color: #2271b1;
}

.integration-actions {
	margin-top: 15px;
	padding-top: 15px;
	border-top: 1px solid #eee;
}

.integration-actions a {
	display: block;
	padding: 8px 12px;
	background: #f0f0f1;
	color: #2271b1;
	text-decoration: none;
	border-radius: 4px;
	margin-bottom: 8px;
	text-align: center;
	transition: all 0.2s;
}

.integration-actions a:hover {
	background: #2271b1;
	color: #fff;
}

/* ==========================================================================
   Map Markers & Popups
   ========================================================================== */

/* Custom marker styling */
.custom-marker {
	background: transparent;
	border: none;
}

.marker-pin {
	width: 30px;
	height: 42px;
	position: relative;
	font-size: 30px;
	text-align: center;
	line-height: 42px;
}

.marker-pin i {
	color: #2271b1;
	filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.marker-active i {
	color: #00a32a;
}

.marker-coming-soon i {
	color: #dba617;
}

.marker-closed i {
	color: #d63638;
}

/* Location popup styling */
.location-popup {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	padding: 10px;
}

.location-popup h4 {
	margin: 0 0 8px;
	font-size: 16px;
	font-weight: 600;
	color: #1d2327;
}

.location-popup p {
	margin: 0 0 8px;
	font-size: 13px;
	color: #50575e;
	line-height: 1.5;
}

.location-popup .status-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	margin-top: 5px;
}

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

@media (max-width: 782px) {
	.locations-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.locations-filter {
		width: 100%;
	}

	.locations-filter select,
	.locations-filter input {
		width: 100%;
	}

	.locations-list {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 600px) {
	.location-header {
		flex-direction: column;
		align-items: flex-start;
	}
}
