/**
 * Coach Location Selector Styles
 * Minimal modern design for the Google Places powered location selector
 *
 * @package TennisCoachGenerator
 */

/* Search textarea wrapper */
.coach-location-input-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Search textarea field */
.coach-location-search {
  resize: vertical;
}
.coach-location-search:disabled {
  background-color: #f7f7f7;
  color: #666;
  cursor: not-allowed;
}

/* Suggestions dropdown */
.coach-location-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #01529c;
  border: 1px solid #e1e5e9;
  border-top: none;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.15s ease;
  font-size: 14px;
}
.suggestion-item:hover,
.suggestion-item.active {
  background-color: #5cba44;
}
.suggestion-item:last-child {
  border-bottom: none;
}

/* Selected locations container */
.coach-location-selected {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* Tags container */
.coach-location-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0 5px;
}

/* Individual location tag */
.location-tag {
  display: inline-flex;
  align-items: center;
  background-color: #f0f6ff;
  border: 1px solid #b8d4ff;
  border-radius: 20px;
  padding: 6px 8px 6px 12px;
  font-size: 14px;
  color: #1e3a8a;
  max-width: 250px;
  transition: background-color 0.15s ease;
  margin-top: 7px;
}
.location-tag:hover {
  background-color: #e0f2fe;
}
.tag-text {
  margin-right: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.tag-remove {
  background-color: #01529c;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 2px;
  margin: 0;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.tag-remove:hover {
  background-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.tag-remove:focus {
  outline: 2px solid #ef4444;
  outline-offset: 1px;
}

/* Counter display */
.coach-location-counter {
  color: #ffffff;
  margin-top: 4px;
  display: none;
}
.current-count {
  font-weight: 600;
  color: #5eba44;
}

/* Error message */
.coach-location-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 8px;
  animation: slideDown 0.2s ease;
}

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

/* CF7 validation error styling */
.coach-location-selector-wrapper.wpcf7-not-valid .coach-location-search {
  border-color: #dc2626;
}
.coach-location-selector-wrapper.wpcf7-not-valid .coach-location-search:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

/* CF7 validation error message */
.wpcf7-not-valid-tip {
  color: #dc2626;
  font-size: 12px;
  font-weight: 400;
  display: block;
  margin-top: 4px;
}

/* Responsive design */
@media (max-width: 768px) {
  .coach-location-search {
    font-size: 16px; /* Prevents zoom on iOS */
  }
  .location-tag {
    max-width: 200px;
  }
  .tag-text {
    max-width: 150px;
  }
  .coach-location-suggestions {
    max-height: 150px;
  }
}

@media (max-width: 480px) {
  .coach-location-tags {
    gap: 6px;
  }
  .location-tag {
    max-width: 100%;
    font-size: 13px;
    padding: 5px 6px 5px 10px;
  }
  .tag-text {
    max-width: calc(100% - 30px);
  }
  .tag-remove {
    width: 18px;
    height: 18px;
    font-size: 14px;
  }
}

/* Dark mode support */
/* @media (prefers-color-scheme: dark) {
	.coach-location-search {
		background-color: #1f2937;
		border-color: #374151;
		color: #f9fafb;
	}
	
	.coach-location-search:focus {
		border-color: #3b82f6;
		box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
	}
	
	.coach-location-suggestions {
		background-color: #1f2937;
		border-color: #374151;
	}
	
	.suggestion-item {
		color: #f9fafb;
		border-bottom-color: #374151;
	}
	
	.suggestion-item:hover,
	.suggestion-item.active {
		background-color: #374151;
	}
	
	.location-tag {
		background-color: #1e3a8a;
		border-color: #3b82f6;
		color: #dbeafe;
	}
	
	.location-tag:hover {
		background-color: #1e40af;
	}
	
	.tag-remove {
		color: #9ca3af;
	}
	
	.tag-remove:hover {
		background-color: rgba(239, 68, 68, 0.2);
		color: #f87171;
	}
	
	.coach-location-counter {
		color: #9ca3af;
	}
	
	.current-count {
		color: #f3f4f6;
	}
} */

/* High contrast mode support */
/* @media (prefers-contrast: high) {
	.coach-location-search {
		border-width: 3px;
	}
	
	.location-tag {
		border-width: 2px;
		font-weight: 600;
	}
	
	.tag-remove {
		border: 2px solid currentColor;
	}
} */

/* Reduced motion support */
/* @media (prefers-reduced-motion: reduce) {
	.coach-location-search,
	.suggestion-item,
	.location-tag,
	.tag-remove {
		transition: none;
	}
	
	.coach-location-error {
		animation: none;
	}
} */
